Page 1 of 1

Axis Maximum Value must be >= Minimum

Posted: Wed Mar 08, 2017 8:33 pm
by 16677938
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...

Re: Axis Maximum Value must be >= Minimum

Posted: Thu Mar 09, 2017 11:10 am
by yeray
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.