This is a migrated thread and some comments may be shown as answers.

How to place text on the chart area

3 Answers 174 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Raed
Top achievements
Rank 1
Raed asked on 21 Sep 2010, 06:27 AM
Hi,

I have a situation which my legend text are long. I want to identify the series by placing a text label on the chart area to act as legend. Is there anyway to do that?

Thanks

3 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 22 Sep 2010, 04:31 PM
Hi Raed,

You can put a TextBlock on top of RadChart with transparent background and add text with specific color (same as the color of the series) so that it acts as legend.
Anyway what I offer are two other approaches:
1.  Why don't you change the position of the ChartLegend like this for example:
this.radChart1.DefaultView.ChartLegendPosition = Dock.Bottom;
2. Set custom item labels for chart items where each label is used as if it were a legend item just without the MarkerShape. For example put Item Label on every first item of each Series. Other items in the Series won't have labels.
You can set custom label on first dataPoint of your DataSeries like this:

radChart1.DefaultView.ChartArea.DataSeries[0][0].Label = "Some Text";

Hope this helps.

Greetings,
Evgenia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Raed
Top achievements
Rank 1
answered on 23 Sep 2010, 07:07 PM
Thanks for quick response.

I like the second suggestion  better. Is there way to make that particular label always visible and have the rest be based on hover over functionality?

Regards,
Raed
0
Evgenia
Telerik team
answered on 27 Sep 2010, 03:06 PM
Hello Raed,

I'm afraid you can't show DataPoint Label when mouse cursor hovers over the respective series items. What I suggest is to show ItemTooltips instead with the same text as first Item label of the Series. ItemTooltips allow custom information to be showed when mouse hovers DataPoint in your chart. Tooltips are described in this help topic - http://www.telerik.com/help/wpf/radchart-features-tooltips.html.

Actually I forgot to tell in my previous post that you can explicitly create legend items and keep the Legend visible instead of doing some of the workarounds I mentioned. Here is how you can customize your Legend information - http://www.telerik.com/help/wpf/radchart-features-chart-legend.html (Manual Legend Items Generation header).

Hope these help articles guided you properly. 

Regards,
Evgenia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Raed
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Raed
Top achievements
Rank 1
Share this question
or