In a chart, I can zoom clicking and draging right the left button, and unzoom clicking and draggin left the left button.
But if I zoom, and then I save the chart with "Export.Template.Save", and open it again but I cannot do unzoom, of the zoom done before save.
Is there any way to unzoom it? Or is it possible to unzoom programatically when opening (or before saving) the chart?
Thanks
Unzoom after save and open the chart
Re: Unzoom after save and open the chart
Hello wakeup,
I recommend you save Bottom and Left Min/Max values, before you do zoom and you export chart as template. After, you can use values in UndoneZoom() Event to do Unzoom() in the Chart you have loaded. You can do something as next:
Could you tell us if previous code works in your end?
I hope will helps.
Thanks,
I recommend you save Bottom and Left Min/Max values, before you do zoom and you export chart as template. After, you can use values in UndoneZoom() Event to do Unzoom() in the Chart you have loaded. You can do something as next:
Code: Select all
public Form1()
{
InitializeComponent();
}
double MinX, MaxX, MinY,MaxY, IncrementY;
private void Form1_Load(object sender, EventArgs e)
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
tChart1.Draw();
MinX = tChart1.Axes.Bottom.Minimum;
MaxX= tChart1.Axes.Bottom.Maximum;
MinY = tChart1.Axes.Left.Minimum;
MaxY = tChart1.Axes.Left.Maximum;
}
private void button1_Click(object sender, EventArgs e)
{
tChart2.Import.Template.Load(@"TestChart1.Ten");
tChart2.Zoom.History = true;
tChart2.UndoneZoom += tChart2_UndoneZoom;
}
void tChart2_UndoneZoom(object sender, EventArgs e)
{
if (tChart2.Zoom.HistorySteps != null)
{
tChart2.Axes.Bottom.SetMinMax(MinX, MaxX);
tChart2.Axes.Left.SetMinMax(MinY, MaxY);
}
else
{
tChart2.Zoom.Undo();
}
}
void button2_Click(object sender, EventArgs e)
{
tChart1.Export.Template.Save(@"TestChart1.ten");
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |