From bb677b9061296189def56ba47a7256c80217dada Mon Sep 17 00:00:00 2001 From: Mokaddem Date: Tue, 16 Aug 2016 11:23:14 +0200 Subject: [PATCH] Added avg text in sentiment-trending + fixed date range bug --- var/www/static/js/sentiment_trending.js | 7 ++++--- var/www/templates/sentiment_analysis_trending.html | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/var/www/static/js/sentiment_trending.js b/var/www/static/js/sentiment_trending.js index 6ccf8bd3..f0c9e9c6 100644 --- a/var/www/static/js/sentiment_trending.js +++ b/var/www/static/js/sentiment_trending.js @@ -101,22 +101,23 @@ $.getJSON("/sentiment_analysis_getplotdata/", $(placeholder+'t').text(curr_provider); $(placeholder+'s').text(curr_avg.toFixed(5)); - sparklineOptions.barWidth = 7; + sparklineOptions.barWidth = 18; $(placeholder+'b').sparkline([curr_avg], sparklineOptions); sparklineOptions.barWidth = 2; // print today var data_length = plot_data[graphNum].length; - var data_today = plot_data[graphNum].slice(data_length-24*2, data_length-24*1); + var data_today = plot_data[graphNum].slice(data_length-24, data_length-1); placeholder = '.sparkLineStatsToday' + num; sparklineOptions.barWidth = 14; $(placeholder).sparkline(data_today, sparklineOptions); $(placeholder+'t').text(curr_provider); - sparklineOptions.barWidth = 7; + sparklineOptions.barWidth = 18; $(placeholder+'b').sparkline([day_sum/24], sparklineOptions); sparklineOptions.barWidth = 2; + $(placeholder+'s').text((day_sum/24).toFixed(5)); }//for loop diff --git a/var/www/templates/sentiment_analysis_trending.html b/var/www/templates/sentiment_analysis_trending.html index 70abaaf5..b5be05e9 100644 --- a/var/www/templates/sentiment_analysis_trending.html +++ b/var/www/templates/sentiment_analysis_trending.html @@ -121,6 +121,7 @@
Graph 1 + Avg
@@ -136,6 +137,7 @@
Graph 2 + Avg
@@ -151,6 +153,7 @@
Graph 3 + Avg
@@ -166,6 +169,7 @@
Graph 4 + Avg
@@ -185,6 +189,7 @@
Graph 5 + Avg
@@ -200,6 +205,7 @@
Graph 6 + Avg
@@ -215,6 +221,7 @@
Graph 7 + Avg
@@ -230,6 +237,7 @@
Graph 8 + Avg