|
|
@ -657,9 +657,6 @@ |
|
|
|
c3_chart_internal_fn.isTimeSeries = function () { |
|
|
|
c3_chart_internal_fn.isTimeSeries = function () { |
|
|
|
return this.config.axis_x_type === 'timeseries'; |
|
|
|
return this.config.axis_x_type === 'timeseries'; |
|
|
|
}; |
|
|
|
}; |
|
|
|
c3_chart_internal_fn.isYaxisTimeSeries = function () { |
|
|
|
|
|
|
|
return this.config.axis_y_type === 'timeseries'; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
c3_chart_internal_fn.isCategorized = function () { |
|
|
|
c3_chart_internal_fn.isCategorized = function () { |
|
|
|
return this.config.axis_x_type.indexOf('categor') >= 0; |
|
|
|
return this.config.axis_x_type.indexOf('categor') >= 0; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -668,6 +665,10 @@ |
|
|
|
return !$$.isTimeSeries() && (config.data_x || notEmpty(config.data_xs)); |
|
|
|
return !$$.isTimeSeries() && (config.data_x || notEmpty(config.data_xs)); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
c3_chart_internal_fn.isTimeSeriesY = function () { |
|
|
|
|
|
|
|
return this.config.axis_y_type === 'timeseries'; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
c3_chart_internal_fn.getTranslate = function (target) { |
|
|
|
c3_chart_internal_fn.getTranslate = function (target) { |
|
|
|
var $$ = this, config = $$.config, x, y; |
|
|
|
var $$ = this, config = $$.config, x, y; |
|
|
|
if (target === 'main') { |
|
|
|
if (target === 'main') { |
|
|
@ -1008,10 +1009,8 @@ |
|
|
|
axis_y_tick_outer: true, |
|
|
|
axis_y_tick_outer: true, |
|
|
|
axis_y_tick_values: null, |
|
|
|
axis_y_tick_values: null, |
|
|
|
axis_y_tick_count: undefined, |
|
|
|
axis_y_tick_count: undefined, |
|
|
|
axis_y_ticks: {}, |
|
|
|
axis_y_tick_time_value: undefined, |
|
|
|
axis_y_ticks_time: {}, |
|
|
|
axis_y_tick_time_interval: undefined, |
|
|
|
axis_y_ticks_time_value: undefined, |
|
|
|
|
|
|
|
axis_y_ticks_time_interval: undefined, |
|
|
|
|
|
|
|
axis_y_padding: {}, |
|
|
|
axis_y_padding: {}, |
|
|
|
axis_y_default: undefined, |
|
|
|
axis_y_default: undefined, |
|
|
|
axis_y2_show: false, |
|
|
|
axis_y2_show: false, |
|
|
@ -1164,7 +1163,7 @@ |
|
|
|
return scale; |
|
|
|
return scale; |
|
|
|
}; |
|
|
|
}; |
|
|
|
c3_chart_internal_fn.getY = function (min, max, domain) { |
|
|
|
c3_chart_internal_fn.getY = function (min, max, domain) { |
|
|
|
var scale = this.getScale(min, max, this.isYaxisTimeSeries()); |
|
|
|
var scale = this.getScale(min, max, this.isTimeSeriesY()); |
|
|
|
if (domain) { scale.domain(domain); } |
|
|
|
if (domain) { scale.domain(domain); } |
|
|
|
return scale; |
|
|
|
return scale; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -3989,14 +3988,14 @@ |
|
|
|
return axis; |
|
|
|
return axis; |
|
|
|
}; |
|
|
|
}; |
|
|
|
c3_chart_internal_fn.getYAxis = function (scale, orient, tickFormat, tickValues, withOuterTick) { |
|
|
|
c3_chart_internal_fn.getYAxis = function (scale, orient, tickFormat, tickValues, withOuterTick) { |
|
|
|
var axisParams = {withOuterTick: withOuterTick}; |
|
|
|
var axisParams = {withOuterTick: withOuterTick}, |
|
|
|
if (this.isYaxisTimeSeries()) { |
|
|
|
axis = c3_axis(this.d3, axisParams).scale(scale).orient(orient).tickFormat(tickFormat); |
|
|
|
var timeValue = this.config.axis_y_ticks_time_value; |
|
|
|
if (this.isTimeSeriesY()) { |
|
|
|
var timeInterval = this.config.axis_y_ticks_time_interval; |
|
|
|
axis.ticks(this.d3.time[this.config.axis_y_tick_time_value], this.config.axis_y_tick_time_interval); |
|
|
|
return c3_axis(this.d3, axisParams).scale(scale).orient(orient).tickFormat(tickFormat).ticks(this.d3.time[timeValue], timeInterval); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return c3_axis(this.d3, axisParams).scale(scale).orient(orient).tickFormat(tickFormat).tickValues(tickValues); |
|
|
|
axis.tickValues(tickValues); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return axis; |
|
|
|
}; |
|
|
|
}; |
|
|
|
c3_chart_internal_fn.getAxisId = function (id) { |
|
|
|
c3_chart_internal_fn.getAxisId = function (id) { |
|
|
|
var config = this.config; |
|
|
|
var config = this.config; |
|
|
|