This is a migrated thread and some comments may be shown as answers.

Custom tooltip

1 Answer 155 Views
Chart - Xamarin.Android
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Herve asked on 28 May 2015, 03:20 PM



 (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 !

1 Answer, 1 is accepted

Sort by
Pavel R. Pavlov
Telerik team
answered on 02 Jun 2015, 11:35 AM
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
Chart - Xamarin.Android
Asked by
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question