1
votes

I am struggling to format the tooltip on a highcharts histogram chart. For some reason, the bins are presented to the 10th decimal point, which is very unhelpful... Please see image below.

How do I amend the tooltip so that it is rounded to 2 decimal points? 

I tried messing with the 'point.key' configuration, but it only allows me to amend the first number, and not the second.

My issue with the highcharts histogram

1

1 Answers

3
votes

You can set the tooltip.pointFormat to display values with two decimal places.

The default format for a histogram is:

pointFormat: `
  <span style="font-size:10px">{point.x} - {point.x2}</span<br/>
  <span style="color:{point.color}">\u25CF</span>{series.name} <b>{point.y}</b><br/>`

To display values with two decimals points change {point.x} to {point.x:.2f}. See format strings section.

Live example: http://jsfiddle.net/r9zwwu3j/