From dbb9d9eb1f85d420b810fe674837ab50bc9ef2ba Mon Sep 17 00:00:00 2001 From: Joao Morais Date: Tue, 15 May 2018 10:44:25 -0700 Subject: [PATCH] Apply code review suggestions --- spec/axis-spec.js | 8 +++----- src/axis.js | 4 ++-- src/config.js | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/spec/axis-spec.js b/spec/axis-spec.js index c1bdea1f6..49a60ef3f 100644 --- a/spec/axis-spec.js +++ b/spec/axis-spec.js @@ -542,13 +542,11 @@ describe('c3 chart axis', function () { }); }); - describe('with multiline.max', function() { + describe('with multilineMax', function() { beforeAll(function() { args.axis.x.tick = { - multiline: { - enabled: true, - max: 2, - } + multiline: true, + multilineMax: 2, }; }); diff --git a/src/axis.js b/src/axis.js index 4469155b5..f3e0f0119 100644 --- a/src/axis.js +++ b/src/axis.js @@ -446,8 +446,8 @@ c3_axis_fn.getXAxis = function getXAxis(scale, orient, tickFormat, tickValues, w axisParams = { isCategory: $$.isCategorized(), withOuterTick: withOuterTick, - tickMultiline: typeof config.axis_x_tick_multiline === 'object' ? Boolean(config.axis_x_tick_multiline.enabled) : config.axis_x_tick_multiline, - tickMultilineMax: typeof config.axis_x_tick_multiline === 'object' ? Number(config.axis_x_tick_multiline.max) : 0, + tickMultiline: config.axis_x_tick_multiline, + tickMultilineMax: config.axis_x_tick_multiline ? Number(config.axis_x_tick_multilineMax) : 0, tickWidth: config.axis_x_tick_width, tickTextRotate: withoutRotateTickText ? 0 : config.axis_x_tick_rotate, withoutTransition: withoutTransition, diff --git a/src/config.js b/src/config.js index e9c6652d7..ca8f0576f 100644 --- a/src/config.js +++ b/src/config.js @@ -107,7 +107,7 @@ c3_chart_internal_fn.getDefaultConfig = function () { axis_x_tick_rotate: 0, axis_x_tick_outer: true, axis_x_tick_multiline: true, - axis_x_tick_multiline_max: 0, + axis_x_tick_multilineMax: 0, axis_x_tick_width: null, axis_x_max: undefined, axis_x_min: undefined,