Browse Source

Fix axis.x.min and axis.x.max when 0 - #457

pull/529/head
Masayuki Tanaka 10 years ago
parent
commit
9940714460
  1. 4
      c3.js
  2. 2
      c3.min.js
  3. 4
      src/domain.js

4
c3.js

@ -1279,13 +1279,13 @@
}; };
c3_chart_internal_fn.getXDomainMin = function (targets) { c3_chart_internal_fn.getXDomainMin = function (targets) {
var $$ = this, config = $$.config; var $$ = this, config = $$.config;
return config.axis_x_min ? return isDefined(config.axis_x_min) ?
($$.isTimeSeries() ? this.parseDate(config.axis_x_min) : config.axis_x_min) : ($$.isTimeSeries() ? this.parseDate(config.axis_x_min) : config.axis_x_min) :
$$.d3.min(targets, function (t) { return $$.d3.min(t.values, function (v) { return v.x; }); }); $$.d3.min(targets, function (t) { return $$.d3.min(t.values, function (v) { return v.x; }); });
}; };
c3_chart_internal_fn.getXDomainMax = function (targets) { c3_chart_internal_fn.getXDomainMax = function (targets) {
var $$ = this, config = $$.config; var $$ = this, config = $$.config;
return config.axis_x_max ? return isDefined(config.axis_x_max) ?
($$.isTimeSeries() ? this.parseDate(config.axis_x_max) : config.axis_x_max) : ($$.isTimeSeries() ? this.parseDate(config.axis_x_max) : config.axis_x_max) :
$$.d3.max(targets, function (t) { return $$.d3.max(t.values, function (v) { return v.x; }); }); $$.d3.max(targets, function (t) { return $$.d3.max(t.values, function (v) { return v.x; }); });
}; };

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

4
src/domain.js

@ -125,13 +125,13 @@ c3_chart_internal_fn.getYDomain = function (targets, axisId) {
}; };
c3_chart_internal_fn.getXDomainMin = function (targets) { c3_chart_internal_fn.getXDomainMin = function (targets) {
var $$ = this, config = $$.config; var $$ = this, config = $$.config;
return config.axis_x_min ? return isDefined(config.axis_x_min) ?
($$.isTimeSeries() ? this.parseDate(config.axis_x_min) : config.axis_x_min) : ($$.isTimeSeries() ? this.parseDate(config.axis_x_min) : config.axis_x_min) :
$$.d3.min(targets, function (t) { return $$.d3.min(t.values, function (v) { return v.x; }); }); $$.d3.min(targets, function (t) { return $$.d3.min(t.values, function (v) { return v.x; }); });
}; };
c3_chart_internal_fn.getXDomainMax = function (targets) { c3_chart_internal_fn.getXDomainMax = function (targets) {
var $$ = this, config = $$.config; var $$ = this, config = $$.config;
return config.axis_x_max ? return isDefined(config.axis_x_max) ?
($$.isTimeSeries() ? this.parseDate(config.axis_x_max) : config.axis_x_max) : ($$.isTimeSeries() ? this.parseDate(config.axis_x_max) : config.axis_x_max) :
$$.d3.max(targets, function (t) { return $$.d3.max(t.values, function (v) { return v.x; }); }); $$.d3.max(targets, function (t) { return $$.d3.max(t.values, function (v) { return v.x; }); });
}; };

Loading…
Cancel
Save