eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject eagle git commit: [EAGLE-1043] display date when series cross the date
Date Wed, 14 Jun 2017 09:13:00 GMT
Repository: eagle
Updated Branches:
  refs/heads/master 2398c7b7e -> 737cf467f


[EAGLE-1043] display date when series cross the date

https://issues.apache.org/jira/browse/EAGLE-1043

Current chart don't provide date info which is not user friendly

Author: zombieJ <smith3816@gmail.com>

Closes #950 from zombieJ/EAGLE-1043.


Project: http://git-wip-us.apache.org/repos/asf/eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/eagle/commit/737cf467
Tree: http://git-wip-us.apache.org/repos/asf/eagle/tree/737cf467
Diff: http://git-wip-us.apache.org/repos/asf/eagle/diff/737cf467

Branch: refs/heads/master
Commit: 737cf467fe32af4e27d426b37768817b8604bef6
Parents: 2398c7b
Author: zombieJ <smith3816@gmail.com>
Authored: Wed Jun 14 17:12:49 2017 +0800
Committer: zombieJ <smith3816@gmail.com>
Committed: Wed Jun 14 17:12:49 2017 +0800

----------------------------------------------------------------------
 .../src/main/webapp/app/dev/public/js/components/chart.js   | 9 +++++++--
 eagle-server/src/main/webapp/app/package.json               | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/737cf467/eagle-server/src/main/webapp/app/dev/public/js/components/chart.js
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/public/js/components/chart.js b/eagle-server/src/main/webapp/app/dev/public/js/components/chart.js
index 0093ce5..ce4f79b 100644
--- a/eagle-server/src/main/webapp/app/dev/public/js/components/chart.js
+++ b/eagle-server/src/main/webapp/app/dev/public/js/components/chart.js
@@ -108,6 +108,10 @@
 					var seriesList = $.map($scope.series || [], function (series, id) {
 						if(id === 0 && !$scope.category) {
 							//var preDate = -1;
+							var first = series.data[0].x || 0;
+							var last = series.data[series.data.length - 1].x || 0;
+							var crossDay = (last - first) / (1000 * 60 * 60 * 24) >= 1;
+
 							categoryList = $.map(series.data, function (point) {
 								/*ivar time = new Time(point.x);
 								f(preDate !== time.date()) {
@@ -117,7 +121,8 @@
 								if($scope.categoryFunc) {
 									return $scope.categoryFunc(point.x);
 								}
-								return Time.format(point.x, "HH:mm");
+
+								return Time.format(point.x, crossDay ? "MM-DD HH:mm" : "HH:mm").replace(' ', '\n');
 							});
 						}
 
@@ -149,7 +154,7 @@
 						grid: {
 							top: '30',
 							left: '0',
-							right: '0',
+							right: '10',
 							bottom: '0',
 							containLabel: true
 						},

http://git-wip-us.apache.org/repos/asf/eagle/blob/737cf467/eagle-server/src/main/webapp/app/package.json
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/package.json b/eagle-server/src/main/webapp/app/package.json
index 11d72e3..68b8702 100644
--- a/eagle-server/src/main/webapp/app/package.json
+++ b/eagle-server/src/main/webapp/app/package.json
@@ -23,7 +23,7 @@
     "angular-ui-router": "0.3.1",
     "bootstrap": "3.3.6",
     "d3": "3.5.16",
-    "echarts": "^3.4.0",
+    "echarts": "^3.6.1",
     "font-awesome": "4.7.0",
     "jquery": "2.2.4",
     "jquery-slimscroll": "1.3.6",


Mime
View raw message