TeeChart for ActiveX, COM and ASP
-
nbp
- Newbie
- Posts: 15
- Joined: Fri Apr 01, 2016 12:00 am
Post
by nbp » Wed Mar 08, 2017 8:33 pm
I'm using TChart 2015 ocx. I'm using the following piece of code to set the maximum and minimum values for the left axis
but I get an exception "Axis Maximum Value must be >= Minimum"
Code: Select all
double fIncr;
double fMax, fMin;
fMax = -0.6;
fMin = -0.35
fIncr = (fMax - fMin)/10;
CurrentAxis.SetAutomatic(false);
CurrentAxis.SetAutomaticMaximum(false);
CurrentAxis.SetAutomaticMinimum(false);
CurrentAxis.SetMaximum(fMax);
CurrentAxis.SetMinimum(fMin);
CurrentAxis.SetIncrement(fIncr);
However, when I replace it with CurrentAxis.SetMinMax(....) the exception goes away. Not sure why...
-
Yeray
- Site Admin
- Posts: 9613
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Thu Mar 09, 2017 11:10 am
Hello,
When you manually assign Maximum to -0.6, the Minimum is still 0 and it crashes. If you assigned Minimum before assigning Maximum it should work fine.