Is it possible to display a series of icon (or small bitmaps) on a chart? The icons would be placed either at the data point pointer or at the series mark locations.
If a line series shows 10 data points, each point would show as an icon representing that y value (in my case).
If this can be done, where can I find a sample or example or some tips?
Thanks.
Is this possible - display an icon on chart?
Hello,
You can use the TeeChart Draw method to render an image at any location.
eg.
<br>
The above code renders an image at a fixed location, but the TeeChart Axes and Series CalcXPos and CalcYPos methods return point and value locations on the Chart according to the data. Stepping through Series values in OnAfterDraw and replacing the render location co-ordinates will enable you to place images at data points, etc. See the TeeChart 'Custom Drawing' Tutorial for more detail about using CalXPos/CalcYPos.
Best regards,
Marc Meumann
Steema Support
You can use the TeeChart Draw method to render an image at any location.
eg.
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
tChart1.Graphics3D.Draw(new Rectangle(20,20,80,80),imageList1.Images[1]);
}
The above code renders an image at a fixed location, but the TeeChart Axes and Series CalcXPos and CalcYPos methods return point and value locations on the Chart according to the data. Stepping through Series values in OnAfterDraw and replacing the render location co-ordinates will enable you to place images at data points, etc. See the TeeChart 'Custom Drawing' Tutorial for more detail about using CalXPos/CalcYPos.
Best regards,
Marc Meumann
Steema Support
This works very nicely! I have 3 more quick questions:
1. When is the appropriate time to call Refresh() on the chart after drawing images in the AfterDraw() method?
2. I assume AfterDraw() is called only once for a chart, not once for each series in the chart, correct?
3. Is there a property similar to the series.Marks.Clip = true property? I'm finding that images are drawn outside the chart region when I have multiple pages (or axis data that extends beyond the maximum value I set).
Thanks!
1. When is the appropriate time to call Refresh() on the chart after drawing images in the AfterDraw() method?
2. I assume AfterDraw() is called only once for a chart, not once for each series in the chart, correct?
3. Is there a property similar to the series.Marks.Clip = true property? I'm finding that images are drawn outside the chart region when I have multiple pages (or axis data that extends beyond the maximum value I set).
Thanks!
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Could I ask you why you would want to call refresh after the AfterDraw() event has fired but before the chart is painted?1. When is the appropriate time to call Refresh() on the chart after drawing images in the AfterDraw() method?
Correct.2. I assume AfterDraw() is called only once for a chart, not once for each series in the chart, correct?
Have a look at the:3. Is there a property similar to the series.Marks.Clip = true property? I'm finding that images are drawn outside the chart region when I have multiple pages (or axis data that extends beyond the maximum value I set).
Steema.TeeChart.Drawing.Graphics3D.ClipRectangle Method
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/