@@ -118,16 +118,19 @@ export abstract class AxisRenderer extends Renderer {
118
118
return this . mTrans ;
119
119
}
120
120
121
- /**
122
- * Computes the axis values.
123
- *
124
- * @param min - the minimum value in the data object for this axis
125
- * @param max - the maximum value in the data object for this axis
126
- */
127
- @profile
128
- public computeAxis ( min , max , inverted ) {
129
- // calculate the starting and entry polet of the y-labels (depending on
130
- // zoom / contentrect bounds)
121
+ public getCurrentMinMax ( min ?, max ?, inverted ?) {
122
+ if ( min === undefined || max === undefined || inverted === undefined ) {
123
+ const axis = this . mAxis ;
124
+ if ( min === undefined ) {
125
+ min = axis . mAxisMinimum ;
126
+ }
127
+ if ( max === undefined ) {
128
+ max = axis . mAxisMaximum ;
129
+ }
130
+ if ( inverted === undefined ) {
131
+ inverted = axis [ 'isInverted' ] ? axis [ 'isInverted' ] ( ) : false ;
132
+ }
133
+ }
131
134
if ( this . mViewPortHandler != null && this . mViewPortHandler . getContentRect ( ) . width ( ) > 10 && ! this . mViewPortHandler . isFullyZoomedOutY ( ) ) {
132
135
const rect = this . mAxis . isIgnoringOffsets ( ) ? this . mViewPortHandler . getChartRect ( ) : this . mViewPortHandler . getContentRect ( ) ;
133
136
const p1 = this . mTrans . getValuesByTouchPoint ( rect . left , rect . top ) ;
@@ -141,7 +144,22 @@ export abstract class AxisRenderer extends Renderer {
141
144
max = p2 . y ;
142
145
}
143
146
}
144
- this . computeAxisValues ( min , max ) ;
147
+ return { min, max } ;
148
+ }
149
+
150
+ /**
151
+ * Computes the axis values.
152
+ *
153
+ * @param min - the minimum value in the data object for this axis
154
+ * @param max - the maximum value in the data object for this axis
155
+ */
156
+ @profile
157
+ public computeAxis ( min , max , inverted ) {
158
+ // calculate the starting and entry polet of the y-labels (depending on
159
+ // zoom / contentrect bounds)
160
+
161
+ const result = this . getCurrentMinMax ( min , max , inverted ) ;
162
+ this . computeAxisValues ( result . min , result . max ) ;
145
163
}
146
164
147
165
/**
0 commit comments