06-30-2006 11:35 AM
06-30-2006 03:15 PM
06-30-2006 03:50 PM
06-30-2006 04:12 PM
06-30-2006 07:48 PM
07-03-2006 01:03 PM
07-04-2006 02:03 AM
It should work, provided you RefreshGraph between autoscaling and retrieving axis range:
// Obtain original Y-axis scaling
GetAxisScalingMode (panel, PANEL_GRAPH, VAL_LEFT_YAXIS, NULL, &ymin, &ymax);
// Set graph to auto-scale and retrieve axis range
err = SetAxisScalingMode (panel, PANEL_GRAPH, VAL_LEFT_YAXIS, VAL_AUTOSCALE, 0, 0);
RefreshGraph (panel, PANEL_GRAPH);
GetAxisScalingMode (panel, PANEL_GRAPH, VAL_LEFT_YAXIS, NULL, &min, &max);
// Restore original axis scaling
SetAxisScalingMode (panel, PANEL_GRAPH, VAL_LEFT_YAXIS, VAL_MANUAL, ymin, ymax);
SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_VISIBLE, 1);
sprintf (msg, "Minimum and maximum are %.2f and %.2f.", min, max);
MessagePopup ("Values", msg);
This way the graph will flicker a little when autoscaling, but I found no way of avoiding it: hiding the graph before these lines and displaying it does prevents the graph to autoscale.