Simple Bar Feature

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.

Was this article helpful?

Related Articles

CHISTADATA IS COMMITTED TO OPEN SOURCE SOFTWARE AND BUILDING HIGH PERFORMANCE COLUMNSTORES

In the spirit of freedom, independence and innovation. ChistaDATA Corporation is not affiliated with ClickHouse Corporation 

Need Support?

Can't find the answer you're looking for?
Contact Support

ChistaDATA Inc. Knowledge base is licensed under the Apache License, Version 2.0 (the “License”)

Copyright 2022 ChistaDATA Inc

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.