Page 1 of 1

about TChart's Custom axes

Posted: Fri Apr 30, 2004 8:21 am
by 6924795
Developing eviroment: VB6+teechart5
I creat a teechart
Now i want to unbind three area ,everyone has itself axis,how should i difine it and i don't know how to add custom axis in the demo,when success for it ,i want to add a series at every area !
please tell me how to do it
thank you

Posted: Fri Apr 30, 2004 8:47 am
by 6924795
A memont ago, I study DEMO again,I know
Step 1: chart -> axis -> add custom axis
here you can difine your owner area
Step 2:
chart ->add series
here you can add series
Step 3: series ->general ->horizontal ,vertical

Now i want to know how can i effect this result with coding

Posted: Fri Apr 30, 2004 9:28 am
by Chris
Hi --
A memont ago, I study DEMO again,I know
Step 1: chart -> axis -> add custom axis
here you can difine your owner area
Step 2:
chart ->add series
here you can add series
Step 3: series ->general ->horizontal ,vertical

Now i want to know how can i effect this result with coding
Try:

Code: Select all

Private Sub Form_Load()
Dim CustomAxis As TeeChart.IAxis
Dim CustomAxisIndex As Integer
With TChart1
    CustomAxisIndex = .Axis.AddCustom(False)
    Set CustomAxis = .Axis.Custom(CustomAxisIndex)
    CustomAxis.AxisPen.Color = vbRed
    
    .AddSeries scBar
    .Series(0).FillSampleValues 20
    .Series(0).VerticalAxisCustom = CustomAxisIndex
    
    .Panel.MarginLeft = 10
End With
End Sub
[/quote]