Commit 57dbe886 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix tick text when flow API called - #772

parent 8b770dbc
...@@ -427,7 +427,9 @@ ...@@ -427,7 +427,9 @@
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, withDimension; var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis,
withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend,
withEventRect, withDimension, withUpdateXAxis;
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;
...@@ -443,6 +445,7 @@ ...@@ -443,6 +445,7 @@
withUpdateXDomain = getOption(options, "withUpdateXDomain", false); withUpdateXDomain = getOption(options, "withUpdateXDomain", false);
withUpdateOrgXDomain = getOption(options, "withUpdateOrgXDomain", false); withUpdateOrgXDomain = getOption(options, "withUpdateOrgXDomain", false);
withTrimXDomain = getOption(options, "withTrimXDomain", true); withTrimXDomain = getOption(options, "withTrimXDomain", true);
withUpdateXAxis = getOption(options, "withUpdateXAxis", withUpdateXDomain);
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); withDimension = getOption(options, "withDimension", true);
...@@ -506,7 +509,7 @@ ...@@ -506,7 +509,7 @@
$$.updateAxisLabels(withTransition); $$.updateAxisLabels(withTransition);
// show/hide if manual culling needed // show/hide if manual culling needed
if (withUpdateXDomain && targetsToShow.length) { if ((withUpdateXDomain || withUpdateXAxis) && targetsToShow.length) {
if (config.axis_x_tick_culling && tickValues) { if (config.axis_x_tick_culling && tickValues) {
for (i = 1; i < tickValues.length; i++) { for (i = 1; i < tickValues.length; i++) {
if (tickValues.length / i < config.axis_x_tick_culling_max) { if (tickValues.length / i < config.axis_x_tick_culling_max) {
...@@ -5943,7 +5946,8 @@ ...@@ -5943,7 +5946,8 @@
}, },
withLegend: true, withLegend: true,
withTransition: orgDataCount > 1, withTransition: orgDataCount > 1,
withTrimXDomain: false withTrimXDomain: false,
withUpdateXAxis: true,
}); });
}; };
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -136,7 +136,8 @@ c3_chart_fn.flow = function (args) { ...@@ -136,7 +136,8 @@ c3_chart_fn.flow = function (args) {
}, },
withLegend: true, withLegend: true,
withTransition: orgDataCount > 1, withTransition: orgDataCount > 1,
withTrimXDomain: false withTrimXDomain: false,
withUpdateXAxis: true,
}); });
}; };
......
...@@ -422,7 +422,9 @@ c3_chart_internal_fn.updateTargets = function (targets) { ...@@ -422,7 +422,9 @@ 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, withDimension; var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis,
withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend,
withEventRect, withDimension, withUpdateXAxis;
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;
...@@ -438,6 +440,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) { ...@@ -438,6 +440,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
withUpdateXDomain = getOption(options, "withUpdateXDomain", false); withUpdateXDomain = getOption(options, "withUpdateXDomain", false);
withUpdateOrgXDomain = getOption(options, "withUpdateOrgXDomain", false); withUpdateOrgXDomain = getOption(options, "withUpdateOrgXDomain", false);
withTrimXDomain = getOption(options, "withTrimXDomain", true); withTrimXDomain = getOption(options, "withTrimXDomain", true);
withUpdateXAxis = getOption(options, "withUpdateXAxis", withUpdateXDomain);
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); withDimension = getOption(options, "withDimension", true);
...@@ -501,7 +504,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) { ...@@ -501,7 +504,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
$$.updateAxisLabels(withTransition); $$.updateAxisLabels(withTransition);
// show/hide if manual culling needed // show/hide if manual culling needed
if (withUpdateXDomain && targetsToShow.length) { if ((withUpdateXDomain || withUpdateXAxis) && targetsToShow.length) {
if (config.axis_x_tick_culling && tickValues) { if (config.axis_x_tick_culling && tickValues) {
for (i = 1; i < tickValues.length; i++) { for (i = 1; i < tickValues.length; i++) {
if (tickValues.length / i < config.axis_x_tick_culling_max) { if (tickValues.length / i < config.axis_x_tick_culling_max) {
......
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