Commit 1669ec46 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix tick format for timeseries

parent 5ef894aa
......@@ -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;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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;
......
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