javascript - How to fill area with our choice colour in plotly area grap - Stack Overflow

I want to changefill area of plotly Area graph with our choice of colour instead of blue. But I'm

I want to change/fill area of plotly Area graph with our choice of colour instead of blue. But I'm unable to change it. I referred This Code.

Graph is ing like this:

I want to change/fill area of plotly Area graph with our choice of colour instead of blue. But I'm unable to change it. I referred This Code.

Graph is ing like this:

Share Improve this question edited Sep 30, 2016 at 16:21 Maximilian Peters 31.8k12 gold badges94 silver badges102 bronze badges asked Sep 30, 2016 at 15:46 Anil JagtapAnil Jagtap 1,8106 gold badges29 silver badges45 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 8

Just add fillcolor to your data.

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>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744806067a4594782.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信