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

Chart newbie question - labels / tooltips

2 Answers 45 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Pete
Top achievements
Rank 1
Pete asked on 20 Jul 2011, 03:35 PM
I have a requirement that when a data point falls outside the chartable area, because the datapoint is outside the series data used for plotting the chart lines, we show a label in the the top left area of the chart.

For example, the X axis begins at 25 but the datapoint X axis position is set for 8, thus falling outside the chartable area. In a case such as this I'd like to programatically afix an item label on the chart surface.

How can I accomplish this?

Thanks.

We create Item labels for display using the following syntax:
var dataPointLabel = Percentile: Less than #DATAITEM.Percentile\nFOO: #DATAITEM.FOO{#.##} kg\nAge: #DATAITEM.FOO_2 Months";

2 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 25 Jul 2011, 08:40 AM
Hi Peter,

Currently each item label is associated with a point mark and because points outside the plot area are not drawn unfortunately it is not possible to add labels for them.

You can achieve the same functionality by stacking the chart and a simple textblock with the desired text in a grid and set proper horizontal and vertical alignment for the textblock to appear in the upper left corner. You can get the current range of the X axis by using the ActualMaxValue and ActualMinValue properties. Once you have the visible range you can determine which of your objects falls outside the range and update the textblock.

Hope this helps!

Best wishes,
Yavor Ivanov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Pete
Top achievements
Rank 1
answered on 27 Jul 2011, 09:53 PM
Thanks TA. 

You suggestion worked for my needs.
Tags
Chart
Asked by
Pete
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Pete
Top achievements
Rank 1
Share this question
or