Fixed chart displaying when no much value.

This commit is contained in:
Alexis Lahouze 2013-01-30 13:04:01 +01:00
parent 43c4e1f61d
commit 87a66069ad
1 changed files with 4 additions and 2 deletions

View File

@ -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 > 1) {
// 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 > 1) {
// 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