|
|
@ -76,12 +76,13 @@ Axis.prototype.updateXAxisTickValues = function updateXAxisTickValues(targets, a |
|
|
|
} |
|
|
|
} |
|
|
|
return tickValues; |
|
|
|
return tickValues; |
|
|
|
}; |
|
|
|
}; |
|
|
|
Axis.prototype.getYAxis = function getYAxis(scale, orient, tickFormat, tickValues, withOuterTick, withoutTransition, withoutRotateTickText) { |
|
|
|
Axis.prototype.getYAxis = function getYAxis(scale, orient, tickFormat, tickValues, withOuterTick, withoutTransition, withoutRotateTickText, tickCount) { |
|
|
|
var $$ = this.owner, config = $$.config, |
|
|
|
var $$ = this.owner, config = $$.config, |
|
|
|
axisParams = { |
|
|
|
axisParams = { |
|
|
|
withOuterTick: withOuterTick, |
|
|
|
withOuterTick: withOuterTick, |
|
|
|
withoutTransition: withoutTransition, |
|
|
|
withoutTransition: withoutTransition, |
|
|
|
tickTextRotate: withoutRotateTickText ? 0 : config.axis_y_tick_rotate |
|
|
|
tickTextRotate: withoutRotateTickText ? 0 : config.axis_y_tick_rotate, |
|
|
|
|
|
|
|
tickCount: tickCount |
|
|
|
}, |
|
|
|
}, |
|
|
|
axis = c3_axis($$.d3, axisParams).scale(scale).orient(orient).tickFormat(tickFormat); |
|
|
|
axis = c3_axis($$.d3, axisParams).scale(scale).orient(orient).tickFormat(tickFormat); |
|
|
|
if ($$.isTimeSeriesY()) { |
|
|
|
if ($$.isTimeSeriesY()) { |
|
|
@ -275,10 +276,10 @@ Axis.prototype.getMaxTickWidth = function getMaxTickWidth(id, withoutRecompute) |
|
|
|
targetsToShow = $$.filterTargetsToShow($$.data.targets); |
|
|
|
targetsToShow = $$.filterTargetsToShow($$.data.targets); |
|
|
|
if (id === 'y') { |
|
|
|
if (id === 'y') { |
|
|
|
scale = $$.y.copy().domain($$.getYDomain(targetsToShow, 'y')); |
|
|
|
scale = $$.y.copy().domain($$.getYDomain(targetsToShow, 'y')); |
|
|
|
axis = this.getYAxis(scale, $$.yOrient, config.axis_y_tick_format, $$.yAxisTickValues, false, true, true); |
|
|
|
axis = this.getYAxis(scale, $$.yOrient, config.axis_y_tick_format, $$.yAxisTickValues, false, true, true, config.axis_y_tick_count); |
|
|
|
} else if (id === 'y2') { |
|
|
|
} else if (id === 'y2') { |
|
|
|
scale = $$.y2.copy().domain($$.getYDomain(targetsToShow, 'y2')); |
|
|
|
scale = $$.y2.copy().domain($$.getYDomain(targetsToShow, 'y2')); |
|
|
|
axis = this.getYAxis(scale, $$.y2Orient, config.axis_y2_tick_format, $$.y2AxisTickValues, false, true, true); |
|
|
|
axis = this.getYAxis(scale, $$.y2Orient, config.axis_y2_tick_format, $$.y2AxisTickValues, false, true, true, config.axis_y2_tick_count); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
scale = $$.x.copy().domain($$.getXDomain(targetsToShow)); |
|
|
|
scale = $$.x.copy().domain($$.getXDomain(targetsToShow)); |
|
|
|
axis = this.getXAxis(scale, $$.xOrient, $$.xAxisTickFormat, $$.xAxisTickValues, false, true, true); |
|
|
|
axis = this.getXAxis(scale, $$.xOrient, $$.xAxisTickFormat, $$.xAxisTickValues, false, true, true); |
|
|
|