Adding Plotly to website - LabMazurokCom/Blockchain GitHub Wiki

Add this to page header:

<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>

Create

element with some id "some_id".

Add this code to <script> tag where data is obtained:

var trace = {
    x: response_json.amount_points,
    y: response_json.profit_points,
    mode: 'lines+markers'
};
var data = [trace];
//					var layout = {};
var layout = {
    title: 'Profit to Amount',
    autosize: false,
    width: 800,
    height: 500,
    xaxis: {
        title: 'Amount, USD'
    },
    yaxis: {
        title: 'Profit, USD'
    }
};
Plotly.newPlot('plot', data, layout);
⚠️ **GitHub.com Fallback** ⚠️