2014-03-03 71 views
0

对于我的项目,我做了一个Highchart图表。运作良好,但底部和顶部有很多空间。我已经通过将yAxis min设置为0来解决这个问题。但是xAxis上方仍然有一些空间。Hightchart x轴顶部

有人知道这个问题的解决方案吗?

屏幕: 2500应该是顶部.. enter image description here

代码:

$('#yeardiagram').highcharts({ 
    chart: { 
     events: { 
      redraw: function(event) { 
       getMonthProfit(); 
      } 
     }   
    }, 
    credits: { 
     enabled: false 
    },     
    title: {text: 'Kosten jaaroverzicht', x: -20 }, 
    subtitle: { text: 'Verdeeld naar budget',x: -20 
    }, 
    xAxis: { 
     categories: ['Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 
      'Juli', 'Augustus', 'September', 'October', 'November', 'December'] 
    }, 
    yAxis: { 
     title: { text: 'Kosten' }, 
     min:0, 
     plotLines: [{ 
      value: 0, 
      width: 1, 
      color: '#808080' 
     }] 
    }, 
    tooltip: { valuePrefix: '€' }, 
    legend: { 
     layout: 'vertical', 
     align: 'right', 
     verticalAlign: 'middle', 
     borderWidth: 0 
    }, 
    series: data     
}); 
+1

尝试设置最小/ maxPadding作为0在yAxis http://api.highcharts.com/highstock#yAxis.maxPadding –

+0

谢谢!这是解决方案。你可以把你的评论作为答案.. – JelleP

回答

相关问题