azkaban-developers

Details

diff --git a/src/java/azkaban/webapp/servlet/velocity/flowpage.vm b/src/java/azkaban/webapp/servlet/velocity/flowpage.vm
index 2fb3460..ddc9551 100644
--- a/src/java/azkaban/webapp/servlet/velocity/flowpage.vm
+++ b/src/java/azkaban/webapp/servlet/velocity/flowpage.vm
@@ -104,8 +104,7 @@
     <div class="container-full" id="executionsView">
 			<div class="row">
 				<div class="col-xs-12">
-					<div class="well well-clear well-sm">
-            <div id="timeGraph"></div>
+					<div class="well well-clear well-sm" id="timeGraph">
           </div>
 
 					<table class="table table-striped table-bordered table-condensed table-hover" id="execTable">
diff --git a/src/java/azkaban/webapp/servlet/velocity/jobhistorypage.vm b/src/java/azkaban/webapp/servlet/velocity/jobhistorypage.vm
index 19fcac4..bdeca48 100644
--- a/src/java/azkaban/webapp/servlet/velocity/jobhistorypage.vm
+++ b/src/java/azkaban/webapp/servlet/velocity/jobhistorypage.vm
@@ -72,8 +72,7 @@
 
 			<div class="row">
 				<div class="col-xs-12">
-					<div class="well well-clear well-sm">
-            <div id="timeGraph"></div>
+					<div class="well well-clear well-sm" id="timeGraph">
           </div>
 
           <table id="all-jobs" class="table table-striped table-bordered table-condensed table-hover">
diff --git a/src/web/js/azkaban/view/time-graph.js b/src/web/js/azkaban/view/time-graph.js
index 5f4fd62..c56a39f 100644
--- a/src/web/js/azkaban/view/time-graph.js
+++ b/src/web/js/azkaban/view/time-graph.js
@@ -24,7 +24,7 @@ azkaban.TimeGraphView = Backbone.View.extend({
 		this.model.bind('render', this.render, this);
 		this.model.bind('change:page', this.render, this);
     this.modelField = settings.modelField;
-    this.element = settings.el;
+    this.graphContainer = settings.el;
     this.render();
 	},
 
@@ -59,6 +59,14 @@ azkaban.TimeGraphView = Backbone.View.extend({
       indexMap[endTime.toString()] = i;
     }
 
+		if (data.length == 0) {
+			$(this.graphContainer).hide();
+			return;
+		}
+
+		var graphDiv = document.createElement('div');
+		$(this.graphContainer).append(graphDiv);
+
     var lineColorsCallback = function(row, sidx, type) {
       if (type != 'point') {
         return "#000000";
@@ -102,7 +110,7 @@ azkaban.TimeGraphView = Backbone.View.extend({
     };
 
     Morris.Line({
-      element: this.element,
+      element: graphDiv,
       data: data,
       xkey: 'time',
       ykeys: ['duration'],