This is a migrated thread and some comments may be shown as answers.
Tooltip value
6 Answers 103 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Martinez
Top achievements
Rank 1
Martinez asked on 12 Oct 2011, 02:59 PM
Hello,
Could you tell me if there's a way to concatenate the name of the serie to tooltip value?

<%= Html.Telerik().Chart(Model) 
    .Name("chart") 
    .Series(series => { 
            series.Bar(s => s.RepSales).Name("Representative Sales"); 
    }) 
    .CategoryAxis(axis => axis 
        .Categories(s => s.DateString) 
    
%>

I wait for your comments, thanks.

6 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 13 Oct 2011, 12:59 PM
Hi Martinez,

Thank you for contacing us.

Could you please try this:

<%= Html.Telerik().Chart(Model)
    .Name("chart")
    .Series(series => {
            series.Bar(s => s.RepSales).Name("Representative Sales");
    })
    .CategoryAxis(axis => axis
        .Categories(s => s.DateString)
    )
    .Tooltip(tooltip => tooltip.Template("series name: <#= series.name #> value: <#= value #>").Visible(true))
%>

Best wishes,
Hristo Germanov
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
0
Felipe Saldana
Top achievements
Rank 1
answered on 11 Nov 2011, 06:55 PM
Is it possible to add the X axis value to the tool tip

In your example I want to add the s.DateString value to the tool tip.


Also, what other fields are available for use besides "series.name" and "value"?
0
Hristo Germanov
Telerik team
answered on 14 Nov 2011, 04:50 PM
Hello Felipe Saldana,

The available temlate variables are:

value - the point value
category - the category name
series - the data series configuration object
dataItem - the original data item (client-side binding only)
You can try to set category in your template.

Regards,
Hristo Germanov
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
0
Hristo Germanov
Telerik team
answered on 14 Nov 2011, 04:50 PM
Hello Felipe Saldana,

The available temlate variables are:

value - the point value
category - the category name
series - the data series configuration object
dataItem - the original data item (client-side binding only)
You can try to set category in your template.Regards,
Hristo Germanov
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
0
Felipe Saldana
Top achievements
Rank 1
answered on 14 Nov 2011, 05:18 PM
This worked great!

Thanks.
0
Ki Won
Top achievements
Rank 1
answered on 01 Dec 2011, 02:31 AM
Thanks for your reply.
but I can't display 'series' and 'dataItem' template variables.
that result are [object Object]
then 'value' and 'category' template variables are work well.
under non-Ajax Binding.

my version is Version Q3 2011, released 11/15/2011 Open source linecse.
Tags
Chart
Asked by
Martinez
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Felipe Saldana
Top achievements
Rank 1
Ki Won
Top achievements
Rank 1
Share this question
or