Remove padding or margins from Google Charts

前端 未结 6 1917
礼貌的吻别
礼貌的吻别 2020-12-12 13:45



        
6条回答
  •  独厮守ぢ
    2020-12-12 14:17

    By adding and tuning some configuration options listed in the API documentation, you can create a lot of different styles. For instance, here is a version that removes most of the extra blank space by setting the chartArea.width to 100% and chartArea.height to 80% and moving the legend.position to bottom:

    // Set chart options
    var options = {'title': 'How Much Pizza I Ate Last Night',
                   'width': 350,
                   'height': 400,
                   'chartArea': {'width': '100%', 'height': '80%'},
                   'legend': {'position': 'bottom'}
        };
    

    If you want to tune it more, try changing these values or using other properties from the link above.

提交回复
热议问题