|
@@ -58,11 +58,12 @@ nv.models.multiBarWithBrushChart = function() {
|
|
|
, defaultState = null
|
|
, defaultState = null
|
|
|
, noData = "No Data Available."
|
|
, noData = "No Data Available."
|
|
|
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState', 'brush')
|
|
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState', 'brush')
|
|
|
- , controlWidth = function() { return showControls ? 300 : 0 }
|
|
|
|
|
|
|
+ , controlWidth = function() { return showControls ? (selectionHidden ? 240 : 300) : 0 }
|
|
|
, transitionDuration = 250
|
|
, transitionDuration = 250
|
|
|
, extent
|
|
, extent
|
|
|
, brushExtent = null
|
|
, brushExtent = null
|
|
|
, selectionEnabled = false
|
|
, selectionEnabled = false
|
|
|
|
|
+ , selectionHidden = false
|
|
|
, onSelectRange = null
|
|
, onSelectRange = null
|
|
|
, onStateChange = null
|
|
, onStateChange = null
|
|
|
, onChartUpdate = null
|
|
, onChartUpdate = null
|
|
@@ -230,10 +231,13 @@ nv.models.multiBarWithBrushChart = function() {
|
|
|
if (showControls) {
|
|
if (showControls) {
|
|
|
var controlsData = [
|
|
var controlsData = [
|
|
|
{ key: LABELS.GROUPED, disabled: multibar.stacked() },
|
|
{ key: LABELS.GROUPED, disabled: multibar.stacked() },
|
|
|
- { key: LABELS.STACKED, disabled: !multibar.stacked() },
|
|
|
|
|
- { key: LABELS.SELECT, disabled: !selectionEnabled, checkbox: true }
|
|
|
|
|
|
|
+ { key: LABELS.STACKED, disabled: !multibar.stacked() }
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
|
|
+ if (! selectionHidden) {
|
|
|
|
|
+ controlsData.push({ key: LABELS.SELECT, disabled: !selectionEnabled, checkbox: true });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
controls.width(controlWidth()).color(['#444', '#444', '#444']);
|
|
controls.width(controlWidth()).color(['#444', '#444', '#444']);
|
|
|
g.select('.nv-controlsWrap')
|
|
g.select('.nv-controlsWrap')
|
|
|
.datum(controlsData)
|
|
.datum(controlsData)
|
|
@@ -652,6 +656,11 @@ nv.models.multiBarWithBrushChart = function() {
|
|
|
return chart;
|
|
return chart;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ chart.hideSelection = function() {
|
|
|
|
|
+ selectionHidden = true;
|
|
|
|
|
+ return chart;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
chart.onSelectRange = function(_) {
|
|
chart.onSelectRange = function(_) {
|
|
|
if (!arguments.length) return onSelectRange;
|
|
if (!arguments.length) return onSelectRange;
|
|
|
onSelectRange = _;
|
|
onSelectRange = _;
|