Adding a custom vertical rule?

3 posts, 0 answers
  1. Alastair
    Alastair avatar
    2 posts
    Member since:
    Dec 2010

    Posted 06 Dec 2010 Link to this post

    Hi,

    We are looking to use the Silverlight RadChart in place of old ActiveX controls for display large line datasets (100,000+ points). Part of this upgrade is to replicate as much of the ActiveX controls as possible. So far, using the trials, we are very impressed with the default options and functionality of the RadCharts, but we have a major requirement to replicate that doesn't seem to be part of the default options/code.

    We require some kind of vertical rule. Being able to drag/add a vertical line that shows the y-values for each series at the particular x-value. I've investigated the documentation and it seems that the ChartExtensions might be something that  I could implement, but I was unable to work out how to add custom user controls over the top of the chart itself.

    This allows our customers to compare values of different series at a the same x value.

    Is there some code or a prebuilt way this can replicate this behaviour?

    Cheers,
    Alastair

  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 08 Dec 2010 Link to this post

    Hi Alastair,

    Here is a suggestion that should get you started with this task. You can wrap the chart within a Canvas and handle Canvas.MouseLeftButtonUp event. Its event args will provide the coordinates of the point clicked, so that you can draw a vertical line -- within the canvas, on top of the chart. In addition, you can subscribe to ChartArea.PlotAraeMouseLeftButtonUp event. Its event arguments (PlotAreaMouseEventArgs) will hold the XValue and YValue of the point clicked. Having the  XValue should allow you to look into the ChartSeries and find the corresponding YValues for each series.

    Best regards,
    Ves
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. Alastair
    Alastair avatar
    2 posts
    Member since:
    Dec 2010

    Posted 12 Dec 2010 Link to this post

    Thanks Ves,

    I shall have a go and see what I can work out.

    Cheers,
    Alastair
Back to Top