1

これは私のチャートの簡略版です:

<html>
  <head>
        <script type="text/javascript" src="https://www.google.com/jsapi"></script>
        <script type="text/javascript">
            google.load("visualization", "1", {packages:["corechart"]});
            google.setOnLoadCallback(drawChart);    
                function drawChart() {
                    var jsonData = '{"cols":[{"id":"","label":"date","type":"string"},{"id":"","label":"a","type":"number"},{"id":"","label":"b","type":"number"}],"rows":[{"c":[{"v":"2012-05-01"},{"v":"1"},{"v":"8"}]},{"c":[{"v":"2012-05-02"},{"v":"1"},{"v":"7"}]},{"c":[{"v":"2012-05-03"},{"v":"1"},{"v":"38"}]}]}';

                    var data = new google.visualization.DataTable(jsonData);    
                    var options = {
                        title       : 'Company Performance',
                        pointSize   : 5,
                        chartArea: {width: 800, height: 800},
                        width: 800+300, height: 800+600,
                        legend:{position: 'bottom',maxLines: 3},
                        vAxis:  {direction:-1, minValue: 1, viewWindowMode: 'explicit', viewWindow:{min:1}},
                        colors      : ['#0E9DFF','#9616F3']
                    };

                var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
                chart.draw(data, options);
              }
        </script>
  </head>
  <body>
    <div id="chart_div" style="width: 900px; height: 500px;"></div>
  </body>
</html>

私の目的はvAxisの最小値を0に設定
することです。それは機能しますが、どのように表示されるようにするのですか?
そして、水平軸を下に移動する方法は?

4

0 に答える 0