Browse Source

Make y axis width size configurable

pull/1780/head
Jonathan Hurter 9 years ago
parent
commit
1b50bc0b8f
  1. 3
      src/config.js
  2. 8
      src/size.js

3
src/config.js

@ -111,6 +111,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
axis_x_height: undefined,
axis_x_extent: undefined,
axis_x_label: {},
axis_y_width: undefined,
axis_y_show: true,
axis_y_type: undefined,
axis_y_max: undefined,
@ -121,7 +122,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
axis_y_label: {},
axis_y_tick_format: undefined,
axis_y_tick_outer: true,
axis_y_tick_values: null,
axis_y_tick_values: null,
axis_y_tick_rotate: 0,
axis_y_tick_count: undefined,
axis_y_tick_time_value: undefined,

8
src/size.js

@ -88,8 +88,12 @@ c3_chart_internal_fn.getSvgLeft = function (withoutRecompute) {
c3_chart_internal_fn.getAxisWidthByAxisId = function (id, withoutRecompute) {
var $$ = this, position = $$.axis.getLabelPositionById(id);
return $$.axis.getMaxTickWidth(id, withoutRecompute) + (position.isInner ? 20 : 40);
var $$ = this, position = $$.axis.getLabelPositionById(id), config = $$.config;
if(config.axis_y_width !== undefined) {
return config.axis_y_width + (position.isInner ? 20 : 40);
} else {
return $$.axis.getMaxTickWidth(id, withoutRecompute) + (position.isInner ? 20 : 40);
}
};
c3_chart_internal_fn.getHorizontalAxisHeight = function (axisId) {
var $$ = this, config = $$.config, h = 30;

Loading…
Cancel
Save