Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用GoogleCharts API在面积图中改变线条的颜色_Javascript_Html_Charts - Fatal编程技术网

Javascript 使用GoogleCharts API在面积图中改变线条的颜色

Javascript 使用GoogleCharts API在面积图中改变线条的颜色,javascript,html,charts,Javascript,Html,Charts,我有一个在谷歌图表API创建的折线图,现在我想改变不同的线颜色和身体颜色,但当我创建了一个图表,我可以看到线和身体颜色相同,请任何人让我知道如何改变颜色使用谷歌API <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript">

我有一个在谷歌图表API创建的折线图,现在我想改变不同的线颜色和身体颜色,但当我创建了一个图表,我可以看到线和身体颜色相同,请任何人让我知道如何改变颜色使用谷歌API

<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 data = google.visualization.arrayToDataTable([
          ['',''],
          ['',27],
          ['',25],
          ['',60],
          ['',31],
          ['',25],        
          ['',39],        
          ['',25],
          ['',31],
          ['',26],
          ['',28],        
          ['',80],          
          ['',28],
          ['',27],
          ['',31],
          ['',27],        
          ['',29],        
          ['',26],
          ['',35],
          ['',70],
          ['',25]             
        ]);
        var options = {   
                backgroundColor: {
                    stroke: '#4322c0',
                    strokeWidth: 3},
                'is3D':true,
                series: {0:{color:'#DF013A',lineWidth:2}},
                colors:['#D8D8D8'],
                backgroundColor: "transparent",
                legend: {position: 'none'}
        };
        var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="chart_div" style="width: 300px; height: 300px;"></div>
  </body>
</html>
  <body>
    <div id="chart_div"></div>
  </body>
</html>

load(“可视化”、“1”、{packages:[“corechart”]});
setOnLoadCallback(drawChart);
函数绘图图(){
var data=google.visualization.arrayToDataTable([
['',''],
['',27],
['',25],
['',60],
['',31],
['',25],        
['',39],        
['',25],
['',31],
['',26],
['',28],        
['',80],          
['',28],
['',27],
['',31],
['',27],        
['',29],        
['',26],
['',35],
['',70],
['',25]             
]);
变量选项={
背景颜色:{
笔划:“#4322c0”,
冲程宽度:3},
“is3D”:正确,
系列:{0:{颜色:'#DF013A',线宽:2}},
颜色:['#D8D8D8'],
背景色:“透明”,
图例:{位置:'none'}
};
var chart=new google.visualization.AreaChart(document.getElementById('chart_div'));
图表绘制(数据、选项);
}

请参阅以下开发人员文档以更改线条系列颜色和背景颜色: