Skip to content

Returns a visual bar string representation of a value within a range. Useful for text-based visualizations.

func.bar(<value>, <min>, <max>, <width>)
func.bar(50, 0, 100, 20)
┌──────────────────────┐
│ ██████████ │
└──────────────────────┘
BAR(<value>, <min>, <max>, <width>)
SELECT score, BAR(score, 0, 100, 20) AS bar FROM students;
┌───────┬──────────────────────┐
│ score │ bar │
├───────┼──────────────────────┤
25 │ █████ │
50 │ ██████████ │
75 │ ███████████████ │
100 │ ████████████████████ │
└───────┴──────────────────────┘