Merge branch 'users' into trendings

pull/9/head
Sami Mokaddem 2017-11-16 15:11:04 +01:00
commit 5779eb53c4
1 changed files with 6 additions and 3 deletions

View File

@ -44,8 +44,9 @@ function updateDatePieOrg() {
if (toPlot.length == 0) { if (toPlot.length == 0) {
toPlot = [{ label: 'No data', data: 100 }]; toPlot = [{ label: 'No data', data: 100 }];
} }
if (!pieOrgWidget === undefined) { if (!(pieOrgWidget === undefined)) {
pieOrgWidget.setData(toPlot); pieOrgWidget.setData(toPlot);
pieOrgWidget.setupGrid();
pieOrgWidget.draw(); pieOrgWidget.draw();
} else { } else {
pieOrgWidget = $.plot('#pieOrg', toPlot, { pieOrgWidget = $.plot('#pieOrg', toPlot, {
@ -70,8 +71,9 @@ function updateDatePieApi() {
toPlot = [{ label: 'No data', data: 100 }]; toPlot = [{ label: 'No data', data: 100 }];
} }
if (!pieApiWidget === undefined) { if (!(pieApiWidget === undefined)) {
pieApiWidget.setData(toPlot); pieApiWidget.setData(toPlot);
pieApiWidget.setupGrid();
pieApiWidget.draw(); pieApiWidget.draw();
} else { } else {
pieApiWidget = $.plot('#pieApi', toPlot, { pieApiWidget = $.plot('#pieApi', toPlot, {
@ -100,8 +102,9 @@ function updateDateOvertime() {
temp.push([new Date(item[0]*1000), item[1]]); temp.push([new Date(item[0]*1000), item[1]]);
} }
data = {label: 'Login overtime', data: temp} data = {label: 'Login overtime', data: temp}
if (!overtimeWidget === undefined) { if (!(overtimeWidget === undefined)) {
overtimeWidget.setData(toPlot); overtimeWidget.setData(toPlot);
overtimeWidget.setupGrid();
overtimeWidget.draw(); overtimeWidget.draw();
} else { } else {
overtimeWidget = $.plot('#lineChart', [data], { overtimeWidget = $.plot('#lineChart', [data], {