Browse Source

Fix tick format for timeseries

pull/486/head
Masayuki Tanaka 11 years ago
parent
commit
1669ec46e0
  1. 4
      c3.js
  2. 2
      c3.min.js
  3. 4
      src/axis.js

4
c3.js

@ -3916,7 +3916,7 @@
var $$ = this, config = $$.config,
format = $$.isTimeSeries() ? $$.defaultAxisTimeFormat : $$.isCategorized() ? $$.categoryName : function (v) { return v < 0 ? v.toFixed(0) : v; };
if (config[__axis_x_tick_format]) {
if (config[__axis_x_tick_format]) {
if (isFunction(config[__axis_x_tick_format])) {
format = config[__axis_x_tick_format];
} else if ($$.isTimeSeries()) {
format = function (date) {
@ -3924,7 +3924,7 @@
};
}
}
return function (v) { return format.call($$, v); };
return isFunction(format) ? function (v) { return format.call($$, v); } : format;
};
c3_chart_internal_fn.getAxisLabelOptionByAxisId = function (axisId) {
var $$ = this, config = $$.config, option;

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

4
src/axis.js

@ -63,7 +63,7 @@ c3_chart_internal_fn.getXAxisTickFormat = function () {
var $$ = this, config = $$.config,
format = $$.isTimeSeries() ? $$.defaultAxisTimeFormat : $$.isCategorized() ? $$.categoryName : function (v) { return v < 0 ? v.toFixed(0) : v; };
if (config[__axis_x_tick_format]) {
if (config[__axis_x_tick_format]) {
if (isFunction(config[__axis_x_tick_format])) {
format = config[__axis_x_tick_format];
} else if ($$.isTimeSeries()) {
format = function (date) {
@ -71,7 +71,7 @@ c3_chart_internal_fn.getXAxisTickFormat = function () {
};
}
}
return function (v) { return format.call($$, v); };
return isFunction(format) ? function (v) { return format.call($$, v); } : format;
};
c3_chart_internal_fn.getAxisLabelOptionByAxisId = function (axisId) {
var $$ = this, config = $$.config, option;

Loading…
Cancel
Save