Browse Source

Merge pull request #1230 from laurence-hudson-tessella/fix-tick-bug

Fix #1229 - Incorrect x tick positioning
pull/1220/merge
Masayuki Tanaka 10 years ago
parent
commit
f78a085603
  1. 3
      src/data.js

3
src/data.js

@ -171,7 +171,8 @@ c3_chart_internal_fn.filterTargetsToShow = function (targets) {
c3_chart_internal_fn.mapTargetsToUniqueXs = function (targets) {
var $$ = this;
var xs = $$.d3.set($$.d3.merge(targets.map(function (t) { return t.values.map(function (v) { return +v.x; }); }))).values();
return $$.isTimeSeries() ? xs.map(function (x) { return new Date(+x); }) : xs.map(function (x) { return +x; });
xs = $$.isTimeSeries() ? xs.map(function (x) { return new Date(+x); }) : xs.map(function (x) { return +x; });
return xs.sort(function (a, b) { return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; });
};
c3_chart_internal_fn.addHiddenTargetIds = function (targetIds) {
this.hiddenTargetIds = this.hiddenTargetIds.concat(targetIds);

Loading…
Cancel
Save