Highcharts - How can I remove starting and ending

2019-06-20 18:40发布

问题:

Fiddle - http://jsfiddle.net/vKLPP/

I want to remove the white space on both sides (see the red lines).

I tried various options like minpadding, margin etc but none of them seem to work.

startOnTick: true,
minpadding:0

回答1:

for this no need to go with categories or the datetime type of x-axis just change the data

in this format

data: [,[x1,y1],[x2,y2],[x3,y3],[x4,y4],[x5,y5]]

ex:

 data: [[1750,106], [1800,107], [1850,111], [1900,133], [1950,221], [1999,767], [2050,1766]]

updated your js fiddle please check http://jsfiddle.net/vKLPP/1/

hope this will be useful



回答2:

According to documentation, minPadding/maxPadding doesn't work with categories. So You should use i.e datetime xAxis and define correct tickInterval / pointInterval.