HighCharts xAxis - tickInterval for month

前端 未结 5 970
被撕碎了的回忆
被撕碎了的回忆 2021-01-22 05:49

Am trying to plot spline graph for the no of passed/failed testcases and grouping them based on hour/date/month/year and I am getting this value as irr

相关标签:
5条回答
  • 2021-01-22 06:30

    I think the problem is in the data that you are passing in javascript.

    Before going further check this Preprocessing Data for highchart link and make sure you are doing it in right way

    0 讨论(0)
  • 2021-01-22 06:31

    You need to have sorted data via x ascending, as I see you have incorrect format of that. In case when you need to customise tooltip content or label on axis, you can use formatter.

    Tooltip formatter

    Label formatter

    Date format

    0 讨论(0)
  • 2021-01-22 06:37

    I simply used a minTickInterval of 28 days to account for short Feb months. The tickIntervals automatically adjust to 1 month.

    xAxis: {
      type: 'datetime',
      minTickInterval: 28*24*3600*1000
    }
    

    Works great for me.

    0 讨论(0)
  • 2021-01-22 06:44

    What I did was subtracting the date format for month which is m-1. If you have Y,m,d change to Y,m-1,d

    This is from php to js

    0 讨论(0)
  • 2021-01-22 06:46

    Try the following, setting ordinal false fixes the time intervals and not changed for best visualization.

    xAxis: {
        type: 'datetime',
        minTickInterval: 3600*24*30*1000,//time in milliseconds
        minRange: 3600*24*30*1000,
        ordinal: false //this sets the fixed time formats                        
    },
    
    0 讨论(0)
提交回复
热议问题