Get XValue in Categorial Chart

11 posts, 1 answers
  1. Ramya
    Ramya avatar
    27 posts
    Member since:
    Jan 2011

    Posted 09 Nov 2011 Link to this post

    Hi,
    I am using markedZone to show annotations. I have to add an image as annotation so i have used ImageBrush to fill the marked Zone. It works fine when my chart has both XValues and YValues. My problem is that when i have a categorial chart I am not able to mark the zone. I am using  ((Telerik.Windows.Controls.ChartingChartArea)(sender)).AxisX.ConvertPhysicalUnitsToData(e.MouseData.GetPosition(this).X) to get the datapoints. But this is not always giving me the points with correct precision.
    How can i get the correct point.
  2. Ramya
    Ramya avatar
    27 posts
    Member since:
    Jan 2011

    Posted 11 Nov 2011 Link to this post

    Is there any workaround???
  3. Answer
    Sia
    Admin
    Sia avatar
    756 posts

    Posted 14 Nov 2011 Link to this post

    Hello Ramya,

    The categories are indexed, which means that you can use 0,1,2, etc. for XValue to position your marked zones.

    Greetings,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  4. Ramya
    Ramya avatar
    27 posts
    Member since:
    Jan 2011

    Posted 14 Nov 2011 Link to this post

    Hello Sia,
    Thanks a lot for the reply. Can you please let me know how to add marked zones using indexes?

    Regards,
    Ramya
  5. Ramya
    Ramya avatar
    27 posts
    Member since:
    Jan 2011

    Posted 14 Nov 2011 Link to this post

    Hello Sia,
    Thanks a lot for the reply. Can you please let me know how to add marked zones using indexes?

    Regards,
    Ramya
  6. Ramya
    Ramya avatar
    27 posts
    Member since:
    Jan 2011

    Posted 15 Nov 2011 Link to this post

    Hello Sia,
    Sorry that was a stupid question...:)
    I wanted to ask you one more question.
    Currently I am using this to add the markedZone. However I am not able to see a marked zone in Pie Chart. Is there a way to add a marked zone in Pie?
    MarkedZone tempZone = new MarkedZone();
                   tempZone.StartY = e.DataPoint.YValue;
                   tempZone.EndY = e.DataPoint.YValue+((Axis)(((((ChartArea)(sender)))).AxisY)).ActualStep;
                   tempZone.StartX =  e.DataPoint.XValue;
                   tempZone.EndX = e.DataPoint.XValue++((Axis)(((((ChartArea)(sender)))).AxisY)).ActualStep;
  7. Sia
    Admin
    Sia avatar
    756 posts

    Posted 15 Nov 2011 Link to this post

    Hi Ramya,

    I am happy to hear that you managed to find a solution by yourself.

    Unfortunately the marked zones are available only when having axes. In the pie chart they are missing so the marked zones cannot be drawn there.

    If you have more questions, do not hesitate to contact us again.

    Kind regards,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Ramya
    Ramya avatar
    27 posts
    Member since:
    Jan 2011

    Posted 17 Nov 2011 Link to this post

    ohh...Thats a bad news.. :( Will there be any workaorund to add an annotation in pie and doughnut charts?
  9. Sia
    Admin
    Sia avatar
    756 posts

    Posted 17 Nov 2011 Link to this post

    Hello Ramya,

    Can you please send us a design of what you need? What do you need to show/measure with such marked zone when having a pie?

    Best wishes,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  10. Ramya
    Ramya avatar
    27 posts
    Member since:
    Jan 2011

    Posted 18 Nov 2011 Link to this post

    Hi Sia,
    I calculated the position using the sweep angle and start angle and added the image at that position. :) I wanted something like the attached file.
    Thanks for your time and attention.

    Regards,
    Ramya
  11. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 22 Nov 2011 Link to this post

    Hi Ramya,

    Your question was answered in this thread started by you. I suggest that you choose one of the threads and keep our further communication on this there. This will help us avoid duplicate topics and will make it easier for both sides to follow it.

    Greetings,
    Evgenia
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top