Setting Fixed Axis Limits
The automatic scaling features of Objective Chart attempt to give the best possible scale for the given data range. If this automatic scaling is not needed or presents problems of style, it is possible to lock the scales to an absolute range.
The fixed limits are utilized as specified. They are not expanded by AdjustScale(). They are not rounded to the nearest nice number for display.
To set fixed axis limits, call SetUseMaxScale(TRUE), SetMinRangeY(), and SetMaxRangeY(). The code snippet below shows how to set the y-axis scale to show values from 400 to 900.
SRGraphDisplay* pD = new SRGraphDisplay;
SRGraphStyle* pS = pD->GetStyle();
pS->SetGraphStyle(CX_GRAPH_LINE);
pS->SetUseMaxScale(TRUE); // manual scaling
pD->SetMinRangeY(400.); // range from 400 to 900
pD->SetMaxRangeY(900.);
For XY Scatter and related graphs with two numeric axes, use SetMinRangeY() and SetMaxRangeY() for the vertical (Y) axis and SetMinRangeX() and SetMaxRangeX() for the horizontal (X) axis. If limits are set for only one axis, the other axis is autoscaled.
To match the axis limits to the data range, call SetUseMaxScale(TRUE) and set the min and max limits to the same value. The axis is autoscaled, but the data range is not expanded by AdjustScale(). This can be a useful side effect as the axis limits closely represent the data range.






