From 59ab18ad74443db75009cc10bbb719223c37143f Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Wed, 30 Jan 2013 13:04:01 +0100 Subject: [PATCH] Fixed chart displaying when no much value. --- src/html/js/entries.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/html/js/entries.js b/src/html/js/entries.js index 8beff86..51a215d 100644 --- a/src/html/js/entries.js +++ b/src/html/js/entries.js @@ -483,10 +483,11 @@ var ListViewModel = function() { drawChart = function(data, element) { // Clear previous chart $(element).html(""); + element.style.height="0px"; var entries = data.entries; - if(entries && entries.length > 0) { + if(entries && entries.length > 2) { // Prepare for today vertical line. var today = new Date(); today.setHours(0); @@ -583,8 +584,9 @@ drawChart = function(data, element) { drawPieChart = function(entries, element) { // Clear previous chart $(element).html(""); + element.style.height="0px"; - if(entries && entries.length > 0) { + if(entries && entries.length > 2) { // Plot chart, and store it in a window parameter for resize callback (need to be done better than it...) window.pieChart = $.jqplot(element.id, [entries], { // Title of the chart