0

我坚持使用下面的谷歌折线图是解释我需要改变哪种颜色的图像在此处输入图像描述

我正在使用以下代码。

<script type="text/javascript">
   google.setOnLoadCallback(drawDiscreteChart);




   function drawDiscreteChart() {
                        // Create and populate the data table.
                        var data = new google.visualization.DataTable();
                        data.addColumn('string', 'Date');
                        data.addColumn('number', 'R$');
                        data.addRows([
                           ['Apr/13', 13000000],
                           ['May/13', 12934520.8],
                           ['Jun/13', 12869121.47],
                           ['Jul/13', 12803801.59]
                         ]);

                        var options = {
                          title: '',
                          legend: {position: 'none'},
                          backgroundColor: '#1C1C1C',
                          vAxis: {title: '', minValue: 0, maxValue: 25, gridlines: {color: '212121'},textStyle:{color: 'fff',fontSize:10}},
                          hAxis:{textStyle:{color: 'fff',fontSize:10},slantedTextAngle:90},
                          bubble: {textStyle: {fontSize: 13}},
                          series: {0:{color:'ffffff',lineWidth:1}},
                          sizeAxis: {minValue: 11, maxSize: 11, maxValue: 11, minSize: 11},
                        };

                        // Create and draw the visualization.
                        var chart = new google.visualization.AreaChart(document.getElementById('discrete_chart'));
                        chart.draw(data, options);
                      }

                          </script>

任何人都可以帮我解决这个问题..

4

1 回答 1

0

经过 2 天的研发后,得到了解决方案

<script type="text/javascript">
                  google.setOnLoadCallback(drawDiscreteChart);

                  function drawDiscreteChart() {
                    // Create and populate the data table.
                    var data = new google.visualization.DataTable();
                    data.addColumn('string', 'Date');
                    data.addColumn('number', 'R$');
                    data.addRows([
                       ['Apr/13', 13000000],
                       ['May/13', 12934520.8],
                       ['Jun/13', 12869121.47],
                       ['Jul/13', 12803801.59]
                     ]);

                    var options = {
                      title: '',
                      legend: {position: 'none'},
                      backgroundColor: '#1C1C1C',
                      vAxis: {title: '', minValue: 0, maxValue: 25, gridlines: {color: '212121'},textStyle:{color: 'fff',fontSize:10}},
                      hAxis:{textStyle:{color: 'fff',fontSize:10},slantedTextAngle:90},
                      bubble: {textStyle: {fontSize: 13}},
                      series: {0:{color:'green',lineWidth:1}},
                      sizeAxis: {minValue: 11, maxSize: 11, maxValue: 11, minSize: 11},
                    };

                    // Create and draw the visualization.
                    var chart = new google.visualization.AreaChart(document.getElementById('discrete_chart'));
                    chart.draw(data, options);
                  }

                      </script>

在代码系列:{0:{color:'green',lineWidth:1}} 中,您需要指定颜色...

于 2013-06-01T10:16:48.187 回答