HighCharts show datetime format on xAxis

后端 未结 4 679
误落风尘
误落风尘 2021-02-08 21:00

I am trying to display dateTime in day/weekly/month format on the x axis of high charts I have the data formatted as x utc date time format and y (magnitude). I was under the im

4条回答
  •  礼貌的吻别
    2021-02-08 21:36

    axis.dateTimeLabelFormats works a little bit different. In the first place, Highcharts tries to guess what is 'the best unit' of your data and, e.g. if it is a day, it will format it according to day property from dateTimeLabelFormats.

    If you want to just format axis labels, you can use axis.labels.format and specify a format like this:

    xAxis: {
      type: 'datetime',
      labels: {
        format: '{value:%Y-%b-%e}'
      },
    

    example: https://jsfiddle.net/dLfv2sbd/1/

提交回复
热议问题