From f1f15f1670fc10a3274fb1d9bd1db1e6995fffee Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Thu, 29 Jan 2015 14:01:20 -0500 Subject: [PATCH] Generate chart model from the start --- awx/ui/static/js/directives/job-status-graph.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/awx/ui/static/js/directives/job-status-graph.js b/awx/ui/static/js/directives/job-status-graph.js index 5dcf977e4e..a56ab2b2d9 100644 --- a/awx/ui/static/js/directives/job-status-graph.js +++ b/awx/ui/static/js/directives/job-status-graph.js @@ -10,7 +10,7 @@ angular.module('DashboardGraphs') function link(scope, element, attr) { var html; var url; - var job_status_chart; + var job_status_chart = nv.models.lineChart(); var cleanup = angular.noop; scope.period="month"; @@ -57,13 +57,13 @@ angular.module('DashboardGraphs') return series; }); - job_status_chart = nv.models.lineChart() - .margin({top: 5, right: 75, bottom: 40, left: 85}) //Adjust chart margins to give the x-axis some breathing room. - .x(function(d,i) { return i; }) - .useInteractiveGuideline(true) //We want nice looking tooltips and a guideline! - .showLegend(true) //Show the legend, allowing users to turn on/off line series. - .showYAxis(true) //Show the y-axis - .showXAxis(true); //Show the x-axis + job_status_chart + .margin({top: 5, right: 75, bottom: 40, left: 85}) //Adjust chart margins to give the x-axis some breathing room. + .x(function(d,i) { return i; }) + .useInteractiveGuideline(true) //We want nice looking tooltips and a guideline! + .showLegend(true) //Show the legend, allowing users to turn on/off line series. + .showYAxis(true) //Show the y-axis + .showXAxis(true); //Show the x-axis var width = $('.graph-container').width(); // nv.utils.windowSize().width/3,