Center an axis at 0

TeeChart for ActiveX, COM and ASP
Post Reply
BWThorp
Newbie
Newbie
Posts: 8
Joined: Fri Apr 02, 2004 5:00 am

Center an axis at 0

Post by BWThorp » Thu Oct 14, 2004 7:13 pm

I have a data set that goes above and below the Y axis. One data set has the value 5 and the value -500. Another data set that I have has a value of 1100 and a value -90. What I would like to do is center 0 on the Y axis so that you can get a visible indicator of how high above or below you are.

I don't necessarily have to see the whole graph on the display, but I need the scale above and below to be the same.

Any help would be greatly appreciated.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Oct 18, 2004 9:19 am

Hi -
I have a data set that goes above and below the Y axis. One data set has the value 5 and the value -500. Another data set that I have has a value of 1100 and a value -90. What I would like to do is center 0 on the Y axis so that you can get a visible indicator of how high above or below you are.

I don't necessarily have to see the whole graph on the display, but I need the scale above and below to be the same.

Any help would be greatly appreciated.
You could try the IAxis.SetMinMax method, e.g.

Code: Select all

Private Sub Form_Load()
With TChart1
    .Aspect.View3D = False
    .AddSeries scPoint
    .Series(0).Add 5, "", clTeeColor
    .Series(0).Add -500, "", clTeeColor
    
    .AddSeries scPoint
    .Series(1).Add 1100, "", clTeeColor
    .Series(1).Add -90, "", clTeeColor
    
    .Axis.Left.SetMinMax -2000, 2000
End With
End Sub
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply