Hi,
I want to draw some vertical ines with a text-label. I've tried to use the anotation, but this won't move during zooming/scrolling.
Can someone help?
Textlabel at colorline
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Arnold,
Yes, I'd suggest you to use ColorLine tool and custom draw the text line on TChart's canvas doing something like:
Yes, I'd suggest you to use ColorLine tool and custom draw the text line on TChart's canvas doing something like:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
points1.FillSampleValues();
colorLine1.Axis=tChart1.Axes.Bottom;
colorLine1.Value=points1.XValues[5];
}
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
tChart1.Graphics3D.RotateLabel(points1.CalcXPosValue(colorLine1.Value),tChart1.Height/2,"ColorLine 1",90);
}
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 |
-
- Newbie
- Posts: 2
- Joined: Tue Sep 13, 2005 4:00 am
Thanks!
Now i have the following problem
after the next code:
Line := TColorLineTool.Create(self);
Line.ParentChart := TraceChart;
Line.Axis := TraceChart.BottomAxis;
Line.Value := 3.6;
The line is displayed nicely on 3.6. But moving around appears to move the line too. It looks like when moving the line 'out the window' it sticks to the border of the chart.
Is this a bug?
Now i have the following problem
after the next code:
Line := TColorLineTool.Create(self);
Line.ParentChart := TraceChart;
Line.Axis := TraceChart.BottomAxis;
Line.Value := 3.6;
The line is displayed nicely on 3.6. But moving around appears to move the line too. It looks like when moving the line 'out the window' it sticks to the border of the chart.
Is this a bug?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Arnold,
No, this is not a bug, this is as designed. However, to achieve the behaviour you request you can improve the code before by doing something like:
No, this is not a bug, this is as designed. However, to achieve the behaviour you request you can improve the code before by doing something like:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
points1.FillSampleValues();
colorLine1.Axis=tChart1.Axes.Bottom;
colorLine1.Value=points1.XValues[5];
}
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
if ((tChart1.Axes.Bottom.Minimum<colorLine1.Value) && (tChart1.Axes.Bottom.Maximum>colorLine1.Value))
tChart1.Graphics3D.RotateLabel(points1.CalcXPosValue(colorLine1.Value),tChart1.Height/2,"ColorLine 1",90);
}
private void tChart1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if ((tChart1.Axes.Bottom.Minimum>colorLine1.Value) || (tChart1.Axes.Bottom.Maximum<colorLine1.Value))
colorLine1.Active=false;
else colorLine1.Active=true;
}
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 |