(v)
| 581 | // percentText returns text that displays v in appropriate units alongside its |
| 582 | // percentage. |
| 583 | function percentText(v) { |
| 584 | function percent(v, total) { |
| 585 | return Number(((100.0 * v) / total).toFixed(1)) + '%'; |
| 586 | } |
| 587 | return unitText(v) + " (" + percent(v, stacks.Total) + ")"; |
| 588 | } |
| 589 | |
| 590 | // unitText returns a formatted string to display for value. |
| 591 | function unitText(value) { |