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

Box Plot Chart tooltip show as currency

3 Answers 259 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 13 Sep 2018, 09:44 PM

For some reason the default tooltip for the box plot chart formats the lower, q1, mean, median, q3, and upper fields as currency. I am not dealing with currency, how can I change the format of the data in the tooltip.

To view what I am talking about go to the demo page of the Box Plot Chart here: https://demos.telerik.com/kendo-ui/box-plot-charts/index

Notice that the chart is showing statistical information about temperature, but if you mouse over a box the tooltip formats the details as currency.

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 17 Sep 2018, 12:25 PM
Hi Josh,

This is intended behavior in the BoxPlot Chart, its default tooltip formatting looks like this:
tooltip: {
    format: "<table>" +
                "<tr><th colspan='2'>{6:d}</th></tr>" +
                "<tr><td>Lower:</td><td>{0:C}</td></tr>" +
                "<tr><td>Q1:</td><td>{1:C}</td></tr>" +
                "<tr><td>Median:</td><td>{2:C}</td></tr>" +
                "<tr><td>Mean:</td><td>{5:C}</td></tr>" +
                "<tr><td>Q3:</td><td>{3:C}</td></tr>" +
                "<tr><td>Upper:</td><td>{4:C}</td></tr>" +
            "</table>"
}

If you want to display values with numeric (non-currency) formatting, you can copy the same format and only replace C with N:
format: "<table>" +
"<tr><th colspan='2'>{6:d}</th></tr>" +
"<tr><td>Lower:</td><td>{0:N}</td></tr>" +
"<tr><td>Q1:</td><td>{1:N}</td></tr>" +
"<tr><td>Median:</td><td>{2:N}</td></tr>" +
"<tr><td>Mean:</td><td>{5:N}</td></tr>" +
"<tr><td>Q3:</td><td>{3:N}</td></tr>" +
"<tr><td>Upper:</td><td>{4:N}</td></tr>" +
"</table>"

Here is a Dojo, where you can see the result:
http://dojo.telerik.com/@tsveti/aHABaYOS

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Josh
Top achievements
Rank 1
answered on 18 Sep 2018, 09:56 PM

 

Thank you for the reply.

My work around was to create a custom template for the tooltips on my chart.  

On your demo page, it shows that the monthly average temperature for January is 49 dollars. That is just plain wrong.

It might be helpful to put your solution on the demo page so that the example is valid, and so that users of Kendo UI will know how to change the format/template.

 

 

0
Tsvetina
Telerik team
answered on 20 Sep 2018, 12:54 PM
Hello Josh,

We have an item logged internally to fix the discrepancy in the demos but it has not been addressed as of the latest version. I did notify the development team about the issue being brought up again.

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Simon
Top achievements
Rank 1
commented on 26 May 2021, 03:34 PM

Two and a half years seems a rather long time for this issue to be outstanding.
Josh
Top achievements
Rank 1
commented on 26 May 2021, 04:39 PM

Agreed, seems like a trivial fix.
Georgi Denchev
Telerik team
commented on 28 May 2021, 10:55 AM

Hello,

Please accept my apologies for the incorrect information.

The demo will be modified to showcase the usage of the tooltip format with the next update.

Tags
Charts
Asked by
Josh
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Josh
Top achievements
Rank 1
Share this question
or