Build a Bar Chart - maneeshpal/Drata GitHub Wiki
A bar chart significantly differs from Line and Area in terms of how data is segmented.
This view you see below is the Widget Editor view. All the important functionalites are marked with bullet points.

-
Selections: There is no limit to the number of properties you select for visualization. Every selection can be a composed with other nested selections. For example select sum(price), sum(price - discount) etc... In the above illustration, the user selected two properties, price and discount. Due to the aggregations applied, two bar charts have been generated, one for each selection. What you see in the illustration is the first bar chart, displaying the aggregation function sum over price. See more about Selections
-
GroupBy :You can specify upto two levels of GroupBy. In the example illustration, the results are first grouped by geography, which splits the data into different sets based on the values of the property geography as shown in #7.
-
GroupBy level 2 : Now here is the tricky part. Drata knows that there are two selections, and on top of that, those selections are grouped by geography. So, now Drata will take every selection and then for each of those, will grab every group Ex:sum(price) for texas (geography group) and splits it further based on sex, resulting in two bars for each sex, one for male and the other for female. The colors are differentiated using labels as shown in #5. This logic is explained in a tabular format below.
-
You need to specify a numeric or date interval depending upon whether you are grouping results using date/numeric properties. Since in this illustration, we are grouping by properties of type string, no interval is required. See more about Date Interval
-
Labels that distinguish between the groupings resulted via GroupBy, GroupBy level2 in #2 and #3. If there is no GroupBy level 2, these labels will show the values of GroupBy property.
-
If your query results in multiple visualizations, this dropdown shows up, giving you the ability to toggle between those visualizations.
-
These labels pertain to GroupBy property specified in the query.
| Query | Resulting Visualization |
|---|---|
| Pretty much basic, you can visualize the count, avg, sum of the selection |
|
| sum aggregate function is applied on Price for each geography. | ![]() |
sum aggregate function is applied on Price for each geography. Each of these groups is further grouped by sex.
|
