0
votes

I've got a chart that uses time data for both the X and Y axis. I'm able to get both axes to convert my millisecond data into HH:MM:SS. How do I get Y axis tooltip to display HH:MM:SS too? API suggests it's possible, however I'm unable to replicate.

tooltipValueFormat: String

Parallel coordinates only. Format that will be used for point.y and available in tooltip.pointFormat as point.formattedValue If not set, point.formattedValue will use other options, in this order:

  1. yAxis.labels.format will be used if set
  2. if yAxis is a category, then category name will be displayed
  3. if yAxis is a datetime, then value will use the same format as yAxis labels

https://api.highcharts.com/highstock/yAxis.tooltipValueFormat

See my fiddle for example https://jsfiddle.net/gramlich/jpnsujo8/1/

Not to further complicate things- I am doing this in a Django View, and passing the chart options via JSON to minimize my need for JS. If possible, I'd like to use a solution using only objects found in the Highcharts API; rather than resorting to writing my own Formatter function in JS.

Thank you for your help!

1
Hi, did my answer below helped you?João Menighin

1 Answers

0
votes

You can use pointFormat passing the formatting string like:

tooltip: {
    pointFormat: '{point.y:%M:%S}'
}

Here's a working fiddle: https://jsfiddle.net/w4f9suzb/