UNPKG

quoslibero

Version:

FusionCharts JavaScript charting framework

1 lines 1.82 kB
import{timeMillisecond,timeSecond,timeMinute,timeHour,timeDay,timeWeek,timeMonth,timeYear}from'../time-intervals';import ScaleCalendarBin from'./calendar-bin';import{copyScale}from'../../../fc-core/src/axis/scales/continuous';class ScaleTimeBin extends ScaleCalendarBin{constructor(){super(timeYear,timeMonth,timeWeek,timeDay,timeHour,timeMinute,timeSecond,timeMillisecond),this.formatters={millisecond:{major:this._localeConverter.formatter('%I:%M:%S.%L %p'),minor:this._localeConverter.formatter('%L ms'),context:this._localeConverter.formatter('%b %d, %Y, %I:%M:%S.%L %p')},second:{major:this._localeConverter.formatter('%I:%M:%S %p'),minor:this._localeConverter.formatter('%S s'),context:this._localeConverter.formatter('%b %d, %Y, %I:%M:%S %p')},minute:{major:this._localeConverter.formatter('%I:%M %p'),minor:this._localeConverter.formatter('%M m'),context:this._localeConverter.formatter('%b %d, %Y, %I:%M %p')},hour:{major:this._localeConverter.formatter('%I %p'),minor:this._localeConverter.formatter('%I %p'),context:this._localeConverter.formatter('%b %d, %Y, %I %p')},day:{major:this._localeConverter.formatter('%b %d'),minor:this._localeConverter.formatter('%d'),context:this._localeConverter.formatter('%b %d, %Y')},month:{major:this._localeConverter.formatter('%b'),minor:this._localeConverter.formatter('%b'),context:this._localeConverter.formatter('%b %Y')},year:{major:this._localeConverter.formatter('%Y'),context:this._localeConverter.formatter('%Y')}},this.setDomain([new Date(2e3,0,1),new Date(2e3,0,2)])}getType(){return''}tickFormat(a){return a?b=>this._localeConverter.formatter(a).format(b):(a,b,c)=>this._timeFormat[b]?this._localeConverter.formatter(this._timeFormat[b]).format(a):this.formatters[b][c].format(a)}copy(){return copyScale(this,new ScaleTimeBin)}}export default ScaleTimeBin;