问题
I am using highcharts to make some graphics. There are 3 graphics inside the same highchart, but my problem is that the highchart start with some padding at the left, like this:

I want it to look like this: (Edited with photoshop)

Help please
回答1:
That question has been asked several times (I don't remember link), but in general don't use categorized xAxis, but use standard linear with specific label formatter, for example: http://jsfiddle.net/3bQne/266/
var categories = ['01/02/2012','01/03/2012','01/04/2012','01/05/2012','01/06/2012','01/07/2012'];
var chart2 = new Highcharts.Chart({
chart: {
renderTo: 'container2'
},
xAxis: {
labels: {
formatter: function() {
return categories[this.value];
}
}
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0]
}]
});
Now you can play around with startOnTick
and minPadding
. For categorized axis this is not possible to change space distribution - it's always evenly divided between all points.
来源:https://stackoverflow.com/questions/17281589/put-highchart-on-the-very-start-of-the-graphic