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

[Solved] Tooltip for complex model

1 Answer 39 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
danny
Top achievements
Rank 1
danny asked on 18 May 2012, 06:43 PM
Hi -

I'm tryint to display a tooltip on an MVC chart to display additional data about a series.  Basically, I have a model that contains some stats about transactions in our system.  The model has the following properties: "Total", "Max", "Min", "Count".  I want to user the "Total" property as the series value, but want to also display the "Min, Max and Count" in the tooltip.  How can I access the model my chart is bound to from the tooltip.  Is this possible or Am I looking at this the wrong way?

I've attached an image (picture) of what I'm trying to achieve as well as a zip with the model and the view. 

Thanks,

Danny

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 22 May 2012, 03:45 PM
Hello Danny,

In order to achieve the described functionality for the Chart widget you need to use AJAX binding. Then you could customize the text in the tooltip via dataItem variable in the template. For example: 

tooltip.Template("This is a test and the value is <#= dataItem.Min #> <br/> <#= dataItem.Max #> <br/> <#= dataItem.Count #>")

I hope this helps.


Kind regards,
Iliana Nikolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Chart
Asked by
danny
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or