Generate chart model from the start

This commit is contained in:
Joe Fiorini 2015-01-29 14:01:20 -05:00
parent 98a4f195c2
commit f1f15f1670

View File

@ -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,