Home > Back-end >  Show TIME instead of DATE in Timeline Highcharts
Show TIME instead of DATE in Timeline Highcharts

Time:11-23

Currently my timeline highcharts look like this.enter image description here

I hope to change the date there to current time. Is it possible to make it?

Here my code.

CodePudding user response:

You can adjust the date format in dataLabels setting to show the time instead of date like this

   dataLabels: {
     allowOverlap: false,
     format:
       '<span style="color:{point.color}">● </span><span style="font- 
       weight: bold;" > '  
       "{point.x:%H:%M:%S}</span><br/>{point.label}"
   }

DateFormat reference: https://api.highcharts.com/class-reference/Highcharts.Time#dateFormat

  • Related