ClickHouse has simple bar feature. This enables you to summarize data quickly by creating straightforward charts directly.
bar(x, min, max, width)
x is the value,
min is the 0% and max is the 100% of value,
width is the symbol width.
Using this amazing function, SELECT queries may automatically draw bars:
WITH (SELECT max(amount) FROM exp_test and currency = 'EUR') AS max SELECT amount, bar(amount, 0, max, 50) as graph FROM exp_test and currency = 'EUR' ┌──amount─┬─graph───────────────────────────────────────────┐ │ 1231127 │ ██████████████▎ │ │ 854303 │ █████████▊ │ │ 4032081 │ ██████████████████████████████████████████████▊ │ │ 1463324 │ █████████████████ │ │ 3930261 │ █████████████████████████████████████████████▋ │ └─────────┴─────────────────────────────────────────────────┘
The usage of the bar function has been demonstrated.