MCPcopy
hub / github.com/pterm/pterm / TestBarChartPrinter_RenderExample

Function TestBarChartPrinter_RenderExample

barchart_test.go:40–75  ·  view source on GitHub ↗

VERTICAL bars + MIXED values test

(t *testing.T)

Source from the content-addressed store, hash-verified

38
39// VERTICAL bars + MIXED values test
40func TestBarChartPrinter_RenderExample(t *testing.T) {
41 bars := pterm.Bars{
42 pterm.Bar{
43 Label: "Bar 1",
44 Value: 5,
45 Style: pterm.NewStyle(pterm.FgCyan),
46 },
47 pterm.Bar{
48 Label: "Bar 2",
49 Value: 3,
50 Style: pterm.NewStyle(pterm.FgCyan),
51 },
52 pterm.Bar{
53 Label: "Long Label Example",
54 Value: 7,
55 Style: pterm.NewStyle(pterm.FgCyan),
56 },
57 pterm.Bar{
58 Label: "Zero",
59 Value: 0,
60 Style: pterm.NewStyle(pterm.FgCyan),
61 },
62 pterm.Bar{
63 Label: "Negative Value",
64 Value: -4,
65 Style: pterm.NewStyle(pterm.FgCyan),
66 },
67 pterm.Bar{
68 Label: "NV",
69 Value: -5,
70 Style: pterm.NewStyle(pterm.FgCyan),
71 },
72 }
73
74 pterm.DefaultBarChart.WithBars(bars).Render()
75}
76
77// VERTICAL bars + NEGATIVE values test
78func TestBarChartPrinter_RenderNegativeBarValues(t *testing.T) {

Callers

nothing calls this directly

Calls 3

NewStyleFunction · 0.92
WithBarsMethod · 0.80
RenderMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…