JSFiddle - React, Tailwind, and code Playground

by Nick Momrik

HTML

<script src="https://www.gstatic.com/charts/loader.js"></script>
<body>
<div id="chart_div"></div>

</body>

JavaScript

// Load the Visualization API and the corechart package.
    google.charts.load('current', {'packages':['corechart']});

    // Set a callback to run when the Google Visualization API is loaded.
    google.charts.setOnLoadCallback(drawChart);

    // Used MetroTimer on iOS to send perfect RPMs to the Airdyne
    function drawChart() {
        var data = google.visualization.arrayToDataTable([
['Steady RPMs','Calories/second'],
[30,0.0606060606060606],
[40,0.121212121212121],
[45,0.151515151515152],
[50,0.196969696969697],
[55,0.242424242424242],
[60,0.287878787878788],
[65,0.348484848484849],
[70,0.393939393939394],
[75,0.46969696969697],
[80,0.545454545454545],
[85,0.606060606060606],
[90,0.696969696969697],
[95,0.787878787878788],
[100,0.878787878787879],
[105,0.984848484848485],
[110,1.06060606060606],
[115,1.15151515151515],
[120,1.25757575757576],
[125,1.37878787878788],
[130,1.5],
[135,1.66666666666667],
[140,1.77272727272727],
[145,1.90909090909091],
[150,2.04545454545455],
[42,0.111111111111111],
[58,0.277777777777778],
[62,0.305555555555556],
[67,0.361111111111111],
[72,0.416666666666667],
[77,0.5],
[88,0.666666666666667],
[102,0.888888888888889],
[113,1.11111111111111],
[155,2.22222222222222],
[175,2.77777777777778],
[190,3.19444444444444],
				]);

        var options = {
            title: 'Calories by RPMs',
            hAxis: {title: 'Steady RPMs', minValue: 20, maxValue: 160},
            vAxis: {title: 'Calories/second', minValue: -0.5, maxValue: 2.5},
            trendlines: {
                0: {
                    type: 'polynomial',
                    degree: 2,
                    showR2: true,
                    visibleInLegend: true
                }
            }
        };

        var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));
        chart.draw(data, options);
    }