dataGrouping with xAxis datetime

2019-09-16 02:28发布

问题:

I wonder if it's possible with xAxis type datetime set this

pointStart: Date.UTC(2010, 0, 1),
pointInterval: 24 * 3600 * 1000, // one day

But if I want a dataGrouping option by week dynamically I can't see here: http://jsfiddle.net/L7d5d8fj/

回答1:

dataGrouping will work on Highstock chart only: http://www.highcharts.com/docs/advanced-chart-features/data-grouping

As an answer to your problem with showing lines and columns in your chart (discussion in comments) You can set your approximation manually, so you will be sure that both of your series types have the same approximation:

  dataGrouping: {
    approximation: "average",
    enabled: true,
    forced: true,
    units: [
      ['week', [1]]
    ]
  }

Here you can see an example how it can work: https://jsfiddle.net/ezhp5a4j/4/