plotly test

by FirstBug

HTML

<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<button id="changes">Change Symbol</button>
<div id="myDiv" style="width: 480px; height: 400px;">
  <!-- Plotly chart will be drawn inside this DIV -->
</div>

JavaScript

var trace1 = {
   x: [1, 2, 3, 4],
   y: [10, 11, 12, 13],
   mode: 'markers',
   marker: {
     size: [40, 60, 80, 100]
   }
 };

 var data = [trace1];

 var layout = {
   title: 'Marker Size',
   showlegend: false,
   height: 400,
   width: 480
 };

 Plotly.newPlot('myDiv', data, layout);
 $('#changes').click(function() {

   var data_update = {
     'marker': {
       symbol: 'square'
     }
   };
   Plotly.restyle('myDiv', data_update, [0]);
 });