tristank
Posts: 4
Joined: Wed Dec 11, 2024 11:27 am

Tooltip doesn't format x axis values for scatter plot

I'm working on a project where we use Highcharts Dashboards with React js. We're using JSON connectors to get data for our scatter plot. The X axis has type 'datetime', the Y axis values. I've noticed that on tooltip for scatter plot the X axis values are not formatted compared to other charts: column chart, line chart, maybe other types of charts.

See url: https://jsfiddle.net/trip57/9xfv72jh
Steps to replicate:
  1. Verify that tooltip display properly. The date should be formated '%Y-%m-%d' eg. 2012-01-30.
  2. In the chart object, change type to "scatter".
  3. Verify tooltip again. It'll display X Axis values unformatted, in epoch time.
Thank you in advance for your time.
User avatar
dawid.d
Site Moderator
Posts: 1222
Joined: Thu Oct 06, 2022 11:31 am

Re: Tooltip doesn't format x axis values for scatter plot

Hello,

Thanks for the input!

At first glance, this does look like a potential bug, and I’d recommend reporting it on the official Highcharts GitHub repository: https://github.com/highcharts/highcharts/issues. That’s the best place to raise issues like this, as it allows the development team to investigate and determine whether it’s a bug or expected behavior directly.

That said, based on the API documentation, it’s worth noting that the xDateFormat option specifically mentions formatting the “date in the tooltip header” (see: https://api.highcharts.com/highcharts/t ... DateFormat) For scatter series, the x value isn’t included in the header by default - it’s part of the body of the tooltip. This might explain why xDateFormat doesn’t affect the x value in this case. Regardless, it’s still a valid point to raise, as the behavior could feel inconsistent compared to other chart types. Reporting it will let the development team decide if this should be addressed in a future update.

Let me know if you have more questions or need help customizing the tooltip formatting. Good luck with your project!

Best regards,
Dawid Draguła
Highcharts Developer

Return to “Highcharts Usage”