var min = scale.min;
var max = scale.max;
var options = scale.options;
- var capacity = scale.getLabelCapacity(min);
+ var capacity = scale._getLabelCapacity(min);
var source = options.ticks.source;
var timestamps;
// determineUnitForFormatting relies on the number of ticks so we don't use it when
// autoSkip is enabled because we don't yet know what the final number of ticks will be
me._unit = timeOpts.unit || (tickOpts.autoSkip
- ? determineUnitForAutoTicks(timeOpts.minUnit, me.min, me.max, me.getLabelCapacity(min))
+ ? determineUnitForAutoTicks(timeOpts.minUnit, me.min, me.max, me._getLabelCapacity(min))
: determineUnitForFormatting(me, ticks.length, timeOpts.minUnit, me.min, me.max));
me._majorUnit = !tickOpts.major.enabled || me._unit === 'year' ? undefined
: determineMajorUnit(me._unit);
* Function to format an individual tick mark
* @private
*/
- tickFormatFunction: function(time, index, ticks, format) {
+ _tickFormatFunction: function(time, index, ticks, format) {
var me = this;
var adapter = me._adapter;
var options = me.options;
for (i = 0, ilen = ticks.length; i < ilen; ++i) {
tick = ticks[i];
- tick.label = this.tickFormatFunction(tick.value, i, ticks);
+ tick.label = this._tickFormatFunction(tick.value, i, ticks);
}
},
/**
* @private
*/
- getPixelForOffset: function(time) {
+ _getPixelForOffset: function(time) {
var me = this;
var offsets = me._offsets;
var pos = interpolate(me._table, 'time', time, 'pos');
}
if (value !== null) {
- return me.getPixelForOffset(value);
+ return me._getPixelForOffset(value);
}
},
getPixelForTick: function(index) {
var ticks = this.getTicks();
return index >= 0 && index < ticks.length ?
- this.getPixelForOffset(ticks[index].value) :
+ this._getPixelForOffset(ticks[index].value) :
null;
},
},
/**
- * Crude approximation of what the label width might be
* @private
*/
- getLabelWidth: function(label) {
- return this._getLabelSize(label).w;
- },
-
- /**
- * @private
- */
- getLabelCapacity: function(exampleTime) {
+ _getLabelCapacity: function(exampleTime) {
var me = this;
var timeOpts = me.options.time;
var displayFormats = timeOpts.displayFormats;
// pick the longest format (milliseconds) for guestimation
var format = displayFormats[timeOpts.unit] || displayFormats.millisecond;
- var exampleLabel = me.tickFormatFunction(exampleTime, 0, ticksFromTimestamps(me, [exampleTime], me._majorUnit), format);
+ var exampleLabel = me._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(me, [exampleTime], me._majorUnit), format);
var size = me._getLabelSize(exampleLabel);
var capacity = Math.floor(me.isHorizontal() ? me.width / size.w : me.height / size.h);