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 37 38 39 40 41 42
|
package pterm
// Checkmark is used in the interactive multiselect printer.
type Checkmark struct {
Checked string
Unchecked string
}
// 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
}
|