File tree 1 file changed +11
-8
lines changed
shelly/plotlyjs/static/plotlyjs/src
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,8 @@ pie.calc = function(gd, trace) {
258
258
v ,
259
259
label ,
260
260
color ,
261
- hidden ;
261
+ hidden ,
262
+ pt ;
262
263
263
264
if ( trace . dlabel ) {
264
265
labels = new Array ( vals . length ) ;
@@ -319,8 +320,9 @@ pie.calc = function(gd, trace) {
319
320
320
321
if ( needDefaults ) {
321
322
for ( i = 0 ; i < cd . length ; i ++ ) {
322
- if ( cd [ i ] . color === false ) {
323
- colorMap [ cd [ i ] . label ] = cd [ i ] . color = nextDefaultColor ( fullLayout . _piedefaultcolorcount ) ;
323
+ pt = cd [ i ] ;
324
+ if ( pt . color === false ) {
325
+ colorMap [ pt . label ] = pt . color = nextDefaultColor ( fullLayout . _piedefaultcolorcount ) ;
324
326
fullLayout . _piedefaultcolorcount ++ ;
325
327
}
326
328
}
@@ -338,11 +340,12 @@ pie.calc = function(gd, trace) {
338
340
thisText ;
339
341
340
342
for ( i = 0 ; i < cd . length ; i ++ ) {
341
- thisText = hasLabel ? [ cd [ i ] . label ] : [ ] ;
342
- if ( hasText && trace . text [ i ] ) thisText . push ( trace . text [ i ] ) ;
343
- if ( hasValue ) thisText . push ( formatPieValue ( cd [ i ] . v ) ) ;
344
- if ( hasPercent ) thisText . push ( formatPiePercent ( cd [ i ] . v / vTotal ) ) ;
345
- cd [ i ] . text = thisText . join ( '<br>' ) ;
343
+ pt = cd [ i ] ;
344
+ thisText = hasLabel ? [ pt . label ] : [ ] ;
345
+ if ( hasText && trace . text [ pt . i ] ) thisText . push ( trace . text [ pt . i ] ) ;
346
+ if ( hasValue ) thisText . push ( formatPieValue ( pt . v ) ) ;
347
+ if ( hasPercent ) thisText . push ( formatPiePercent ( pt . v / vTotal ) ) ;
348
+ pt . text = thisText . join ( '<br>' ) ;
346
349
}
347
350
}
348
351
You can’t perform that action at this time.
0 commit comments