forked from pterm/pterm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatoms.go
More file actions
36 lines (30 loc) · 720 Bytes
/
atoms.go
File metadata and controls
36 lines (30 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package pterm
// Bars is used to display multiple Bar.
type Bars []Bar
// Bar is used in bar charts.
type Bar struct {
Label string
Value int
Style *Style
LabelStyle *Style
}
// WithLabel returns a new Bar with a specific option.
func (p Bar) WithLabel(s string) *Bar {
p.Label = s
return &p
}
// WithLabelStyle returns a new Bar with a specific option.
func (p Bar) WithLabelStyle(style *Style) *Bar {
p.LabelStyle = style
return &p
}
// WithValue returns a new Bar with a specific option.
func (p Bar) WithValue(value int) *Bar {
p.Value = value
return &p
}
// WithStyle returns a new Bar with a specific option.
func (p Bar) WithStyle(style *Style) *Bar {
p.Style = style
return &p
}