Calculate the actual coordinates for a series

4 posts, 0 answers
  1. Claudio
    Claudio avatar
    2 posts
    Member since:
    Jan 2012

    Posted 10 Jul 2013 Link to this post

    Hello,

    I'm creating a custom ScatterLineSeries to simulate annotations in his own series. For this, I am register the load event of the series and look for the first canvas (serie.FindChildByType<Canvas>()) to add elements.
    How do I calculate the coordinates corresponding to a DataPoint on canvas?

    Thanks
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 11 Jul 2013 Link to this post

    Hello Claudio,

    I am unsure why you need to use a series to mimic annotations. Is it possible that you use the annotations that the chart ships with? We have grid line annotations, custom annotations, plot band annotations, marked zone annotations and custom line annotations (examples here and here, help topic here).

    You can use the conversion api of the chart to determine the position of a tuple of values. Check the ConvertDataToPoint method of the chart. However, note that the Loaded event might be to early for the chart because at that time it might not yet know its final size. I guess you can use the SizeChanged event instead. Let us know how it goes.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Claudio
    Claudio avatar
    2 posts
    Member since:
    Jan 2012

    Posted 17 Jul 2013 Link to this post

    I have the version 2012.3.1404.40 that does not have the marked zone annotations and conversion API has no method ConvertDataToPoint. Only have the method ConvertPointToData.
    How do I create the behavior of the method ConvertDataToPoint?

    Thanks
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 22 Jul 2013 Link to this post

    Hi Claudio,

    We strongly suggest that you update to the latest version of our controls as we have introduced the features that you now need and have improved the behavior of our controls by removing numerous bug fixes.

    I have attached a simple project to demonstrate how you can use the ActualRange property of the LinearAxis to find the relative position of given data. Later you can use the PlotAreaClip property of the chart to find the absolute position of the data in mind.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top