高图表宽度问题

时间:2013-06-04 06:13:40

标签: highcharts highstock

{
   colors: ['red','#009966'],
   chart: {
          height: 150,
          width: 350,
          type: 'bar',
          backgroundColor: '#efefef',
          marginLeft:150
         },
   title: {
          text: 'Workgroup Ticket in SLA',
          style: {
          color: 'black',
          fontWeight: 'bold',
          fontSize: '16px'
          }
    },
    xAxis: {
           x:-15,
           y:2,
           lineColor: '#82CAFF',
           lineWidth: 1,
           categories: ['AS Front End Eng.', 'AS FFE Support', 'AS UI Transaction','AS UI Merchandizing','AS UI Infrastructure','AS Website Festures'],
           labels: {
           style: {
                   color: 'black',
                   fontSize: '8px',
                   fontWeight: 'bold',
                   fontFamily: 'Verdana, sans-serif'
                  }
                }
            },
            yAxis: {
                lineColor: '#82CAFF',
                lineWidth: 1,
                gridLineDashStyle: 'dot',
                tickPositions: [0,20,40,60,80,100],
                width:160,
                title: {
                    text: ''
                },
                labels: {
                style: {
                    color: 'black',
                    fontSize: '9px',
                    fontWeight: 'bold',
                    fontFamily: 'Verdana, sans-serif'
                }
                }
            },
            legend: {
                enabled: false,
                backgroundColor: '',
                reversed: true
            },
            plotOptions: {

                series: {
                    stacking: 'normal',                      
                }
            },
                series: [ {
                name: '',
                data: [0, 5, 62, 50, 22,22]
            },
                         {
                name: '',
                data: [100,95,38,50,78,78]
           }
     ]
 }

这是jsfiddle链接http://jsfiddle.net/SMrKu/

我想删除在高图表的左右两侧创建的额外空格。

但是在减小宽度时,它会在高图中显示错误。

2 个答案:

答案 0 :(得分:1)

你可以设置spacingLeft和spacingRight属性。

chart: {
        type: 'bar',
        spacingLeft:0,
        spacingRight:0,
    },

您可以查看以下链接中的示例:

http://jsfiddle.net/vpL0j2av/1/

答案 1 :(得分:0)

而不是减小宽度,减少边距 - 左

http://api.highcharts.com/highcharts#chart

编辑:您可以减少spacingLeft和spacingRight http://api.highcharts.com/highcharts#chart.spacingLeft

相关问题