Page 1 of 1
Changing the point shape for part of a series
Posted: Mon Jun 30, 2008 6:30 pm
by 8125578
Is it possible to change the point style (i.e., the shape) for part of a line series? For example, if I have a line series with square points, is it possible to use a triangle marker for some of the points in the series?
I'm using TeeChart .Net version 2.
Thanks!
Chris
Posted: Tue Jul 01, 2008 8:55 am
by narcis
Hi Chris,
Yes, you can use OnGetSeriesPointerStyle event for that. You'll find an example in Tutorial 6 - Working with Series. Tutorials can be found at TeeChart's program group.
Posted: Tue Jul 01, 2008 6:15 pm
by 8125578
Thank you for the reply. I found the example in the tutorial and successfully used the same logic in my code.
I have another question: is it possible to change the point color for part of a series? In my application, I would like to set the point color to transparent if the value meets certain conditions. The OnGetSeriesPointerStyle event allows me to control the pointer shape, but I haven't figured out how to change the point color.
Thanks again.
Chris
Posted: Wed Jul 02, 2008 8:15 am
by narcis
Hi Chris,
Yes, it can be done in the same way as Pointer.Sytle. You can use the e.Color event argument for that. If you don't want to display pointers you can also set them to Steema.TeeChart.Styles.PointerStyles.Nothing style.
Posted: Wed Jul 02, 2008 6:07 pm
by 8125578
Sorry, but I need more help.
e.Color is not accessible from the OnGetSeriesPointerStyle event.
I tried the following:
// function argument types omitted to save space
private void line1_GetPointerStyle(series, e)
{
if (e.ValueIndex == 0)
series.Pointer.Color = System.Drawing.Color.Transparent;
else
series.Pointer.Color = series.Color;
}
This changes the color of the second point, not the first. It seems that when the color is changed using this approach, the setting applies to the next point, not the current point. Moreover, if I specify the last valid data index (e.g., 3 for a series with 4 points), none of the points are initially affected, but if the graph is zoomed in and then out, the first point gets the new color!
What's the correct approach for setting the point color?
Posted: Thu Jul 03, 2008 7:28 am
by narcis
Hi Chris,
Sorry, I missed that you said you were using v2. Changing pointer color using OnGetPointerStyle event arguments is only supported in v3.
In v2 you'll have to do something as discussed on
this thread. Please notice that it's quite a long thread (has a few pages) and several solutions were discussed there.