Page 1 of 1

SetMinMax for very small values. (eg. 1E-15)

Posted: Thu Dec 16, 2010 7:17 am
by 10054537
I have a requirement very similar to the user who posted this topic: http://www.teechart.net/support/viewtop ... xis#p29399.

Basically, I am trying to scale the left axis such that the centre of the left axis is always 0. Or alternatively said, the 0 value of the left axis is always at the centre of the chart. However, I am using a basic line chart, and the values I am trying to scale are in the order of 1E-15 and -1E-15.

I am currently doing something like this:

Code: Select all

TChart* pChart = new TChart();

// add series here
// ...

double maxVal = std::abs(pChart ->Series[0]->YValues->MaxValue);
double minVal = std::abs(pChart ->Series[0]->YValues->MinValue);

if ( minVal > maxVal )
    maxVal = minVal;

pChart->Axes->Left->SetMinMax(maxVal, - maxVal);
This works for series when using more normal values between say -100 and 100. However, with the very small values I am dealing with, the graph just flattens out to a straight line along the 0 axis.

Note: The automatic scaling works ok but it doesn't centre the left axis on 0; Additionally, it would be nice to see more labels for small values, right now I only just see "0" along the left axis, not 1e-01 1e-02 etc.

Re: SetMinMax for very small values. (eg. 1E-15)

Posted: Fri Dec 17, 2010 4:27 pm
by yeray