Changing the point shape for part of a series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Chris Thompson
Newbie
Newbie
Posts: 4
Joined: Mon May 24, 2004 4:00 am
Location: USA

Changing the point shape for part of a series

Post by Chris Thompson » Mon Jun 30, 2008 6:30 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 01, 2008 8:55 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chris Thompson
Newbie
Newbie
Posts: 4
Joined: Mon May 24, 2004 4:00 am
Location: USA

Post by Chris Thompson » Tue Jul 01, 2008 6:15 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jul 02, 2008 8:15 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chris Thompson
Newbie
Newbie
Posts: 4
Joined: Mon May 24, 2004 4:00 am
Location: USA

Post by Chris Thompson » Wed Jul 02, 2008 6:07 pm

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jul 03, 2008 7:28 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply