Commit de502600 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix bug for zoom.rescale - #738

parent a66beb31
...@@ -427,7 +427,7 @@ ...@@ -427,7 +427,7 @@
c3_chart_internal_fn.redraw = function (options, transitions) { c3_chart_internal_fn.redraw = function (options, transitions) {
var $$ = this, main = $$.main, d3 = $$.d3, config = $$.config; var $$ = this, main = $$.main, d3 = $$.d3, config = $$.config;
var areaIndices = $$.getShapeIndices($$.isAreaType), barIndices = $$.getShapeIndices($$.isBarType), lineIndices = $$.getShapeIndices($$.isLineType); var areaIndices = $$.getShapeIndices($$.isAreaType), barIndices = $$.getShapeIndices($$.isBarType), lineIndices = $$.getShapeIndices($$.isLineType);
var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis, withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend, withEventRect; var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis, withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend, withEventRect, withDimension;
var hideAxis = $$.hasArcType(); var hideAxis = $$.hasArcType();
var drawArea, drawBar, drawLine, xForText, yForText; var drawArea, drawBar, drawLine, xForText, yForText;
var duration, durationForExit, durationForAxis; var duration, durationForExit, durationForAxis;
...@@ -445,6 +445,7 @@ ...@@ -445,6 +445,7 @@
withTrimXDomain = getOption(options, "withTrimXDomain", true); withTrimXDomain = getOption(options, "withTrimXDomain", true);
withLegend = getOption(options, "withLegend", false); withLegend = getOption(options, "withLegend", false);
withEventRect = getOption(options, "withEventRect", true); withEventRect = getOption(options, "withEventRect", true);
withDimension = getOption(options, "withDimension", true);
withTransitionForExit = getOption(options, "withTransitionForExit", withTransition); withTransitionForExit = getOption(options, "withTransitionForExit", withTransition);
withTransitionForAxis = getOption(options, "withTransitionForAxis", withTransition); withTransitionForAxis = getOption(options, "withTransitionForAxis", withTransition);
...@@ -457,7 +458,7 @@ ...@@ -457,7 +458,7 @@
// update legend and transform each g // update legend and transform each g
if (withLegend && config.legend_show) { if (withLegend && config.legend_show) {
$$.updateLegend($$.mapToIds($$.data.targets), options, transitions); $$.updateLegend($$.mapToIds($$.data.targets), options, transitions);
} else if ((!config.axis_rotated && withY) || (config.axis_rotated && withUpdateXDomain)) { } else if (withDimension) {
// need to update dimension (e.g. axis.y.tick.values) because y tick values should change // need to update dimension (e.g. axis.y.tick.values) because y tick values should change
// no need to update axis in it because they will be updated in redraw() // no need to update axis in it because they will be updated in redraw()
$$.updateDimension(true); $$.updateDimension(true);
...@@ -5192,7 +5193,8 @@ ...@@ -5192,7 +5193,8 @@
withTransition: false, withTransition: false,
withY: $$.config.zoom_rescale, withY: $$.config.zoom_rescale,
withSubchart: false, withSubchart: false,
withUpdateXDomain: true withUpdateXDomain: true,
withDimension: false
}); });
$$.config.subchart_onbrush.call($$.api, x.orgDomain()); $$.config.subchart_onbrush.call($$.api, x.orgDomain());
}; };
...@@ -5277,7 +5279,8 @@ ...@@ -5277,7 +5279,8 @@
withTransition: false, withTransition: false,
withY: config.zoom_rescale, withY: config.zoom_rescale,
withSubchart: false, withSubchart: false,
withEventRect: false withEventRect: false,
withDimension: false
}); });
if (d3.event.sourceEvent.type === 'mousemove') { if (d3.event.sourceEvent.type === 'mousemove') {
$$.cancelClick = true; $$.cancelClick = true;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -422,7 +422,7 @@ c3_chart_internal_fn.updateTargets = function (targets) { ...@@ -422,7 +422,7 @@ c3_chart_internal_fn.updateTargets = function (targets) {
c3_chart_internal_fn.redraw = function (options, transitions) { c3_chart_internal_fn.redraw = function (options, transitions) {
var $$ = this, main = $$.main, d3 = $$.d3, config = $$.config; var $$ = this, main = $$.main, d3 = $$.d3, config = $$.config;
var areaIndices = $$.getShapeIndices($$.isAreaType), barIndices = $$.getShapeIndices($$.isBarType), lineIndices = $$.getShapeIndices($$.isLineType); var areaIndices = $$.getShapeIndices($$.isAreaType), barIndices = $$.getShapeIndices($$.isBarType), lineIndices = $$.getShapeIndices($$.isLineType);
var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis, withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend, withEventRect; var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis, withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend, withEventRect, withDimension;
var hideAxis = $$.hasArcType(); var hideAxis = $$.hasArcType();
var drawArea, drawBar, drawLine, xForText, yForText; var drawArea, drawBar, drawLine, xForText, yForText;
var duration, durationForExit, durationForAxis; var duration, durationForExit, durationForAxis;
...@@ -440,6 +440,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) { ...@@ -440,6 +440,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
withTrimXDomain = getOption(options, "withTrimXDomain", true); withTrimXDomain = getOption(options, "withTrimXDomain", true);
withLegend = getOption(options, "withLegend", false); withLegend = getOption(options, "withLegend", false);
withEventRect = getOption(options, "withEventRect", true); withEventRect = getOption(options, "withEventRect", true);
withDimension = getOption(options, "withDimension", true);
withTransitionForExit = getOption(options, "withTransitionForExit", withTransition); withTransitionForExit = getOption(options, "withTransitionForExit", withTransition);
withTransitionForAxis = getOption(options, "withTransitionForAxis", withTransition); withTransitionForAxis = getOption(options, "withTransitionForAxis", withTransition);
...@@ -452,7 +453,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) { ...@@ -452,7 +453,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
// update legend and transform each g // update legend and transform each g
if (withLegend && config.legend_show) { if (withLegend && config.legend_show) {
$$.updateLegend($$.mapToIds($$.data.targets), options, transitions); $$.updateLegend($$.mapToIds($$.data.targets), options, transitions);
} else if ((!config.axis_rotated && withY) || (config.axis_rotated && withUpdateXDomain)) { } else if (withDimension) {
// need to update dimension (e.g. axis.y.tick.values) because y tick values should change // need to update dimension (e.g. axis.y.tick.values) because y tick values should change
// no need to update axis in it because they will be updated in redraw() // no need to update axis in it because they will be updated in redraw()
$$.updateDimension(true); $$.updateDimension(true);
......
...@@ -166,7 +166,8 @@ c3_chart_internal_fn.redrawForBrush = function () { ...@@ -166,7 +166,8 @@ c3_chart_internal_fn.redrawForBrush = function () {
withTransition: false, withTransition: false,
withY: $$.config.zoom_rescale, withY: $$.config.zoom_rescale,
withSubchart: false, withSubchart: false,
withUpdateXDomain: true withUpdateXDomain: true,
withDimension: false
}); });
$$.config.subchart_onbrush.call($$.api, x.orgDomain()); $$.config.subchart_onbrush.call($$.api, x.orgDomain());
}; };
......
...@@ -59,7 +59,8 @@ c3_chart_internal_fn.redrawForZoom = function () { ...@@ -59,7 +59,8 @@ c3_chart_internal_fn.redrawForZoom = function () {
withTransition: false, withTransition: false,
withY: config.zoom_rescale, withY: config.zoom_rescale,
withSubchart: false, withSubchart: false,
withEventRect: false withEventRect: false,
withDimension: false
}); });
if (d3.event.sourceEvent.type === 'mousemove') { if (d3.event.sourceEvent.type === 'mousemove') {
$$.cancelClick = true; $$.cancelClick = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment