2016-08-12 08:22:24 +00:00
|
|
|
|
2016-08-16 14:33:02 +00:00
|
|
|
function generate_offset_to_time(num){
|
|
|
|
var to_ret = {};
|
2016-08-23 05:19:51 +00:00
|
|
|
for(i=0; i<=num; i++) {
|
|
|
|
var t1 = new Date().getHours()-(23-i);
|
|
|
|
t1 = t1 < 0 ? 24+t1 : t1;
|
|
|
|
to_ret[i] = t1+'h';
|
|
|
|
}
|
2016-08-16 14:33:02 +00:00
|
|
|
return to_ret;
|
|
|
|
};
|
|
|
|
|
|
|
|
function generate_offset_to_date(day){
|
2016-08-17 07:46:25 +00:00
|
|
|
day = day-1;
|
2016-08-16 14:33:02 +00:00
|
|
|
var now = new Date();
|
|
|
|
var to_ret = {};
|
2016-08-17 07:46:25 +00:00
|
|
|
for(i=day; i>=0; i--){
|
2016-08-16 14:33:02 +00:00
|
|
|
for(j=0; j<24; j++){
|
|
|
|
var t1 =now.getDate()-i + ":";
|
2016-08-23 05:19:51 +00:00
|
|
|
var t2 =now.getHours()-(23-j);
|
|
|
|
t2 = t2 < 0 ? 24+t2 : t2;
|
|
|
|
t2 += "h";
|
2016-08-17 07:46:25 +00:00
|
|
|
to_ret[j+24*(day-i)] = t1+t2;
|
2016-08-16 14:33:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return to_ret;
|
|
|
|
};
|
|
|
|
|
|
|
|
var offset_to_time = generate_offset_to_time(23);
|
|
|
|
var offset_to_date = generate_offset_to_date(7);
|
2016-08-13 13:24:57 +00:00
|
|
|
|
|
|
|
var sparklineOptions = {
|
|
|
|
height: 80,//Height of the chart - Defaults to 'auto' (line height of the containing tag)
|
|
|
|
|
|
|
|
chartRangeMin: -1,
|
|
|
|
chartRangeMax: 1,
|
|
|
|
|
|
|
|
type: 'bar',
|
|
|
|
barSpacing: 0,
|
|
|
|
barWidth: 2,
|
|
|
|
barColor: '#00bf5f',
|
|
|
|
negBarColor: '#f22929',
|
2016-08-15 10:57:39 +00:00
|
|
|
zeroColor: '#ffff00',
|
|
|
|
|
2016-08-16 14:33:02 +00:00
|
|
|
tooltipFormat: '<span style="color: {{color}}">●</span> {{offset:names}}, {{value}} </span>',
|
2016-08-13 13:24:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$.getJSON("/sentiment_analysis_getplotdata/",
|
|
|
|
function(data) {
|
2016-08-13 20:17:11 +00:00
|
|
|
var all_data = [];
|
2016-08-13 13:24:57 +00:00
|
|
|
var plot_data = [];
|
2016-08-13 20:17:11 +00:00
|
|
|
var graph_avg = [];
|
2016-08-13 13:24:57 +00:00
|
|
|
var array_provider = Object.keys(data);
|
|
|
|
var dates_providers = Object.keys(data[array_provider[0]]);
|
|
|
|
var dateStart = parseInt(dates_providers[0]);
|
|
|
|
var oneHour = 60*60;
|
|
|
|
var oneWeek = oneHour*24*7;
|
|
|
|
|
2016-08-15 10:57:39 +00:00
|
|
|
var all_graph_day_sum = 0.0;
|
|
|
|
var all_graph_hour_sum = 0.0;
|
2016-08-17 08:43:43 +00:00
|
|
|
var all_graph_hour_maxVal = 0.0;
|
2016-08-17 07:46:25 +00:00
|
|
|
var all_day_avg = 0.0;
|
2016-08-17 08:43:43 +00:00
|
|
|
var all_day_avg_maxVal = 0.0;
|
2016-08-15 10:57:39 +00:00
|
|
|
|
2016-08-13 13:24:57 +00:00
|
|
|
for (graphNum=0; graphNum<8; graphNum++) {
|
2016-08-15 10:57:39 +00:00
|
|
|
var max_value = 0.0;
|
2016-08-17 08:43:43 +00:00
|
|
|
var max_value_day = 0.0;
|
2016-08-13 13:24:57 +00:00
|
|
|
var graph_data = [];
|
|
|
|
var spark_data = [];
|
|
|
|
var curr_provider = array_provider[graphNum];
|
2016-08-13 20:17:11 +00:00
|
|
|
var curr_sum = 0.0;
|
2016-08-16 14:33:02 +00:00
|
|
|
var curr_sum_elem = 0.0;
|
2016-08-13 20:17:11 +00:00
|
|
|
var day_sum = 0.0;
|
2016-08-16 14:33:02 +00:00
|
|
|
var day_sum_elem = 0.0;
|
2016-08-15 10:57:39 +00:00
|
|
|
var hour_sum = 0.0;
|
2016-08-13 13:24:57 +00:00
|
|
|
|
2016-08-17 07:46:25 +00:00
|
|
|
for(curr_date=dateStart+oneHour; curr_date<=dateStart+oneWeek; curr_date+=oneHour){
|
2016-08-13 13:24:57 +00:00
|
|
|
var data_array = data[curr_provider][curr_date];
|
|
|
|
|
|
|
|
if (data_array.length == 0){
|
|
|
|
graph_data.push({'neg': 0.0, 'neu': 0.0, 'pos': 0.0, 'compoundPos': 0.0, 'compoundNeg': 0.0});
|
|
|
|
spark_data.push(0);
|
2016-08-15 10:57:39 +00:00
|
|
|
} else { //compute avg for a given date for a given graph
|
2016-08-13 13:24:57 +00:00
|
|
|
var compPosAvg = 0;
|
|
|
|
var compNegAvg = 0;
|
|
|
|
var pos = 0;
|
|
|
|
var neg = 0;
|
|
|
|
var neu = 0;
|
|
|
|
|
|
|
|
for(i=0; i<data_array.length; i++){
|
|
|
|
//console.log(data_array[i].replace(/\'/g, '\"'));
|
|
|
|
var curr_data = jQuery.parseJSON(data_array[i].replace(/\'/g, '\"'));
|
|
|
|
compPosAvg += curr_data['compoundPos'];
|
|
|
|
compNegAvg += curr_data['compoundNeg'];
|
|
|
|
pos += curr_data['pos'];
|
|
|
|
neg += curr_data['neg'];
|
|
|
|
neu += curr_data['neu'];
|
|
|
|
}
|
|
|
|
compPosAvg = compPosAvg/data_array.length;
|
|
|
|
compNegAvg = compNegAvg/data_array.length;
|
|
|
|
pos = pos/data_array.length;
|
|
|
|
neg = neg/data_array.length;
|
|
|
|
neu = neu/data_array.length;
|
|
|
|
|
|
|
|
graph_data.push({'neg': neg, 'neu': neu, 'pos': pos, 'compoundPos': compPosAvg, 'compoundNeg': compNegAvg});
|
|
|
|
spark_data.push(pos-neg);
|
2016-08-13 20:17:11 +00:00
|
|
|
curr_sum += (pos-neg);
|
2016-08-16 14:33:02 +00:00
|
|
|
curr_sum_elem++;
|
2016-08-15 10:57:39 +00:00
|
|
|
max_value = Math.abs(pos-neg) > max_value ? Math.abs(pos-neg) : max_value;
|
2016-08-13 20:17:11 +00:00
|
|
|
|
2016-08-17 07:46:25 +00:00
|
|
|
if(curr_date >= dateStart+oneWeek-23*oneHour){
|
2016-08-17 08:43:43 +00:00
|
|
|
max_value_day = Math.abs(pos-neg) > max_value_day ? Math.abs(pos-neg) : max_value_day;
|
2016-08-13 20:17:11 +00:00
|
|
|
day_sum += (pos-neg);
|
2016-08-16 14:33:02 +00:00
|
|
|
day_sum_elem++;
|
2016-08-13 20:17:11 +00:00
|
|
|
}
|
2016-08-17 08:43:43 +00:00
|
|
|
if(curr_date > dateStart+oneWeek-2*oneHour && curr_date <=dateStart+oneWeek-oneHour){
|
2016-08-15 10:57:39 +00:00
|
|
|
hour_sum += (pos-neg);
|
|
|
|
}
|
2016-08-13 20:17:11 +00:00
|
|
|
|
2016-08-13 13:24:57 +00:00
|
|
|
}
|
|
|
|
}
|
2016-08-15 10:57:39 +00:00
|
|
|
all_graph_day_sum += day_sum;
|
|
|
|
all_graph_hour_sum += hour_sum;
|
2016-08-17 08:43:43 +00:00
|
|
|
all_graph_hour_maxVal = Math.abs(hour_sum) > all_graph_hour_maxVal ? Math.abs(hour_sum) : all_graph_hour_maxVal;
|
2016-08-15 10:57:39 +00:00
|
|
|
|
2016-08-16 14:33:02 +00:00
|
|
|
var curr_avg = curr_sum / (curr_sum_elem);
|
2016-08-20 16:48:24 +00:00
|
|
|
if(isNaN(curr_avg))
|
|
|
|
curr_avg = 0.0
|
2016-08-16 14:33:02 +00:00
|
|
|
//var curr_avg = curr_sum / (oneWeek/oneHour);
|
2016-08-15 10:57:39 +00:00
|
|
|
//var curr_avg = curr_sum / (spark_data.length);
|
|
|
|
graph_avg.push([curr_provider, curr_avg]);
|
2016-08-13 13:24:57 +00:00
|
|
|
plot_data.push(spark_data);
|
2016-08-13 20:17:11 +00:00
|
|
|
all_data.push(graph_data);
|
2016-08-13 13:24:57 +00:00
|
|
|
|
2016-08-15 10:57:39 +00:00
|
|
|
|
|
|
|
sparklineOptions.chartRangeMax = max_value;
|
|
|
|
sparklineOptions.chartRangeMin = -max_value;
|
2016-08-16 14:33:02 +00:00
|
|
|
sparklineOptions.tooltipValueLookups = { names: offset_to_date};
|
|
|
|
|
2016-08-13 20:17:11 +00:00
|
|
|
// print week
|
2016-08-13 13:24:57 +00:00
|
|
|
var num = graphNum + 1;
|
2016-08-13 20:17:11 +00:00
|
|
|
var placeholder = '.sparkLineStatsWeek' + num;
|
2016-08-20 16:48:24 +00:00
|
|
|
sparklineOptions.barWidth = 2;
|
2016-08-13 13:24:57 +00:00
|
|
|
$(placeholder).sparkline(plot_data[graphNum], sparklineOptions);
|
2016-08-15 10:57:39 +00:00
|
|
|
$(placeholder+'t').text(curr_provider);
|
2016-08-18 13:34:19 +00:00
|
|
|
var curr_avg_text = isNaN(curr_avg) ? "No data" : curr_avg.toFixed(5);
|
|
|
|
$(placeholder+'s').text(curr_avg_text);
|
2016-08-13 13:24:57 +00:00
|
|
|
|
2016-08-16 09:23:14 +00:00
|
|
|
sparklineOptions.barWidth = 18;
|
2016-08-16 14:33:02 +00:00
|
|
|
sparklineOptions.tooltipFormat = '<span style="color: {{color}}">●</span> Avg: {{value}} </span>'
|
2016-08-13 20:17:11 +00:00
|
|
|
$(placeholder+'b').sparkline([curr_avg], sparklineOptions);
|
2016-08-16 14:33:02 +00:00
|
|
|
sparklineOptions.tooltipFormat = '<span style="color: {{color}}">●</span> {{offset:names}}, {{value}} </span>'
|
2016-08-17 08:43:43 +00:00
|
|
|
|
2016-08-16 14:33:02 +00:00
|
|
|
sparklineOptions.tooltipValueLookups = { names: offset_to_time};
|
2016-08-17 08:43:43 +00:00
|
|
|
sparklineOptions.chartRangeMax = max_value_day;
|
|
|
|
sparklineOptions.chartRangeMin = -max_value_day;
|
2016-08-13 13:24:57 +00:00
|
|
|
|
2016-08-18 13:34:19 +00:00
|
|
|
var avgName = ".pannelWeek" + num;
|
|
|
|
if (curr_avg > 0) {
|
|
|
|
$(avgName).addClass("panel-success")
|
|
|
|
} else if(curr_avg < 0) {
|
|
|
|
$(avgName).addClass("panel-danger")
|
|
|
|
} else if(isNaN(curr_avg)) {
|
|
|
|
$(avgName).addClass("panel-info")
|
|
|
|
} else {
|
|
|
|
$(avgName).addClass("panel-warning")
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-13 20:17:11 +00:00
|
|
|
// print today
|
|
|
|
var data_length = plot_data[graphNum].length;
|
2016-08-16 14:33:02 +00:00
|
|
|
var data_today = plot_data[graphNum].slice(data_length-24, data_length);
|
2016-08-13 13:24:57 +00:00
|
|
|
|
2016-08-13 20:17:11 +00:00
|
|
|
placeholder = '.sparkLineStatsToday' + num;
|
|
|
|
sparklineOptions.barWidth = 14;
|
|
|
|
$(placeholder).sparkline(data_today, sparklineOptions);
|
2016-08-15 10:57:39 +00:00
|
|
|
$(placeholder+'t').text(curr_provider);
|
2016-08-13 13:24:57 +00:00
|
|
|
|
2016-08-16 09:23:14 +00:00
|
|
|
sparklineOptions.barWidth = 18;
|
2016-08-16 14:33:02 +00:00
|
|
|
sparklineOptions.tooltipFormat = '<span style="color: {{color}}">●</span> Avg: {{value}} </span>'
|
|
|
|
//var day_avg = day_sum/24;
|
2016-08-17 07:46:25 +00:00
|
|
|
var day_avg = isNaN(day_sum/day_sum_elem) ? 0 : day_sum/day_sum_elem;
|
|
|
|
var day_avg_text = isNaN(day_sum/day_sum_elem) ? 'No data' : (day_avg).toFixed(5);
|
|
|
|
all_day_avg += day_avg;
|
2016-08-17 08:43:43 +00:00
|
|
|
all_day_avg_maxVal = Math.abs(day_avg) > all_day_avg_maxVal ? Math.abs(day_avg) : all_day_avg_maxVal;
|
2016-08-16 14:33:02 +00:00
|
|
|
$(placeholder+'b').sparkline([day_avg], sparklineOptions);
|
|
|
|
sparklineOptions.tooltipFormat = '<span style="color: {{color}}">●</span> {{offset:names}}, {{value}} </span>'
|
2016-08-17 07:46:25 +00:00
|
|
|
$(placeholder+'s').text(day_avg_text);
|
2016-08-13 13:24:57 +00:00
|
|
|
|
2016-08-18 13:34:19 +00:00
|
|
|
avgName = ".pannelToday" + num;
|
|
|
|
if (day_avg > 0) {
|
|
|
|
$(avgName).addClass("panel-success")
|
|
|
|
} else if(day_avg < 0) {
|
|
|
|
$(avgName).addClass("panel-danger")
|
|
|
|
} else if(isNaN(day_sum/day_sum_elem)) {
|
|
|
|
$(avgName).addClass("panel-info")
|
|
|
|
} else {
|
|
|
|
$(avgName).addClass("panel-warning")
|
|
|
|
}
|
|
|
|
|
2016-08-13 20:17:11 +00:00
|
|
|
}//for loop
|
2016-08-13 13:24:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-15 10:57:39 +00:00
|
|
|
/* ---------------- Gauge ---------------- */
|
|
|
|
var gaugeOptions = {
|
|
|
|
animateEasing: true,
|
|
|
|
|
|
|
|
elementWidth: 200,
|
|
|
|
elementHeight: 125,
|
|
|
|
|
|
|
|
arcFillStart: 10,
|
|
|
|
arcFillEnd: 12,
|
|
|
|
arcFillTotal: 20,
|
|
|
|
incTot: 1.0,
|
|
|
|
|
|
|
|
arcBgColorLight: 200,
|
|
|
|
arcBgColorSat: 0,
|
|
|
|
arcStrokeFg: 20,
|
|
|
|
arcStrokeBg: 30,
|
|
|
|
|
|
|
|
colorArcFg: '#FF3300',
|
|
|
|
animateSpeed: 1,
|
|
|
|
|
|
|
|
};
|
|
|
|
// Clone object
|
|
|
|
var gaugeOptions2 = jQuery.extend(true, {}, gaugeOptions);
|
|
|
|
var gaugeOptions3 = jQuery.extend(true, {}, gaugeOptions);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gaugeOptions.appendTo = '#gauge_today_last_hour';
|
|
|
|
gaugeOptions.dialLabel = 'Last hour';
|
|
|
|
gaugeOptions.elementId = 'gauge1';
|
2016-08-17 08:43:43 +00:00
|
|
|
var piePercent = (all_graph_hour_sum / 8) / all_graph_hour_maxVal;
|
2016-08-16 14:33:02 +00:00
|
|
|
gaugeOptions.inc = piePercent;
|
2016-08-15 10:57:39 +00:00
|
|
|
var gauge_today_last_hour = new FlexGauge(gaugeOptions);
|
|
|
|
|
|
|
|
gaugeOptions2.appendTo = '#gauge_today_last_days';
|
|
|
|
gaugeOptions2.dialLabel = 'Today';
|
|
|
|
gaugeOptions2.elementId = 'gauge2';
|
2016-08-17 07:46:25 +00:00
|
|
|
//piePercent = (all_graph_day_sum / (8*24)) / max_value;
|
2016-08-17 08:43:43 +00:00
|
|
|
piePercent = (all_day_avg / 8) / all_day_avg_maxVal;
|
2016-08-16 14:33:02 +00:00
|
|
|
gaugeOptions2.inc = piePercent;
|
2016-08-15 10:57:39 +00:00
|
|
|
var gauge_today_last_days = new FlexGauge(gaugeOptions2);
|
|
|
|
|
|
|
|
gaugeOptions3.appendTo = '#gauge_week';
|
|
|
|
gaugeOptions3.dialLabel = 'Week';
|
|
|
|
gaugeOptions3.elementId = 'gauge3';
|
2016-08-13 13:24:57 +00:00
|
|
|
|
2016-08-15 10:57:39 +00:00
|
|
|
var graph_avg_sum = 0.0;
|
2016-08-16 14:33:02 +00:00
|
|
|
var temp_max_val = 0.0;
|
|
|
|
for (i=0; i<graph_avg.length; i++){
|
2016-08-15 10:57:39 +00:00
|
|
|
graph_avg_sum += graph_avg[i][1];
|
2016-08-16 14:33:02 +00:00
|
|
|
temp_max_val = Math.abs(graph_avg[i][1]) > temp_max_val ? Math.abs(graph_avg[i][1]) : temp_max_val;
|
|
|
|
}
|
2016-08-13 13:24:57 +00:00
|
|
|
|
2016-08-16 14:33:02 +00:00
|
|
|
piePercent = (graph_avg_sum / graph_avg.length) / temp_max_val;
|
|
|
|
gaugeOptions3.inc = piePercent;
|
2016-08-15 10:57:39 +00:00
|
|
|
var gauge_today_last_days = new FlexGauge(gaugeOptions3);
|
2016-08-13 13:24:57 +00:00
|
|
|
|
|
|
|
|
2016-08-15 10:57:39 +00:00
|
|
|
/* --------- Sort providers -------- */
|
2016-08-12 08:22:24 +00:00
|
|
|
|
2016-08-15 10:57:39 +00:00
|
|
|
graph_avg.sort(function(a, b){return b[1]-a[1]});
|
2016-08-12 08:22:24 +00:00
|
|
|
|
2016-08-15 10:57:39 +00:00
|
|
|
for (i=1; i<6; i++){
|
|
|
|
$('.worst'+i).text(graph_avg[7-(i-1)][0]);
|
|
|
|
$('.best'+i).text(graph_avg[i-1][0]);
|
|
|
|
}
|
2016-08-12 08:22:24 +00:00
|
|
|
|
2016-08-15 10:57:39 +00:00
|
|
|
/* ----------- CanvasJS ------------ */
|
2016-08-12 08:22:24 +00:00
|
|
|
|
2016-08-15 10:57:39 +00:00
|
|
|
var comp_sum_day_pos = 0.0;
|
|
|
|
var comp_sum_day_neg = 0.0;
|
|
|
|
var comp_sum_hour_pos = 0.0;
|
|
|
|
var comp_sum_hour_neg = 0.0;
|
2016-08-16 14:33:02 +00:00
|
|
|
for(graphNum=0; graphNum<8; graphNum++){
|
|
|
|
curr_graphData = all_data[graphNum];
|
|
|
|
var gauge_data = curr_graphData.slice(curr_graphData.length-24, curr_graphData.length);
|
|
|
|
for (i=1; i< gauge_data.length; i++){
|
|
|
|
comp_sum_day_pos += gauge_data[i].compoundPos;
|
|
|
|
comp_sum_day_neg += gauge_data[i].compoundNeg;
|
|
|
|
|
|
|
|
if(i == 23){
|
|
|
|
comp_sum_hour_pos += gauge_data[i].compoundPos;
|
|
|
|
comp_sum_hour_neg += gauge_data[i].compoundNeg;
|
|
|
|
}
|
2016-08-15 10:57:39 +00:00
|
|
|
}
|
|
|
|
|
2016-08-16 14:33:02 +00:00
|
|
|
}
|
2016-08-15 10:57:39 +00:00
|
|
|
|
|
|
|
var options_canvasJS_1 = {
|
|
|
|
|
|
|
|
animationEnabled: true,
|
|
|
|
axisY: {
|
|
|
|
tickThickness: 0,
|
|
|
|
lineThickness: 0,
|
|
|
|
valueFormatString: " ",
|
|
|
|
gridThickness: 0
|
|
|
|
},
|
|
|
|
axisX: {
|
|
|
|
tickThickness: 0,
|
|
|
|
lineThickness: 0,
|
|
|
|
labelFontSize: 0.1,
|
|
|
|
},
|
|
|
|
data: [
|
2016-08-16 14:33:02 +00:00
|
|
|
{
|
2016-08-17 08:43:43 +00:00
|
|
|
toolTipContent: "<span style='\"'color: {color};'\"'><strong>Positive: </strong></span><span><strong>{y}</strong></span>",
|
2016-08-16 14:33:02 +00:00
|
|
|
type: "bar",
|
|
|
|
color: "green",
|
|
|
|
dataPoints: [
|
|
|
|
{y: comp_sum_hour_pos/8}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2016-08-17 08:43:43 +00:00
|
|
|
toolTipContent: "<span style='\"'color: {color};'\"'><strong>Negative: </strong></span><span><strong>{y}</strong></span>",
|
2016-08-16 14:33:02 +00:00
|
|
|
type: "bar",
|
|
|
|
color: "red",
|
|
|
|
dataPoints: [
|
|
|
|
{y: comp_sum_hour_neg/8}
|
|
|
|
]
|
|
|
|
}
|
2016-08-15 10:57:39 +00:00
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
var chart_canvas1 = new CanvasJS.Chart("bar_today_last_hour", options_canvasJS_1);
|
|
|
|
|
|
|
|
var options_canvasJS_2 = {
|
|
|
|
|
|
|
|
animationEnabled: true,
|
|
|
|
axisY: {
|
|
|
|
tickThickness: 0,
|
|
|
|
lineThickness: 0,
|
|
|
|
valueFormatString: " ",
|
|
|
|
gridThickness: 0
|
|
|
|
},
|
|
|
|
axisX: {
|
|
|
|
tickThickness: 0,
|
|
|
|
lineThickness: 0,
|
|
|
|
labelFontSize: 0.1,
|
|
|
|
},
|
|
|
|
data: [
|
|
|
|
{
|
2016-08-17 08:43:43 +00:00
|
|
|
toolTipContent: "<span style='\"'color: {color};'\"'><strong>Positive: </strong></span><span><strong>{y}</strong></span>",
|
2016-08-15 10:57:39 +00:00
|
|
|
type: "bar",
|
|
|
|
color: "green",
|
|
|
|
dataPoints: [
|
|
|
|
{y: comp_sum_day_pos/8}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2016-08-17 08:43:43 +00:00
|
|
|
toolTipContent: "<span style='\"'color: {color};'\"'><strong>Negative: </strong></span><span><strong>{y}</strong></span>",
|
2016-08-15 10:57:39 +00:00
|
|
|
type: "bar",
|
|
|
|
color: "red",
|
|
|
|
dataPoints: [
|
|
|
|
{y: comp_sum_day_neg/8}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
var chart_canvas2 = new CanvasJS.Chart("bar_today_last_days", options_canvasJS_2);
|
|
|
|
|
|
|
|
chart_canvas1.render();
|
|
|
|
chart_canvas2.render();
|
2016-08-12 08:22:24 +00:00
|
|
|
|
|
|
|
|
2016-08-18 13:34:19 +00:00
|
|
|
|
2016-08-12 08:22:24 +00:00
|
|
|
}
|
2016-08-15 10:57:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-12 08:22:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|