浏览代码

[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'));