single bar example update
Vladimir Bauer
8 years ago
| 43 | 43 |
bar := p.AddBar(int64(total),
|
| 44 | 44 |
// Prepending decorators
|
| 45 | 45 |
mpb.PrependDecorators(
|
| 46 | |
// StaticName decorator with minWidth and no extra config
|
| 47 | |
// If you need to change name while rendering, use DynamicName
|
| 48 | |
decor.StaticName(name, len(name), 0),
|
| 49 | |
// ETA decorator with minWidth and no extra config
|
| 50 | |
decor.ETA(4, 0),
|
|
46 |
// StaticName decorator with one extra space on right
|
|
47 |
decor.StaticName(name, len(name)+1, decor.DidentRight),
|
|
48 |
// ETA decorator with width reservation of 3 runes
|
|
49 |
decor.ETA(3, 0),
|
| 51 | 50 |
),
|
| 52 | 51 |
// Appending decorators
|
| 53 | 52 |
mpb.AppendDecorators(
|
| 54 | |
// Percentage decorator with minWidth and no extra config
|
|
53 |
// Percentage decorator with width reservation of 5 runes
|
| 55 | 54 |
decor.Percentage(5, 0),
|
| 56 | 55 |
),
|
| 57 | 56 |
)
|
| 24 | 24 |
bar := p.AddBar(int64(total),
|
| 25 | 25 |
// Prepending decorators
|
| 26 | 26 |
mpb.PrependDecorators(
|
| 27 | |
// StaticName decorator with minWidth and no extra config
|
| 28 | |
// If you need to change name while rendering, use DynamicName
|
| 29 | |
decor.StaticName(name, len(name), 0),
|
| 30 | |
// ETA decorator with minWidth and no extra config
|
| 31 | |
decor.ETA(4, 0),
|
|
27 |
// StaticName decorator with one extra space on right
|
|
28 |
decor.StaticName(name, len(name)+1, decor.DidentRight),
|
|
29 |
// ETA decorator with width reservation of 3 runes
|
|
30 |
decor.ETA(3, 0),
|
| 32 | 31 |
),
|
| 33 | 32 |
// Appending decorators
|
| 34 | 33 |
mpb.AppendDecorators(
|
| 35 | |
// Percentage decorator with minWidth and no extra config
|
|
34 |
// Percentage decorator with width reservation of 5 runes
|
| 36 | 35 |
decor.Percentage(5, 0),
|
| 37 | 36 |
),
|
| 38 | 37 |
)
|