Page 1 of 1

not able to set right axis using the following code

Posted: Fri Oct 06, 2006 2:31 pm
by 6925851
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

Posted: Fri Oct 06, 2006 3:00 pm
by narcis
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.