Replies: 1 comment 3 replies
-
Looks very interesting! I wonder if we could implement this as a macro, e.g.: create macro bar(val, width) as repeat('██', ((val::double/max(val::double) over ()) * width)::INT);
select i, bar(i, 25) from (values (0), (1), (4), (9), (16), (25), (36), (49), (64), (81), (100)) t(i);
┌───────┬────────────────────────────────────────────────────┐
│ i │ bar(i, 25) │
│ int32 │ varchar │
├───────┼────────────────────────────────────────────────────┤
│ 0 │ │
│ 1 │ │
│ 4 │ ██ │
│ 9 │ ████ │
│ 16 │ ████████ │
│ 25 │ ████████████ │
│ 36 │ ██████████████████ │
│ 49 │ ████████████████████████ │
│ 64 │ ████████████████████████████████ │
│ 81 │ ████████████████████████████████████████ │
│ 100 │ ██████████████████████████████████████████████████ │
├───────┴────────────────────────────────────────────────────┤
│ 11 rows 2 columns │
└────────────────────────────────────────────────────────────┘
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to implement bar function like ClickHouse.
It draws unicode-art bar chart and is useful for instant visualization of numerical data in CLI.
Beta Was this translation helpful? Give feedback.
All reactions