Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts tooltip date format when using pointFormat

hi i am working on highcharts with net transactions on y-axis and type datetime on x-axis. i have shown month and date on x-axis point label as (jan 2016) and want to show the same date format on tooltip. but its showing full date with day as well like "Monday, jan 1, 2016.

here is my js code.

tooltip: {
        headerFormat: '<span style="font-size:10px">{point.x:%Y-%m}</span><table>',
        pointFormat: '<tr><td style="color:{series.color};padding:0;font-size:11px;">{series.name}: </td>' +
        '<td style="padding:0"><b>{point.y:,.0f}</b></td></tr>',
        footerFormat: '</table>',
        shared: true,
        useHTML: true
    },

Thanks for any help

like image 619
Dev001 Avatar asked Apr 27 '26 18:04

Dev001


2 Answers

Just change your point.X: format string from {point.x:%Y-%m} to {point.x:%b-%Y} as shown bellow

tooltip: {
        headerFormat: '<span style="font-size:10px">{point.x:%b-%Y}</span><table>',
        pointFormat: '<tr><td style="color:{series.color};padding:0;font-size:11px;">{series.name}: </td>' +
        '<td style="padding:0"><b>{point.y:,.0f}</b></td></tr>',
        footerFormat: '</table>',
        shared: true,
        useHTML: true
    },
like image 197
andrepaulo Avatar answered Apr 29 '26 20:04

andrepaulo


use html in tooltip and format using dateFormat

Highcharts.dateFormat(%Y-%m,this.x)
like image 28
Nishith Kant Chaturvedi Avatar answered Apr 29 '26 21:04

Nishith Kant Chaturvedi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!