跳转到内容

返回范围内某个值的可视化条形字符串表示,适用于基于文本的可视化场景。

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 │ ████████████████████ │
└───────┴──────────────────────┘