diff options
Diffstat (limited to 'assets/js/src/AvgTimeColumnChart.js')
-rw-r--r-- | assets/js/src/AvgTimeColumnChart.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/assets/js/src/AvgTimeColumnChart.js b/assets/js/src/AvgTimeColumnChart.js new file mode 100644 index 00000000..f8b7d2ee --- /dev/null +++ b/assets/js/src/AvgTimeColumnChart.js @@ -0,0 +1,39 @@ +function AvgTimeColumnChart() { +} + +AvgTimeColumnChart.prototype.execute = function(app) { + var metrics = $("#chart").data("metrics"); + var plots = [$("#chart").data("label")]; + var categories = []; + + for (var column_id in metrics) { + plots.push(metrics[column_id].average); + categories.push(metrics[column_id].title); + } + + c3.generate({ + data: { + columns: [plots], + type: 'bar' + }, + bar: { + width: { + ratio: 0.5 + } + }, + axis: { + x: { + type: 'category', + categories: categories + }, + y: { + tick: { + format: app.formatDuration + } + } + }, + legend: { + show: false + } + }); +}; |