We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Annotations without text

Thread ID:

Created:

Updated:

Platform:

Replies:

88637 Aug 5,2009 12:08 AM UTC Jun 13,2011 02:25 PM UTC WPF 5
loading
Tags: Chart
Mike Berriman
Asked On August 5, 2009 12:08 AM UTC

I'm trying to display a series as a line chart with a marker at each data point. I'm having trouble, in that when I turn on annotations, I not only get the symbol, but the text value as well, which I'm hoping to remove.

I can, of course, do this by using two series on the same data, one line one scatter, but that means I get two series in the legend, which looks kinda silly.

Is there ant way to do this that anyone knows?

Thanks,
Mike.

Saradha [Syncfusion]
Replied On August 5, 2009 04:59 AM UTC

Hi Mike,

Thanks for your interest in syncfusion products.

To remove the text value from annotation, you could simply set the series annotation description as null.

serAnnot.Description = "";

Since you say that you use a Symbol I suppose its AdornmentInfo used rather than the Annotation.
To remove text from AdornmentInfo you could use a LabeTemplate with no value for the TextBlock as shown below.
---------------------------------



---------------------------------

---------------------------------

Please refer to the below given link for both the samples.
http://files.syncfusion.com/support/Chart.WPF/7.3.0.20/F88637/main.htm

Please let us know if you have further queries.

Regards,
K. Saradha Devi

Mike Berriman
Replied On August 5, 2009 07:27 AM UTC

My apologies - I've only been working with Syncfusion a few days. I did of course mean Adornments, not annotations.

This would appear to do exactly what I want - I just wonder if there is a way to do this in C#, rather than XAML? I'm sure there is - but I'm still working my way around the conversion if you have the code handy.

Thanks,
Mike.

Saradha [Syncfusion]
Replied On August 5, 2009 09:58 AM UTC

Hi Mike,

You could do the same in code behind as shown below

FrameworkElementFactory element = new FrameworkElementFactory(typeof(TextBlock));
DataTemplate dataTemplate = new DataTemplate();
dataTemplate.VisualTree = element;
adorn.LabelTemplate = dataTemplate;

Please refer to the modified sample from the below given link
http://files.syncfusion.com/support/Chart.WPF/7.3.0.20/F88637/Adornment_Modified.zip

Please let us know if you have any queries.

Regards,
K. Saradha Devi

Mike Berriman
Replied On August 6, 2009 02:45 AM UTC

Perfect - many thanks.

John Fairbanks
Replied On June 13, 2011 02:25 PM UTC

Is this still the simplest way to get a line series to have markers? Adding markers to your line series is simply a matter of flipping a switch on every other chart toolkit I've used... I'm hoping this has gotten better in the current version?


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;