How could I drag&drop a serie from a custom axis to another?
Regards,
Juan Luis
Drag series between axis
Re: Drag series between axis
Hi Jaun Luis,
Here is an example we made for another customer some time ago. Note that this is an example for TeeCahrt for NET but I think it should work also for the ActiveX version.
If you find any problem translating it, please don't hesitate to let us know.
Here is an example we made for another customer some time ago. Note that this is an example for TeeCahrt for NET but I think it should work also for the ActiveX version.
If you find any problem translating it, please don't hesitate to let us know.
Code: Select all
private void InitializeChart()
{
chartController1.Chart = tChart1;
tChart1.Aspect.View3D = false;
tChart1.Panel.MarginLeft = 15;
tChart1.Zoom.Allow = false;
Steema.TeeChart.Axis axis1 = new Steema.TeeChart.Axis();
Steema.TeeChart.Axis axis2 = new Steema.TeeChart.Axis();
tChart1.Axes.Custom.Add(axis1);
tChart1.Axes.Custom.Add(axis2);
axis1.StartPosition = 0;
axis1.EndPosition = 49;
axis2.StartPosition = 50;
axis2.EndPosition = 100;
for (int i = 0; i < 3; i++)
{
tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
tChart1[i].FillSampleValues();
tChart1[i].CustomVertAxis = (i > 0) ? axis1 : axis2;
}
tChart1.MouseDown += new MouseEventHandler(tChart1_MouseDown);
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
tChart1.MouseUp += new MouseEventHandler(tChart1_MouseUp);
}
private int seriesIndex = -1;
void tChart1_MouseUp(object sender, MouseEventArgs e)
{
seriesIndex = -1;
}
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
if (seriesIndex != -1)
{
for (int i = 0; i < tChart1.Axes.Custom.Count; i++)
{
if ((tChart1.Axes.Custom[i].IStartPos <= e.Y) && (tChart1.Axes.Custom[i].IEndPos >= e.Y))
{
tChart1[seriesIndex].CustomVertAxis = tChart1.Axes.Custom[i];
break;
}
}
}
}
void tChart1_MouseDown(object sender, MouseEventArgs e)
{
for (int i = 0; i < tChart1.Series.Count; i++)
{
if (tChart1[i].Clicked(e.X, e.Y) != -1)
{
seriesIndex = i;
break;
}
}
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |