JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://dygraphs.com/dygraph-dev.js"></script>
<p>Graph 1.</p>
<div id="graph1"></div>
<p>Graph 2.</p>
<div id="graph2"></div>
CSS
/*
Relevant CSS classes include:
Labels on the X & Y axes:
.dygraph-axis-label
.dygraph-axis-label-x
.dygraph-axis-label-y
.dygraph-axis-label-y2
Chart labels, see http://dygraphs.com/tests/styled-chart-labels.html
.dygraph-title
.dygraph-xlabel
.dygraph-ylabel
.dygraph-y2label
The legend, see http://dygraphs.com/tests/series-highlight.html
.dygraph-legend
*/
.dygraph-title {
color: gray;
}
JavaScript
g1 = new Dygraph(document.getElementById("graph1"),
// For possible data formats, see http://dygraphs.com/data.html
// The x-values could also be dates, e.g. "2012/03/15"
"X,Y\n" +
"1,4\n" +
"2,2\n" +
"3,4\n" +
"4,6\n" +
"5,8\n" +
"6,3\n" +
"7,12\n" +
"8,14\n",
{
showRangeSelector: true
});
g2 = new Dygraph(document.getElementById("graph2"),
// For possible data formats, see http://dygraphs.com/data.html
// The x-values could also be dates, e.g. "2012/03/15"
"X,Y\n" +
"1,4356\n" +
"2,4789\n" +
"3,4812\n" +
"4,5012\n" +
"5,4675\n" +
"6,4357\n" +
"7,4467\n" +
"8,5134\n",
{
// options
});