@@ -225,9 +225,24 @@ JSROOT.define(['d3', 'painter'], (d3, jsrp) => {
225225
226226 if ( optionNoopt && this . nticks && ( this . kind == "normal" ) ) this . noticksopt = true ;
227227
228- let handle = { nminor : 0 , nmiddle : 0 , nmajor : 0 , func : this . func } ;
228+ let handle = { nminor : 0 , nmiddle : 0 , nmajor : 0 , func : this . func } , ticks ;
229229
230- handle . minor = handle . middle = handle . major = this . produceTicks ( this . nticks ) ;
230+ if ( ( this . kind == 'labels' ) && ! this . regular_labels ) {
231+ ticks = [ ] ;
232+ handle . lbl_pos = [ ] ;
233+ let axis = this . getObject ( ) ;
234+ for ( let n = 0 ; n < axis . fNbins ; ++ n ) {
235+ let x = axis . fXmin + n / axis . fNbins * ( axis . fXmax - axis . fXmin ) ;
236+ if ( ( x >= this . scale_min ) && ( x < this . scale_max ) ) {
237+ handle . lbl_pos . push ( x ) ;
238+ if ( x > this . scale_min ) ticks . push ( x ) ;
239+ }
240+ }
241+ } else {
242+ ticks = this . produceTicks ( this . nticks ) ;
243+ }
244+
245+ handle . minor = handle . middle = handle . major = ticks ;
231246
232247 if ( only_major_as_array ) {
233248 let res = handle . major , delta = ( this . scale_max - this . scale_min ) * 1e-5 ;
@@ -236,14 +251,6 @@ JSROOT.define(['d3', 'painter'], (d3, jsrp) => {
236251 return res ;
237252 }
238253
239- if ( ( this . kind == 'labels' ) && ! this . regular_labels ) {
240- handle . lbl_pos = [ ] ;
241- let axis = this . getObject ( ) ;
242- for ( let n = 0 ; n < axis . fNbins ; ++ n ) {
243- let x = axis . fXmin + n / axis . fNbins * ( axis . fXmax - axis . fXmin ) ;
244- if ( ( x >= this . scale_min ) && ( x < this . scale_max ) ) handle . lbl_pos . push ( x ) ;
245- }
246- }
247254
248255 if ( ( this . nticks2 > 1 ) && ( ! this . log || ( this . logbase === 10 ) ) ) {
249256 handle . minor = handle . middle = this . produceTicks ( handle . major . length , this . nticks2 ) ;
0 commit comments