Highcharts - Why is there extra spacing before the first column and after the last column?

前端 未结 2 649
情话喂你
情话喂你 2021-01-15 14:17

I have a Highcharts datetime column chart, with several series that which are added and updated dynamically. It appears that the library is producing the chart with a large

相关标签:
2条回答
  • 2021-01-15 15:00

    You can modify pointWidth and groupPadding/pointPadding parameter

    http://jsfiddle.net/PRKAJ/37/

    EDIT: You should define pointRange

    http://jsfiddle.net/PRKAJ/41/

    http://api.highcharts.com/highcharts#plotOptions.series.pointRange

    0 讨论(0)
  • 2021-01-15 15:12

    From what I'm seeing, example http://jsfiddle.net/ricksuggs/PRKAJ/36/ is showing to me without extra padding; unlike on the screenshot by @ricksuggs above, where there is extra padding.

    I believe the "problem" lies within multiple series with single data points vs. a single series with multiple data points.

    With multiple series (=sets) with single data point in each set, columns are grouped together, expecting another grouped data points from another set, thus creating the padding. However, with a single set containing multiple data points, those are distributed evenly creating no additional padding.

    To answer your question, I believe that's why there is extra spacing. However, I could not find a way how to get rid of it as grouping multiple series into single set with multiple data points has other limitations (hiding series in legend, coloring, ...).

    0 讨论(0)
提交回复
热议问题