Hi
I have multiple Y-Axis on a single chart. Very much like Examples\All Features\Axes\Scrolling multiple axes
I would like to have a solid horizontal line across the chart between each Y-Axis. The user can then use mouse to grab and re-position this line, allowing them to re-size the visible charts. I vaguely remember doing this with the ActiveX control so I'm sure this a built in way?
Thanks for your help
Ross
Multiple Custom Axes user-resize
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Multiple Custom Axes user-resize
Hi Ross,
Ok, you can use ColorLine tool and use its DragLine event, for example:
Ok, you can use ColorLine tool and use its DragLine event, for example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
tChart1.Panel.MarginLeft = 12;
for (int i = 0; i < 3; i++)
{
tChart1.Axes.Custom.Add(new Steema.TeeChart.Axis());
tChart1.Series.Add(new Steema.TeeChart.Styles.FastLine());
tChart1[i].FillSampleValues();
tChart1[i].CustomVertAxis = tChart1.Axes.Custom[i];
tChart1[i].GetVertAxis.StartPosition = 33 * i;
tChart1[i].GetVertAxis.EndPosition = 33 * (i + 1);
Steema.TeeChart.Tools.ColorLine colorLine = new Steema.TeeChart.Tools.ColorLine(tChart1.Chart);
colorLine.Axis = tChart1[i].GetVertAxis;
colorLine.Value = tChart1[i].MinYValue();
colorLine.NoLimitDrag = true;
colorLine.DragLine += new EventHandler(colorLine_DragLine);
}
}
void colorLine_DragLine(object sender, EventArgs e)
{
Steema.TeeChart.Tools.ColorLine colorLine = ((Steema.TeeChart.Tools.ColorLine)sender);
int linePos = colorLine.Axis.CalcPosValue(colorLine.Value);
Rectangle chartRect = tChart1.Chart.ChartRect;
double pos = ((double)(linePos - chartRect.Top) / chartRect.Height) * 100;
colorLine.Axis.EndPosition = pos;
}
Best Regards,
Narcís Calvet / 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 |
Re: Multiple Custom Axes user-resize
You don't perhaps have that sample in VB.NET?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Multiple Custom Axes user-resize
Hi Ross,
I'm afraid not. You can use automatic C# to VB.NET conversors I mentioned here. If this doesn't help don't hesitate to let us know.
I'm afraid not. You can use automatic C# to VB.NET conversors I mentioned here. If this doesn't help don't hesitate to let us know.
Best Regards,
Narcís Calvet / 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 |
Re: Multiple Custom Axes user-resize
No problem. Honestly I was just being a little lazy since it should be easy enough to convert what you posted. Thanks. As ever, you guys are incredibly helpful!