如何在绘图区域图中用我们选择的颜色填充区域

How to fill area with our choice colour in plotly area grap

我想 change/fill 用我们选择的颜色而不是蓝色绘制区域图的区域。但我无法改变它。我提到了 This Code.

图表是这样的:

只需将 fillcolor 添加到您的数据中。

var trace1 = {
  x: ['Nov 2013', 'Dec 2013', 'Jan 2014', 'Feb 2014'],
  y: [2, 1, 3, 5],
  fill: 'tozeroy',
  type: 'scatter',
  fillcolor: 'red'
};

var data = [trace1];

Plotly.newPlot('myDiv', data);
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<div id='myDiv'></div>