Chart newbie question - labels / tooltips

3 posts, 0 answers
  1. Pete
    Pete avatar
    27 posts
    Member since:
    Feb 2011

    Posted 20 Jul 2011 Link to this post

    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?


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

    Posted 25 Jul 2011 Link to this post

    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!

  3. Pete
    Pete avatar
    27 posts
    Member since:
    Feb 2011

    Posted 27 Jul 2011 Link to this post

    Thanks TA. 

    You suggestion worked for my needs.
Back to Top