Spline Addvalues

2 posts, 1 answers
  1. Kevin Hendriks
    Kevin Hendriks avatar
    56 posts
    Member since:
    Feb 2009

    Posted 02 Mar 2011 Link to this post

    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.
  2. Answer
    Yavor avatar
    401 posts

    Posted 04 Mar 2011 Link to this post

    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!

    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!
Back to Top