Browse Source

HUE-8178 [charts] Fix timeline in table.

jdesjean 7 years ago
parent
commit
e9d50e2780

+ 2 - 2
desktop/core/src/desktop/static/desktop/js/ko.charts.js

@@ -290,7 +290,7 @@
         }
         $(element).data("type", valueAccessor().type());
       }
-      var _datum = _options.transformer(_options.datum);
+      var _datum = _options.transformer(_options.datum, true);
       var _chart = $(element).data("chart");
       if (_chart) {
         window.setTimeout(function () {
@@ -1048,7 +1048,7 @@
   }
 
   function barChartBuilder(element, options, isTimeline) {
-    var _datum = options.transformer(options.datum);
+    var _datum = options.transformer(options.datum, isTimeline);
     $(element).height(300);
 
     var _isPivot = options.isPivot != null ? options.isPivot : false;

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

@@ -3815,7 +3815,7 @@ function multiSerieDataTransformer(rawDatum) {
 }
 
 
-function multiSerieDataTransformerGrid(rawDatum) {
+function multiSerieDataTransformerGrid(rawDatum, isTimeline) {
   var _datum = [];
 
   var chartX = searchViewModel.collection.template.chartSettings.chartX();
@@ -3829,7 +3829,7 @@ function multiSerieDataTransformerGrid(rawDatum) {
         if (item.item[chartX] && item.item[col]) {
           _data.push({
             series: _plottedSerie,
-            x: item.item[chartX](),
+            x: isTimeline && new Date(item.item[chartX]()) || item.item[chartX](),
             y: item.item[col](),
             obj: item.item
           });