Code: Select all
procedure TMProfiler_form.zoom_spinnerChange(Sender: TObject);
var z : double;
begin
ChartScrollBar1.Visible := zoom_spinner.Value <> 0;
if (zoom_spinner.Value < 0) then
z := ((10+zoom_spinner.Value)*10)/100
else if (zoom_spinner.Value = 0) then
z := 100 // if it's a percentage, then "no-zoom" should be 100 (?)
else
z := 100+((zoom_spinner.Value)*50);
Chart1.ZoomPercent(z);
zoom_lbl.Caption := Format('zoom pct = %2.2f%%',[z]);
Chart1.Zoomed := zoom_spinner.Value <> 0;
end;
However, regardless of what the value of Z is set to in ZoomPercent, it always seems to SHRINK the display -- except when it's 150, and then it does something REALLY strange. (The description for ZoomPercent says simply that this factor is a percentage. No examples are provided that I could find.)
The values of Z are in the range [0.10, 0.20, ... 0.90, 1, 50, 100, 150, ... 500].
Also, we're only interested in Zooming along the X-axis, not the Y-axis. No matter what I set, this function always re-adjusts the Y-axis for any zoom setting other than the default. The data I'm working with has a very narrow range betwen 0 and 5, so setting the Y-axis to -100 ... +100 (which is what it does for unknown reasons) makes the "zoom in" useless because the dots make up a horizontal line! How the heck can I zoom the X-axis without having the Y-axis changed AT ALL?