I have multiple pens on the same custom horizontal axis. when I zoom via mouse or via buttons I have created (Zoom In 110%, Zoom Out 90%, Zoom Home) I notice that the left axis updates but the custom horizontal axis doesn't update.
Could you provide an example of how to update my custom horizontal axis when I zoom in via mouse and via the buttons above? I am able to find an example of how to do this with the mouse but not when you do zooming via code on button click events.
Custom Horizontal Axis zooming
Re: Custom Horizontal Axis zooming
Hello,
Custom Axes could be zoomed/unzoomed by code in the following way:
Marc Meumann
Custom Axes could be zoomed/unzoomed by code in the following way:
regards,private void btnZoomIn_Click(object sender, EventArgs e)
{
double percentZoom = 110;
Steema.TeeChart.Axis axis = tChart1.Axes.Custom[0];
double AMin = axis.CalcPosPoint(axis.IStartPos);
double AMax = axis.CalcPosPoint(axis.IEndPos);
double tmpDelta = (AMax - AMin) * ((percentZoom - 100.0) * 0.01);
axis.SetMinMax(AMin + tmpDelta,AMax - tmpDelta);
tChart1.Zoom.ZoomPercent(percentZoom);
}
private void btnZoomOut_Click(object sender, EventArgs e)
{
double percentZoom = 98;
Steema.TeeChart.Axis axis = tChart1.Axes.Custom[0];
double AMin = axis.CalcPosPoint(axis.IStartPos);
double AMax = axis.CalcPosPoint(axis.IEndPos);
double tmpDelta = (AMax - AMin) * ((percentZoom - 100.0) * 0.01);
axis.SetMinMax(AMin + tmpDelta, AMax - tmpDelta);
tChart1.Zoom.ZoomPercent(percentZoom);
}
//initialise these values at chart load if not automatic
double lMin, lMax, bMin, bMax;
private void btnZoomHome_Click(object sender, EventArgs e)
{
//lMin, lMax, bMin, bMax only needed if Axes not automatic by default
//if automatic reset Axis to automatic true
tChart1.Axes.Left.SetMinMax(lMin, lMax);
tChart1.Axes.Custom[0].SetMinMax(bMin, bMax);
}
Marc Meumann
Steema Support