},
}
chartdata.forEach(function(section, section_idx) {
- var h1 = document.createElement('h1');
- h1.appendChild(document.createTextNode(section.label));
- document.body.appendChild(h1);
+ var chartDiv = document.getElementById("chart");
section.charts.forEach(function(chart, chart_idx) {
// Skip chart if every series has zero data points
if (0 == chart.data.reduce(function(len, series) {
var div = document.createElement('div');
div.setAttribute('id', id);
div.setAttribute('style', 'width: 100%; height: 150px');
- document.body.appendChild(div);
+ chartDiv.appendChild(div);
chart.options.valueFormatter = function(y) {
}
chart.options.axes = {
valueFormatter: fmt.iso,
},
}
+ var div2 = document.createElement('div');
+ div2.setAttribute('style', 'width: 150px; height: 150px');
+ chart.options.labelsDiv = div2;
+ chart.options.labelsSeparateLines = true;
+
+ var div3 = document.createElement('div');
+ div3.setAttribute('style', 'display: flex; padding-bottom: 16px');
+ div3.appendChild(div);
+ div3.appendChild(div2);
+ chartDiv.appendChild(div3);
+
charts[id] = new Dygraph(div, chart.data, chart.options);
});
});