Commit 140cf726 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix padding when scatter chart - #457

parent 99407144
...@@ -945,8 +945,8 @@ ...@@ -945,8 +945,8 @@
axis_x_tick_values: null, axis_x_tick_values: null,
axis_x_tick_rotate: undefined, axis_x_tick_rotate: undefined,
axis_x_tick_outer: true, axis_x_tick_outer: true,
axis_x_max: null, axis_x_max: undefined,
axis_x_min: null, axis_x_min: undefined,
axis_x_padding: {}, axis_x_padding: {},
axis_x_height: undefined, axis_x_height: undefined,
axis_x_default: undefined, axis_x_default: undefined,
...@@ -1471,12 +1471,11 @@ ...@@ -1471,12 +1471,11 @@
return maxTarget; return maxTarget;
}; };
c3_chart_internal_fn.getEdgeX = function (targets) { c3_chart_internal_fn.getEdgeX = function (targets) {
var target = this.getMaxDataCountTarget(targets), firstData, lastData; var $$ = this;
if (!target) { return !targets.length ? [0, 0] : [
return [0, 0]; $$.d3.min(targets, function (t) { return t.values[0].x; }),
} $$.d3.max(targets, function (t) { return t.values[t.values.length - 1].x; })
firstData = target.values[0], lastData = target.values[target.values.length - 1]; ];
return [firstData.x, lastData.x];
}; };
c3_chart_internal_fn.mapToIds = function (targets) { c3_chart_internal_fn.mapToIds = function (targets) {
return targets.map(function (d) { return d.id; }); return targets.map(function (d) { return d.id; });
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -87,8 +87,8 @@ c3_chart_internal_fn.getDefaultConfig = function () { ...@@ -87,8 +87,8 @@ c3_chart_internal_fn.getDefaultConfig = function () {
axis_x_tick_values: null, axis_x_tick_values: null,
axis_x_tick_rotate: undefined, axis_x_tick_rotate: undefined,
axis_x_tick_outer: true, axis_x_tick_outer: true,
axis_x_max: null, axis_x_max: undefined,
axis_x_min: null, axis_x_min: undefined,
axis_x_padding: {}, axis_x_padding: {},
axis_x_height: undefined, axis_x_height: undefined,
axis_x_default: undefined, axis_x_default: undefined,
......
...@@ -123,12 +123,11 @@ c3_chart_internal_fn.getMaxDataCountTarget = function (targets) { ...@@ -123,12 +123,11 @@ c3_chart_internal_fn.getMaxDataCountTarget = function (targets) {
return maxTarget; return maxTarget;
}; };
c3_chart_internal_fn.getEdgeX = function (targets) { c3_chart_internal_fn.getEdgeX = function (targets) {
var target = this.getMaxDataCountTarget(targets), firstData, lastData; var $$ = this;
if (!target) { return !targets.length ? [0, 0] : [
return [0, 0]; $$.d3.min(targets, function (t) { return t.values[0].x; }),
} $$.d3.max(targets, function (t) { return t.values[t.values.length - 1].x; })
firstData = target.values[0], lastData = target.values[target.values.length - 1]; ];
return [firstData.x, lastData.x];
}; };
c3_chart_internal_fn.mapToIds = function (targets) { c3_chart_internal_fn.mapToIds = function (targets) {
return targets.map(function (d) { return d.id; }); return targets.map(function (d) { return d.id; });
......
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