Skip to content

Instantly share code, notes, and snippets.

@haehn
Created February 8, 2024 21:25
Show Gist options
  • Save haehn/fcd59798391dde093dd5daa15ed00273 to your computer and use it in GitHub Desktop.
Save haehn/fcd59798391dde093dd5daa15ed00273 to your computer and use it in GitHub Desktop.
CS617 Plotly.js 1
<html>
<head>
<script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
</head>
<body>
<div id='myDiv'></div>
<script>
var semesters = ['F16', 'Sp17', 'F17', 'Sp18', 'F18', 'Sp19', 'F19', 'Sp20', 'F20', 'Sp21', 'F21', 'Sp22', 'F22', 'Sp23', 'F23'];
var s_count = [1004.0, 953.0, 1085.0, 1005.0, 1145.0, 1042.0, 1171, 1089.0, 1192.0, 1114.0, 1237.0, 1194.0, 1490.0, 1359.0, 1686.0];
var f_count = [27, 25, 22, 23, 23, 23, 24, 24, 24, 26, 25, 24, 23, 24, 25];
var trace1 = {
x: semesters,
y: s_count,
type: 'scatter'
};
var trace2 = {
x: semesters,
y: f_count,
type: 'scatter'
};
var data = [trace1, trace2];
Plotly.newPlot('myDiv', data);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment