I'm developing a project that is expected to show this graph: http://jsfiddle.net/Kc23N/
When I click a point (tooltip) I want to show a date understandable, not the value in milliseconds.
I think needs to change this piece of code:
tooltip: { headerFormat: '<b>{series.name}</b><br>', pointFormat: '{point.x} date, {point.y} Kg', }
how do I do? any kind help is appreciated.
Thanks
You can use moment.js to get the values formatted, but Highcharts has it's own date formatting functionality which would be more idiomatic with Highcharts. It can be attached onto the tooltip option in the highcharts constructor like so:
tooltip: { formatter: function() { return '<b>' + this.series.name +'</b><br/>' + Highcharts.dateFormat('%e - %b - %Y', new Date(this.x)) + ' date, ' + this.y + ' Kg.'; } }
You may want to also add the dateTimeLabelFormats object with the options you need for your dates, under the xAxis.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With