Custom tooltip

2 posts, 1 answers
  1. Herve
    Herve avatar
    1 posts
    Member since:
    May 2011

    Posted 28 May 2015 Link to this post


     (sorry for my poor english )

    I want to show information about the selected data inside the tooltip (ChartTooltipBehavior).

    My data can contain for exemple : date, value, specificInfo. The basic tooltip show the date and the value but i also want to show the third information.

    Can i show any view that i want ?


    This exemple from UI.Android seems not far but the compiler don't want to cast targets[0] to CategoricalDataPoint.. (is it even possible ?).
    Can you help me ?
    Can you bring me some exemple to retrieve the data and use it inside a custom view ?


    Thanks !

  2. Answer
    Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1165 posts

    Posted 02 Jun 2015 Link to this post

    Hello Herve,

    Customizing the default tooltip of the RadCartesianChart can be tricky but not impossible. You can try to create a custom chart renderer. This will allow you to access in Xamarin the native charting component. Once you have access to it you will be able to change its ContentAdapter. This adapter is responsible for drawing the content of the tooltip. To do this you will need to create custom ContentAdapter and use it instead of the default one.

    In short the steps that you need to do are as follows:
    1. Create custom renderer
    2. Access the ChartTooltipBehavior of the native charting component
    3. Create custom content adapter
    4. Use your adapter instead of the default one
    5. Create the View that you need to be displayed as tooptip and return it

    This approach except the last step is demonstrated in the attached project.

    Please take a look at it and let us know if you need any further assistance.

    Pavel R. Pavlov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top