Hello,
I have a problem with the TeeChart CursorTool. I use the lastest version.
private void fastLine1_AfterDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
// Call cursorTool1.XValue -> does not work
cursorTool1.XValue = 100;
// Call cursorTool1.XValue again -> it works....
// Comment this line and try again...
cursorTool1.XValue = 100;
}
Thank you for your help.
Best regards
Andreas Lindenthal
TeeChart 3 CursorTool
Hi Andreas,
I seems that the X and Y values for the CursorTool aren't stored correctly if you don't repaint or update chart's the internal values before. You can force it but take care because then OnAfterDraw event will be called. So, don't call those methods inside OnAfterDraw event.
For example:
In this example, if you don't use , the first time the Chart title won't be updated.
Finally, note that I've added to the wish-list this issue to be studied if this "repaint" should be done internally or not (TF02012775).
I seems that the X and Y values for the CursorTool aren't stored correctly if you don't repaint or update chart's the internal values before. You can force it but take care because then OnAfterDraw event will be called. So, don't call those methods inside OnAfterDraw event.
For example:
Code: Select all
public partial class Form1 : Form
{
Steema.TeeChart.Tools.CursorTool cursor1;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Points point1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
point1.FillSampleValues(25);
cursor1 = new Steema.TeeChart.Tools.CursorTool(tChart1.Chart);
Bitmap bmp = tChart1.Bitmap;
cursor1.XValue = 10;
}
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
tChart1.Header.Text = Convert.ToString(cursor1.XValue);
}
}
Code: Select all
Bitmap bmp = tChart1.Bitmap;
Finally, note that I've added to the wish-list this issue to be studied if this "repaint" should be done internally or not (TF02012775).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Andreas,
Yes, you need to use this method to force TeeChart being internally repainted and therefore such properties having valid values.
Yes, you need to use this method to force TeeChart being internally repainted and therefore such properties having valid values.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Andreas,
We think it's a feature request for BeforeDrawAxis and AfterDrawAxis events. The cursor tool needs the axis calculations to work. These are only available after the axis is drawn and the axis is drawn after the series. However, there is no event between the axis being drawn and the tools being drawn, that's why the chart has to be painted twice. Anyway, you could use tChart1.Draw() instead of creating a temporary bitmap.
We think it's a feature request for BeforeDrawAxis and AfterDrawAxis events. The cursor tool needs the axis calculations to work. These are only available after the axis is drawn and the axis is drawn after the series. However, there is no event between the axis being drawn and the tools being drawn, that's why the chart has to be painted twice. Anyway, you could use tChart1.Draw() instead of creating a temporary bitmap.
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 |