瀏覽代碼

HUE-8070 [dashboard] Properly try to display timeline data as timeline

Romain Rigaux 7 年之前
父節點
當前提交
4231267e2f
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      desktop/libs/dashboard/src/dashboard/templates/common_search.mako

+ 4 - 4
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -3398,8 +3398,8 @@ function timelineChartDataTransformer(rawDatum) {
   $(rawDatum.counts).each(function (cnt, item) {
     _data.push({
       series: 0,
-      x: new Date(moment(item.from).valueOf()),
-      y: item.value,
+      x: new Date(moment(item.from ? item.from : item.value).valueOf()), // When started from a non timeline widget
+      y: item.from ? item.value : item.count,
       obj: item
     });
   });
@@ -3418,8 +3418,8 @@ function timelineChartDataTransformer(rawDatum) {
     $(item.counts).each(function (cnt, item) {
       _data.push({
         series: cnt + 1,
-        x: new Date(moment(item.from).valueOf()),
-        y: item.value,
+        x: new Date(moment(item.from ? item.from : item.value).valueOf()), // When started from a non timeline widget
+        y: item.from ? item.value : item.count,
         obj: item
       });
     });