GetAxesScaleOverlap
Get XY scale range of data plot related to the layer's XY scale range.
int GetAxesScaleOverlap( double * pfX, double * pfY, DWORD dwCntrl = 0 )
< 0 means various error conditions like GORR_DATA_ZERO_WIDTH and
GORR_DATA_ZERO_HEIGHT;
GORR_NO_OVERLAP data plot range does not intersect with layer axes scale range;
GORR_OVERLAPPED data plot range has at least a portion inside the layer axes scale range.
EX1
// For this example to run, a graph window must exist in the project. // Then manually add some data to the graph and use the Axes dialog to rescale // the axes limits so that all the data is un-visible. The example will check if the // dataplot require rescale. void DataPlot_GetAxesScaleOverlap_ex1() { // the graph layer needs to be initialized: GraphLayer lay = Project.ActiveLayer(); // the active dataplot is needed for checking DataPlot dp = lay.DataPlots(-1); if(!dp.IsValid()) return; double dfx, dfy; bool bNeedRescale = false; int nRet = dp.GetAxesScaleOverlap(&dfx, &dfy); if ( nRet < 0 ) { bNeedRescale = false; error_report("error code:", nRet); } if ( GORR_NO_OVERLAP == nRet ) bNeedRescale = true; // Rescale the layer axes if necessary if(bNeedRescale) lay.Rescale(); }
origin.h