File tree 2 files changed +8
-9
lines changed
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -207,25 +207,25 @@ export abstract class AxisRenderer extends Renderer {
207
207
// force label count
208
208
if ( axis . isForceLabelsEnabled ( ) ) {
209
209
interval = range / ( labelCount - 1 ) ;
210
- axis . mEntryCount = labelCount ;
210
+ axis . mEntryCount = Math . floor ( labelCount ) ;
211
211
212
- if ( axis . mEntries . length < labelCount ) {
212
+ if ( axis . mEntries . length < axis . mEntryCount ) {
213
213
// Ensure stops contains at least numStops elements.
214
214
axis . mEntries = [ ] ;
215
215
axis . mLabels = [ ] ;
216
216
}
217
217
218
218
let v = min ;
219
219
220
- for ( let i = 0 ; i < labelCount ; i ++ ) {
221
- if ( axis . ensureLastLabel && i === labelCount - 1 ) {
220
+ for ( let i = 0 ; i < axis . mEntryCount ; i ++ ) {
221
+ if ( axis . ensureLastLabel && i === axis . mEntryCount - 1 ) {
222
222
v = max ;
223
223
}
224
224
axis . mEntries [ i ] = v ;
225
225
axis . mLabels [ i ] = formatter . getAxisLabel ( v , axis , this . mViewPortHandler ) ;
226
226
v += interval ;
227
227
}
228
- n = labelCount ;
228
+ n = axis . mEntryCount ;
229
229
230
230
// no forced count
231
231
} else {
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export class YAxisRendererRadarChart extends YAxisRenderer {
54
54
// force label count
55
55
if ( axis . isForceLabelsEnabled ( ) ) {
56
56
const step = range / ( labelCount - 1 ) ;
57
- axis . mEntryCount = labelCount ;
57
+ axis . mEntryCount = Math . floor ( labelCount ) ;
58
58
59
59
// if (this.mAxis.mEntries.length < labelCount) {
60
60
// // Ensure stops contains at least numStops elements.
@@ -64,13 +64,12 @@ export class YAxisRendererRadarChart extends YAxisRenderer {
64
64
65
65
let v = min ;
66
66
67
- for ( let i = 0 ; i < labelCount ; i ++ ) {
67
+ for ( let i = 0 ; i < axis . mEntryCount ; i ++ ) {
68
68
axis . mEntries [ i ] = v ;
69
69
axis . mLabels [ i ] = formatter . getAxisLabel ( v , axis , this . mViewPortHandler ) ;
70
70
v += step ;
71
71
}
72
-
73
- n = labelCount ;
72
+ n = axis . mEntryCount ;
74
73
75
74
// no forced count
76
75
} else {
You can’t perform that action at this time.
0 commit comments