set x Axis range in google chart

前端 未结 3 1972
栀梦
栀梦 2020-12-15 05:39

I try to create bar chart using google chart example

    var data = new google.visualization.DataTable();
    data.addColumn(\'string\', \'Topping\');

    d         


        
3条回答
  •  孤街浪徒
    2020-12-15 06:44

    You can force the x-axis of a BarChart to always show a certain range by setting the hAxis.viewWindow.min and hAxis.viewWindow.max options:

    hAxis: {
        viewWindow: {
            min: 0,
            max: 100
        },
        ticks: [0, 25, 50, 75, 100] // display labels every 25
    }
    

提交回复
热议问题