|
|
@ -4266,7 +4266,7 @@ c3_chart_fn.zoom = function (domain) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if ($$.config.subchart_show) { |
|
|
|
if ($$.config.subchart_show) { |
|
|
|
$$.brush.selectionAsValue(domain); |
|
|
|
$$.brush.selectionAsValue(domain, true); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$$.updateXDomain(null, true, false, false, domain); |
|
|
|
$$.updateXDomain(null, true, false, false, domain); |
|
|
|
$$.redraw({ withY: $$.config.zoom_rescale, withSubchart: false }); |
|
|
|
$$.redraw({ withY: $$.config.zoom_rescale, withSubchart: false }); |
|
|
@ -8307,12 +8307,16 @@ c3_chart_internal_fn.initBrush = function (scale) { |
|
|
|
$$.brush.selection = function () { |
|
|
|
$$.brush.selection = function () { |
|
|
|
return d3.brushSelection($$.context.select('.' + CLASS.brush).node()); |
|
|
|
return d3.brushSelection($$.context.select('.' + CLASS.brush).node()); |
|
|
|
}; |
|
|
|
}; |
|
|
|
$$.brush.selectionAsValue = function (selectionAsValue) { |
|
|
|
$$.brush.selectionAsValue = function (selectionAsValue, withTransition) { |
|
|
|
var selection; |
|
|
|
var selection, brush; |
|
|
|
if (selectionAsValue) { |
|
|
|
if (selectionAsValue) { |
|
|
|
if ($$.context) { |
|
|
|
if ($$.context) { |
|
|
|
selection = [this.scale(selectionAsValue[0]), this.scale(selectionAsValue[1])]; |
|
|
|
selection = [this.scale(selectionAsValue[0]), this.scale(selectionAsValue[1])]; |
|
|
|
$$.brush.move($$.context.select('.' + CLASS.brush).transition(), selection); |
|
|
|
brush = $$.context.select('.' + CLASS.brush); |
|
|
|
|
|
|
|
if (withTransition) { |
|
|
|
|
|
|
|
brush = brush.transition(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$$.brush.move(brush, selection); |
|
|
|
} |
|
|
|
} |
|
|
|
return []; |
|
|
|
return []; |
|
|
|
} |
|
|
|
} |
|
|
|