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

Spline Addvalues

1 Answer 36 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kevin Hendriks
Top achievements
Rank 1
Kevin Hendriks asked on 02 Mar 2011, 04:51 PM
Hello I was wondering if there is funcionality in  the chart or if I have to it myself

My collection looks like this
Month |  Value
1        |    10
2         |    10
3         |    5
4         |   15

I want the chart to display the following
1         | 10
2         | 20
3          | 25
4          | 40


Now I can do these calculations somewhere in my code before binding. But then I would have to add properties. because the tooltips should show the collection values.

1 Answer, 1 is accepted

Sort by
0
Accepted
Yavor
Telerik team
answered on 04 Mar 2011, 10:17 AM
Hi Kevin Hendriks,

You can create a class that has 2 properties for X and Y and 1 property for the label. The position properties should describe the position at which you want your chart to be drawn and in the label property you can add the text that should be displayed.

Let me give an example using your data:
You can set the X, Y and Label properties to this values

X            Y Label

1         | 10 "1 | 10"

2         | 20 "2 | 10"

3          | 25 "3 | 5"

4          | 40 "4 | 15"

To display the proper text in the tooltip you can create a custom format for it and set it on your series definition like this:

<telerikCharting:LineSeriesDefinition ItemToolTipFormat="Now showing #DATAITEM.<<MyLabelProperty>>" />

You can find more information on format expressions in this topic in our help system.

Hope this helps!

Greetings,
Yavor Ivanov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Chart
Asked by
Kevin Hendriks
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or