@@ -148,19 +148,20 @@ export class Axis extends Component {
148
148
149
149
if ( axisOptions . scaleType === ScaleTypes . TIME ) {
150
150
if ( Tools . getProperty ( options , "timeScale" , "addSpaceOnEdges" ) ) {
151
+ const timeRangeToExtend = Tools . getProperty ( options , "timeScale" , "timeRangeToExtend" )
151
152
const startDate = new Date ( domain [ 0 ] ) ;
152
153
const endDate = new Date ( domain [ 1 ] ) ;
153
- if ( differenceInYears ( endDate , startDate ) > 3 ) {
154
+ if ( differenceInYears ( endDate , startDate ) > timeRangeToExtend ) {
154
155
return [ subYears ( startDate , 1 ) , addYears ( endDate , 1 ) ] ;
155
156
}
156
- if ( differenceInMonths ( endDate , startDate ) > 3 ) {
157
+ if ( differenceInMonths ( endDate , startDate ) > timeRangeToExtend ) {
157
158
return [ subMonths ( startDate , 1 ) , addMonths ( endDate , 1 ) ] ;
158
159
}
159
- if ( differenceInDays ( endDate , startDate ) > 3 ) {
160
+ if ( differenceInDays ( endDate , startDate ) > timeRangeToExtend ) {
160
161
return [ subDays ( startDate , 1 ) , addDays ( endDate , 1 ) ] ;
161
- } else if ( differenceInHours ( endDate , startDate ) > 3 ) {
162
+ } else if ( differenceInHours ( endDate , startDate ) > timeRangeToExtend ) {
162
163
return [ subHours ( startDate , 1 ) , addHours ( endDate , 1 ) ] ;
163
- } else if ( differenceInMinutes ( endDate , startDate ) > 3 ) {
164
+ } else if ( differenceInMinutes ( endDate , startDate ) > timeRangeToExtend ) {
164
165
return [ subMinutes ( startDate , 1 ) , addMinutes ( endDate , 1 ) ] ;
165
166
}
166
167
// Other
0 commit comments