Show only 0-3 Data Point Labels in a Horizontal Bar Graph

TeeChart for ActiveX, COM and ASP
Post Reply
jalen
Newbie
Newbie
Posts: 7
Joined: Thu Jan 05, 2006 12:00 am
Location: Guelph, ON Canada
Contact:

Show only 0-3 Data Point Labels in a Horizontal Bar Graph

Post by jalen » Fri Jan 06, 2006 11:22 pm

I'm using v7.0.0.6, and I would like to have custom labels to appear to right of _some_ bars in a Horizontal Bar chart. My initial attempts have been with the Marks collection, but it seems that I can't change the text values at run-timef, and I can't seem to have only a couple Mark text values appear.

Any thoughts?

- john.

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

Post by Narcís » Mon Jan 09, 2006 10:35 am

Hi john,

You have several options to achieve that:

1) Use custom labels when populating series:

Code: Select all

    TChart1.Series(0).Add 100, "My Custom Text", clTeeColor
    TChart1.Series(0).Add 200, "My Custom Text", clTeeColor
    TChart1.Series(0).Marks.Style = smsLabel
2) Using OnGetSeriesMark event and its MarkText parameter.
3) Using Annotation tools. You will find examples of how to use them at TeeChart features demo available at TeeChart's program group.
4) Custom draw on TeeChart's canvas which examples can also be found at TeeChart's features demo.
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

jalen
Newbie
Newbie
Posts: 7
Joined: Thu Jan 05, 2006 12:00 am
Location: Guelph, ON Canada
Contact:

Show only 0-3 Data Point Labels

Post by jalen » Mon Jan 09, 2006 4:17 pm

Thanks for your feedback. Over the weekend I've discovered some of the options you've mentioned. The OnGetSeriesMark/MarkText option was the most useful, however I had to my design structure to use this approach.

The Marks. MarkText feature is the best option because the positioning and other attributes are already taken care of. However, I return to a request/suggestion I have made, and that is to have a Custom Marks Style. In this case the Marks Text would have to be set programmatically or manually.

The OnGetSeriesMark event does allow me to create this sort of functionality, however it would be more elegant, direct, and allow me to maintain the integrity of my design pattern to be able to simply use syntax such as tChart.Series(0).Marks.Item(x).Text = "My Custom Value"

Let me know where I can email you a sample plot, and I'll show you an example of what I'm working with.

Thanks again.

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

Post by Narcís » Mon Jan 09, 2006 4:29 pm

Hi jalen,

I'll be glad to have a look at your example. You can post it at our public newsgroups at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
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