Hi ,
We would like to format the category/date in the shared tooltip.
Just for convenience we have attached one screen shot to highlight the particular element.
In our case the category is date ( we want to format in "MMM dd" style in the shared tooltip) .
Thanks
We would like to format the category/date in the shared tooltip.
Just for convenience we have attached one screen shot to highlight the particular element.
In our case the category is date ( we want to format in "MMM dd" style in the shared tooltip) .
Thanks
4 Answers, 1 is accepted
0
Hi Vimal,
Iliana Nikolova
Telerik
By design you should be able to achieve this using a sharedTemplate for the tooltip, however there is a bug in the current version of Kendo UI and using such a template it is not possible to reach the points. We are currently working on this problem and will do our best to provide a solution as soon as possible. Please excuse us for the inconvenience caused.
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ehtesham
Top achievements
Rank 1
answered on 30 Oct 2015, 02:14 PM
Hello,
I facing a similar situation and would like to find out how to achieve this in MVC. Is the bug still an issue in latest build?
Thanks,
Ehtesham
0
Ehtesham
Top achievements
Rank 1
answered on 30 Oct 2015, 02:58 PM
Also, is it possible to access any other data item in SharedTemplate? Let's say I want to display the category ID along the category name. Is this achievable?
Thanks!
0
Hello Ehtesham,
This is a pretty old thread and the discussed issue has been already addressed. Up to your other questions:
- ...and would like to find out how to achieve this in MVC...
You could use SharedTemplate in Kendo UI Chart for ASP.NET MVC too. Below is the syntax:
- ...Let's say I want to display the category ID...
In the sharedTemplate you could reach the category name, you could easily get its index using additional JavaScript. As an example:
Regards,
Iliana Nikolova
Telerik
This is a pretty old thread and the discussed issue has been already addressed. Up to your other questions:
- ...and would like to find out how to achieve this in MVC...
You could use SharedTemplate in Kendo UI Chart for ASP.NET MVC too. Below is the syntax:
@(Html.Kendo().Chart<Kendo.Mvc.Examples.Models.ElectricityProduction>()
.Name(
"chart"
)
//....
.Tooltip(tooltip => tooltip
.Visible(
true
)
.Shared(
true
)
.SharedTemplate(
"#= sharedTooltiptemplate(points, category) #"
)
)
)
<script>
function sharedTooltiptemplate(points, category) {
//....
}
</script>
- ...Let's say I want to display the category ID...
In the sharedTemplate you could reach the category name, you could easily get its index using additional JavaScript. As an example:
@(Html.Kendo().Chart<Kendo.Mvc.Examples.Models.ElectricityProduction>()
.Name(
"chart"
)
//....
.Tooltip(tooltip => tooltip
.Visible(
true
)
.Shared(
true
)
.SharedTemplate(
"#= sharedTooltiptemplate(points, category) #"
)
)
)
<script>
function sharedTooltiptemplate(points, category) {
var currentCategory = category,
chart = $(
"#chart"
).data(
"kendoChart"
),
allCategories = chart.options.categoryAxis.categories;
console.log($.inArray(currentCategory, allCategories));
}
</script>
Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!