File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -16,28 +16,23 @@ export const createLinearScale = <Output extends NumberValue>(
1616)  =>  { 
1717    let  minValue : NumberValue 
1818    if  ( min  ===  'auto' )  { 
19-         minValue  =  stacked  ===  true  ? data . minStacked  : data . min 
19+         minValue  =  stacked  ===  true  ? data . minStacked  ??   0   : data . min 
2020    }  else  { 
2121        minValue  =  min 
2222    } 
2323
2424    let  maxValue : NumberValue 
2525    if  ( max  ===  'auto' )  { 
26-         maxValue  =  stacked  ===  true  ? data . maxStacked  : data . max 
26+         maxValue  =  stacked  ===  true  ? data . maxStacked  ??   0   : data . max 
2727    }  else  { 
2828        maxValue  =  max 
2929    } 
3030
3131    const  scale  =  scaleLinear < number ,  Output > ( ) 
3232        . rangeRound ( axis  ===  'x'  ? [ 0 ,  size ]  : [ size ,  0 ] ) 
33+         . domain ( reverse  ? [ maxValue ,  minValue ]  : [ minValue ,  maxValue ] ) 
3334        . clamp ( clamp ) 
3435
35-     if  ( reverse  ===  true )  { 
36-         scale . domain ( [ maxValue ,  minValue ] ) 
37-     }  else  { 
38-         scale . domain ( [ minValue ,  maxValue ] ) 
39-     } 
40- 
4136    if  ( nice  ===  true )  scale . nice ( ) 
4237    else  if  ( typeof  nice  ===  'number' )  scale . nice ( nice ) 
4338
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments