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

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
seth
Newbie
Newbie
Posts: 3
Joined: Tue Oct 27, 2009 12:00 am

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

Post by seth » Thu Dec 16, 2010 7:17 am

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.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Fri Dec 17, 2010 4:27 pm

Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply