Put highchart on the very start of the graphic

筅森魡賤 提交于 2019-12-25 01:45:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!