I have a problem in using the ZoomRect function.
For reproduction just place a chart on a form, add one FastLine Series and this code in FormLoad:
Code: Select all
((FastLine)this.tChart1[0]).DrawAllPoints = true;
((FastLine)this.tChart1[0]).FillSampleValues(10000);
Code: Select all
var strgPressed = ModifierKeys == Keys.Control;
var addon = -5;
if (strgPressed)
{
addon = 5;
}
var r = new Rectangle(
this.tChart1.DisplayRectangle.Left + addon,
this.tChart1.DisplayRectangle.Top + addon,
this.tChart1.DisplayRectangle.Right - addon,
this.tChart1.DisplayRectangle.Bottom - addon);
this.tChart1.Zoom.ZoomRect(r);
If you click the button (without pressing STRG) you will zoom out. First question ... Why is the left space bigger then the right one (marked with red). Why is it not the same on both sides. Mayby DisplayRectangle is the wrong rectangle I should use for calculation?
Now hold the STRG key and press the button again. Now it should be zoom in (to the previous position). But now it Zooms out again.
Actually I have no idea what happend here
Dominik