not able to set right axis using the following code

TeeChart for ActiveX, COM and ASP
Post Reply
Aravind
Newbie
Newbie
Posts: 75
Joined: Fri Nov 15, 2002 12:00 am

not able to set right axis using the following code

Post by Aravind » Fri Oct 06, 2006 2:31 pm

enclosing 2 files t1.tee & t2.tee

t2.tee is the base file in which 4 series are created of each bar type #

when i executed the below code i am getting t1 file .. ( which is nothing 2
graph types shown with 2 different axis but only axis is shown ,right axis
is not been able to set ... )

the same code worked fine with earlier version of the teechart . now i am
using version 7.1.1

posted the tee files
how can we set the right axis




below is the code segement ;
Dim j As Integer
j = TChart1.SeriesCount / 2
For i = 0 To j - 1
TChart1.ChangeSeriesType i, scBar
TChart1.Series(i).VerticalAxis = aLeftAxis
Next i
For i = j To TChart1.SeriesCount - 1
TChart1.ChangeSeriesType i, scLine
TChart1.Series(i).asLine.LinePen.Width = 3
TChart1.Series(i).VerticalAxis = aRightAxis

Next i
TChart1.Axis.Left.Automatic = True
TChart1.Axis.Right.Automatic = True

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Oct 06, 2006 3:00 pm

Hi Aravind,

For some reason all right axis properties are set to not visible so I had to modify your code to something like this:

Code: Select all

Private Sub Form_Load()
    Me.TeeCommander1.Chart = Me.TChart1
    TChart1.Import.LoadFromFile "e:\temp\t2.tee"
    
    Dim j As Integer
    j = TChart1.SeriesCount / 2
    For i = 0 To j - 1
        TChart1.ChangeSeriesType i, scBar
        TChart1.Series(i).VerticalAxis = aLeftAxis
    Next i
    
    For i = j To TChart1.SeriesCount - 1
        TChart1.ChangeSeriesType i, scLine
        TChart1.Series(i).asLine.LinePen.Width = 3
        TChart1.Series(i).VerticalAxis = aRightAxis
    Next i
    
    TChart1.Axis.Left.Automatic = True
    TChart1.Axis.Right.Automatic = True
    
    With TChart1.Axis.Right
        .Visible = True
        .AxisPen.Visible = True
        .Ticks.Visible = True
        .Labels.Visible = True
        .Labels.Font.Size = 8
    End With

End Sub
If it's done unexpectedly then please try to arrange a simple project that causes this (we need to see how the full chart is created) and post it in the attachments newsgroup.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply