|
@@ -49,12 +49,6 @@ var HEATMAP_COLORS_YELLOW = ['#ebedf0', '#fdf436', '#ffc700', '#ff9100', '#06001 |
|
|
|
|
|
|
|
|
// Universal constants |
|
|
// Universal constants |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Returns the value of a number upto 2 decimal places. |
|
|
|
|
|
* @param {Number} d Any number |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Returns whether or not two given arrays are equal. |
|
|
* Returns whether or not two given arrays are equal. |
|
|
* @param {Array} arr1 First array |
|
|
* @param {Array} arr1 First array |
|
@@ -123,6 +117,7 @@ var MONTH_NAMES_SHORT = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// https://stackoverflow.com/a/11252167/6495043 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function clone(date) { |
|
|
function clone(date) { |
|
@@ -163,8 +158,6 @@ function addDays(date, numberOfDays) { |
|
|
date.setDate(date.getDate() + numberOfDays); |
|
|
date.setDate(date.getDate() + numberOfDays); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Composite Chart |
|
|
|
|
|
// ================================================================================ |
|
|
|
|
|
var reportCountList = [152, 222, 199, 287, 534, 709, 1179, 1256, 1632, 1856, 1850]; |
|
|
var reportCountList = [152, 222, 199, 287, 534, 709, 1179, 1256, 1632, 1856, 1850]; |
|
|
|
|
|
|
|
|
var lineCompositeData = { |
|
|
var lineCompositeData = { |
|
@@ -345,12 +338,13 @@ lineCompositeChart.parent.addEventListener('data-select', function (e) { |
|
|
|
|
|
|
|
|
// ================================================================================ |
|
|
// ================================================================================ |
|
|
|
|
|
|
|
|
var args = { |
|
|
|
|
|
|
|
|
var customColors = ['purple', 'magenta', 'light-blue']; |
|
|
|
|
|
var typeChartArgs = { |
|
|
title: "My Awesome Chart", |
|
|
title: "My Awesome Chart", |
|
|
data: typeData, |
|
|
data: typeData, |
|
|
type: 'axis-mixed', |
|
|
type: 'axis-mixed', |
|
|
height: 250, |
|
|
height: 250, |
|
|
colors: ['purple', 'magenta', 'light-blue'], |
|
|
|
|
|
|
|
|
colors: customColors, |
|
|
|
|
|
|
|
|
maxLegendPoints: 6, |
|
|
maxLegendPoints: 6, |
|
|
maxSlices: 10, |
|
|
maxSlices: 10, |
|
@@ -365,15 +359,20 @@ var args = { |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
var aggrChart = new Chart("#chart-aggr", args); |
|
|
|
|
|
|
|
|
var aggrChart = new Chart("#chart-aggr", typeChartArgs); |
|
|
|
|
|
|
|
|
Array.prototype.slice.call(document.querySelectorAll('.aggr-type-buttons button')).map(function (el) { |
|
|
Array.prototype.slice.call(document.querySelectorAll('.aggr-type-buttons button')).map(function (el) { |
|
|
el.addEventListener('click', function (e) { |
|
|
el.addEventListener('click', function (e) { |
|
|
var btn = e.target; |
|
|
var btn = e.target; |
|
|
var type = btn.getAttribute('data-type'); |
|
|
var type = btn.getAttribute('data-type'); |
|
|
args.type = type; |
|
|
|
|
|
|
|
|
typeChartArgs.type = type; |
|
|
|
|
|
if (type !== 'axis-mixed') { |
|
|
|
|
|
typeChartArgs.colors = undefined; |
|
|
|
|
|
} else { |
|
|
|
|
|
typeChartArgs.colors = customColors; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var newChart = aggrChart.getDifferentChart(type); |
|
|
|
|
|
|
|
|
var newChart = new Chart("#chart-aggr", typeChartArgs); |
|
|
if (newChart) { |
|
|
if (newChart) { |
|
|
aggrChart = newChart; |
|
|
aggrChart = newChart; |
|
|
} |
|
|
} |
|
|