@@ -37,11 +37,12 @@ function drawAxes(props: IDrawAxesProps): void {
3737 let xAlignmentText = '' ;
3838 const [ first , last ] = attributesRef . current . xScale . domain ( ) ;
3939
40+ const alignmentKey = _ . capitalize ( getKeyByAlignment ( alignmentConfig ) ) ;
41+
4042 switch ( alignmentConfig ?. type ) {
4143 case AlignmentOptionsEnum . EPOCH :
4244 {
43- xAlignmentText =
44- _ . capitalize ( getKeyByAlignment ( alignmentConfig ) ) + 's' ;
45+ xAlignmentText = alignmentKey ? alignmentKey + 's' : '' ;
4546
4647 let ticksCount = Math . floor ( plotBoxRef . current . width / 50 ) ;
4748 ticksCount = ticksCount > 1 ? ticksCount - 1 : 1 ;
@@ -52,7 +53,7 @@ function drawAxes(props: IDrawAxesProps): void {
5253 break ;
5354 case AlignmentOptionsEnum . RELATIVE_TIME :
5455 {
55- xAlignmentText = _ . capitalize ( getKeyByAlignment ( alignmentConfig ) ) ;
56+ xAlignmentText = alignmentKey || '' ;
5657
5758 let ticksCount = Math . floor ( plotBoxRef . current . width / 85 ) ;
5859 ticksCount = ticksCount > 1 ? ticksCount - 1 : 1 ;
@@ -119,7 +120,7 @@ function drawAxes(props: IDrawAxesProps): void {
119120 break ;
120121 case AlignmentOptionsEnum . ABSOLUTE_TIME :
121122 {
122- xAlignmentText = _ . capitalize ( getKeyByAlignment ( alignmentConfig ) ) ;
123+ xAlignmentText = alignmentKey || '' ;
123124
124125 let ticksCount = Math . floor ( plotBoxRef . current . width / 120 ) ;
125126 ticksCount = ticksCount > 1 ? ticksCount - 1 : 1 ;
@@ -144,15 +145,15 @@ function drawAxes(props: IDrawAxesProps): void {
144145 break ;
145146 case AlignmentOptionsEnum . CUSTOM_METRIC :
146147 {
147- xAlignmentText = alignmentConfig ?. metric ;
148+ xAlignmentText = alignmentConfig ?. metric || '' ;
148149
149150 let ticksCount = Math . floor ( plotBoxRef . current . width / 120 ) ;
150151 ticksCount = ticksCount > 1 ? ticksCount - 1 : 1 ;
151152 xAxis . ticks ( ticksCount ) ;
152153 }
153154 break ;
154155 default : {
155- xAlignmentText = _ . capitalize ( getKeyByAlignment ( alignmentConfig ) ) + 's' ;
156+ xAlignmentText = alignmentKey ? alignmentKey + 's' : 'Steps ';
156157
157158 let ticksCount = Math . floor ( plotBoxRef . current . width / 90 ) ;
158159 ticksCount = ticksCount > 1 ? ticksCount - 1 : 1 ;
0 commit comments