File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -25,13 +25,15 @@ module.exports = function calc(gd, trace) {
25
25
var xa = Axes . getFromId ( gd , trace . xaxis || 'x' ) ,
26
26
ya = Axes . getFromId ( gd , trace . yaxis || 'y' ) ,
27
27
orientation = trace . orientation || ( ( trace . x && ! trace . y ) ? 'h' : 'v' ) ,
28
- pos , size , i ;
28
+ sa , pos , size , i ;
29
29
30
30
if ( orientation === 'h' ) {
31
+ sa = xa ;
31
32
size = xa . makeCalcdata ( trace , 'x' ) ;
32
33
pos = ya . makeCalcdata ( trace , 'y' ) ;
33
34
}
34
35
else {
36
+ sa = ya ;
35
37
size = ya . makeCalcdata ( trace , 'y' ) ;
36
38
pos = xa . makeCalcdata ( trace , 'x' ) ;
37
39
}
@@ -53,18 +55,21 @@ module.exports = function calc(gd, trace) {
53
55
}
54
56
55
57
// set base
56
- var base = trace . base ;
58
+ var base = trace . base ,
59
+ b ;
57
60
58
61
if ( Array . isArray ( base ) ) {
59
62
for ( i = 0 ; i < Math . min ( base . length , cd . length ) ; i ++ ) {
60
- cd [ i ] . b = base [ i ] ;
63
+ b = sa . d2c ( base [ i ] ) ;
64
+ cd [ i ] . b = ( isNumeric ( b ) ) ? b : 0 ;
61
65
}
62
66
for ( ; i < cd . length ; i ++ ) {
63
67
cd [ i ] . b = 0 ;
64
68
}
65
69
}
66
70
else {
67
- var b = ( base === undefined ) ? 0 : base ;
71
+ b = sa . d2c ( base ) ;
72
+ b = ( isNumeric ( b ) ) ? b : 0 ;
68
73
for ( i = 0 ; i < cd . length ; i ++ ) {
69
74
cd [ i ] . b = b ;
70
75
}
You can’t perform that action at this time.
0 commit comments