Hello, I have searched around and read the tutorials, but I can't seem to find the answer I am looking for. I have two tcharts in one form. They both get updated at the same time with the same X-axis value.
If I scroll around in one graph, is it possible to transfer this scroll to the other graph? (same idea for zoom: if I zoom into one graph I would like to apply the same zoom level to a second graph).
Thanks!!
-Kevin
Zoom / Scroll on multiple graphs
Re: Zoom / Scroll on multiple graphs
Hello Kevin,
I have made a simple project that I think you could use in your application for achieve as you want:
Could you please, check if previous code works as you expected?
I hope will helps,
Thanks,
I have made a simple project that I think you could use in your application for achieve as you want:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.Points point;
Steema.TeeChart.Styles.Line line1,line2;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart2.Aspect.View3D = false;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line2 = new Steema.TeeChart.Styles.Line(tChart2.Chart);
line1.FillSampleValues();
line2.DataSource = line1;
tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
tChart1.Scroll += new EventHandler(tChart1_Scroll);
tChart1.UndoneZoom += new EventHandler(tChart1_UndoneZoom);
}
void tChart1_UndoneZoom(object sender, EventArgs e)
{
UpdateAxes();
}
void tChart1_Scroll(object sender, EventArgs e)
{
UpdateAxes();
}
void tChart1_Zoomed(object sender, EventArgs e)
{
UpdateAxes();
}
private void UpdateAxes()
{
tChart1.Refresh();
tChart2.Axes.Bottom.SetMinMax(tChart1.Axes.Bottom.Minimum, tChart1.Axes.Bottom.Maximum);
}
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 |