2016-11-16 43 views

答えて

0

データに平均、最小、最大の3つの配列を追加する必要があります。最初に平均をプロットし、次にminとmaxをプロットします。シェーディングを取得するにはfill: 'tonexty'を使用してください。

var plotDiv = document.getElementById('plot'); 
 
var traces = [ 
 
    {name: 'avg', x: [1,2,3], y: [1,3,2], marker:{color: 'blue'}}, 
 
\t {name: 'min', x: [1,2,3], y: [0.5,2,1], marker:{color: 'lightblue'}}, 
 
\t {name: 'max', x: [1,2,3], y: [3,6,2.5], fill: 'tonexty', marker:{color: 'lightblue'}} 
 
]; 
 

 

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

 
</div>