Convert Seconds to Formatted Time in Bar/Column/Line charts



  • Avatar
    wynne christen

    Works beautifully. Thank you.

  • Avatar
    Ilan Shichor

    For Pivot Tables and Indicators, please see this link:

  • Avatar
    Brian Bontrager (Edited )

    This is great!


    You can also apply this to the tooltip (for when you hover over the bar). Define convertRawTime() outside widget.on(...), and add another event handler to reformat the tooltip value.






  • Avatar
    Vishali Manivannan

    Could the script be modified to have the time format displayed in the Y2-axis instead of the Y-axis? The Y axis displays # of calls and the X axis displays the dates. 

    The widget displays a column chart with one of the values displayed as a line (series type) and the Y2 axis should display the time format. The values should be displayed in time format when you hover over the line.


  • Avatar
    shani adani

    Hi Vishali, 

    If you want to apply the formatting on the second Y-axis, you can change the second Y-axis formatter by switching lines 27-29 with:

    if (args.options.yAxis.length > 1) {
       args.options.yAxis[1].labels.formatter = function(){
            return convertRawTime(this.value);

Please sign in to leave a comment.