Преглед изворни кода

[search] Fixed enable selection

Enrico Berti пре 11 година
родитељ
комит
3c025f7
1 измењених фајлова са 6 додато и 4 уклоњено
  1. 6 4
      apps/search/static/js/charts.ko.js

+ 6 - 4
apps/search/static/js/charts.ko.js

@@ -323,15 +323,17 @@ function barChart(element, options, isTimeline) {
       }
       else {
         _chart = nv.models.multiBarWithBrushChart();
-        _chart.xAxis
-          .showMaxMin(true)
-          .tickFormat(d3.format(',0f'));
+        if (_datum.length > 0 && _datum[0].values.length > 10){
+          _chart.enableSelection();
+        }
+        _chart.xAxis.showMaxMin(false).tickFormat(d3.format(',0f'));
         _chart.multibar.hideable(true);
         _chart.multibar.stacked(typeof options.stacked != "undefined" ? options.stacked : false);
         _chart.onStateChange(options.onStateChange);
+        _chart.onSelectRange(options.onSelectRange);
       }
     }
-    _chart.transitionDuration(100);
+    _chart.transitionDuration(0);
 
     _chart.yAxis
         .tickFormat(d3.format(',0f'));