File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed
Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -676,6 +676,7 @@ export interface Axis {
676676 tickFormat ( ) : string ;
677677 tickFormat ( _ : string ) : this;
678678 tickFormat_exists ( ) : boolean ;
679+ tickFormat_reset ( ) : void ;
679680 tickLength ( ) : number ;
680681 tickLength ( _ : number ) : this;
681682 tickLength_exists ( ) : boolean ;
Original file line number Diff line number Diff line change @@ -42,22 +42,33 @@ export class ReactTimeline extends ReactAxisGantt {
4242 highDateStr = "" + n [ 2 ] ;
4343 }
4444 } ) ;
45+
46+ const axisTickFormat = this . _axisLabelFormatter
47+ ? this . _axisLabelFormatter
48+ : ( this . tickFormat_exists && this . tickFormat_exists ( ) ? this . tickFormat ( ) : undefined ) ;
49+
4550 this . _topAxis
4651 . type ( "time" )
4752 . timePattern ( this . timePattern ( ) )
4853 . overlapMode ( "none" )
49- . tickFormat ( this . _axisLabelFormatter )
5054 . low ( lowDateStr )
5155 . high ( highDateStr )
5256 ;
5357 this . _bottomAxis
5458 . type ( "time" )
5559 . timePattern ( this . timePattern ( ) )
5660 . overlapMode ( "none" )
57- . tickFormat ( this . _axisLabelFormatter )
5861 . low ( lowDateStr )
5962 . high ( highDateStr )
6063 ;
64+
65+ if ( axisTickFormat ) {
66+ this . _topAxis . tickFormat ( axisTickFormat ) ;
67+ this . _bottomAxis . tickFormat ( axisTickFormat ) ;
68+ } else {
69+ this . _topAxis . tickFormat_reset ( ) ;
70+ this . _bottomAxis . tickFormat_reset ( ) ;
71+ }
6172 this . _gantt . _minStart = minTimestamp ;
6273 this . _gantt . _maxEnd = maxTimestamp ;
6374 }
Original file line number Diff line number Diff line change @@ -41,22 +41,33 @@ export class ReactTimelineSeries extends ReactAxisGanttSeries {
4141 highDateStr = "" + n [ 2 ] ;
4242 }
4343 } ) ;
44+
45+ const axisTickFormat = this . _axisLabelFormatter
46+ ? this . _axisLabelFormatter
47+ : ( this . tickFormat_exists && this . tickFormat_exists ( ) ? this . tickFormat ( ) : undefined ) ;
48+
4449 this . _topAxis
4550 . type ( "time" )
4651 . timePattern ( this . timePattern ( ) )
4752 . overlapMode ( "none" )
48- . tickFormat ( this . _axisLabelFormatter )
4953 . low ( lowDateStr )
5054 . high ( highDateStr )
5155 ;
5256 this . _bottomAxis
5357 . type ( "time" )
5458 . timePattern ( this . timePattern ( ) )
5559 . overlapMode ( "none" )
56- . tickFormat ( this . _axisLabelFormatter )
5760 . low ( lowDateStr )
5861 . high ( highDateStr )
5962 ;
63+
64+ if ( axisTickFormat ) {
65+ this . _topAxis . tickFormat ( axisTickFormat ) ;
66+ this . _bottomAxis . tickFormat ( axisTickFormat ) ;
67+ } else {
68+ this . _topAxis . tickFormat_reset ( ) ;
69+ this . _bottomAxis . tickFormat_reset ( ) ;
70+ }
6071 this . _gantt . _minStart = minTimestamp ;
6172 this . _gantt . _maxEnd = maxTimestamp ;
6273 }
You can’t perform that action at this time.
0 commit comments