1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 window.onload = function() {
7 sections.forEach(function(section, section_idx) {
8 var h1 = document.createElement('h1');
9 h1.appendChild(document.createTextNode(section.label));
10 document.body.appendChild(h1);
11 section.charts.forEach(function(data, chart_idx) {
12 // Skip chart if every series has zero data points
13 if (0 == data.data.reduce(function(len, series) {
14 return len + series.dataPoints.length;
18 var id = 'chart-'+section_idx+'-'+chart_idx;
19 var div = document.createElement('div');
20 div.setAttribute('id', id);
21 div.setAttribute('style', 'width: 100%; height: 150px');
22 document.body.appendChild(div);
23 charts[id] = new CanvasJS.Chart(id, data);
28 if (typeof window.debug === 'undefined')
30 window.debug.charts = charts;