Skip to main content

Bar chart

A bar chart presents grouped data as rectangular bars with lengths proportional to the values that they represent. Unlike histograms which you can apply to display the distribution of numerical data, bar charts are primarily designed for categorical values.

Developers: To add the viewer from the console, use: grok.shell.tv.addViewer('Bar chart');

Click on a barSelect or filter
Right clickContext menu
Double-clickReset View
Alt+dragZoom
Alt+FShow in full screen

Features

Stacked bars and relative values

Use the 'Relative Values' property in combination with the 'Stack' property to analyze the distribution of the stacked values:

Relative values in a bar chart

Dates and years, quarters, months

You can categorize DateTime columns using special functions, such as 'Year', 'Month', 'Quarter', ' Year - Month' and 'Year - Quarter':

Dates in a bar chart

Videos

Bar Chart

Properties

PropertyTypeDescription
Data
Row SourcestringDetermines the rows shown on the scatter plot.
FilterstringFormula that filters out rows to show. Example: ${AGE} > 20 or (${WEIGHT} / 2) > 100
On ClickstringDetermines what happens when you click on a bar.
Tablestring
Value
Value Column NamestringValue column. See Value Aggr Type for aggregation options.
Value Aggr TypestringValue aggregation.
Relative ValuesbooleanWhen true, each outermost bar is of the same width. This mode is useful for comparing relative value frequency when the Stack column is specified.
Include NullsbooleanIndicates whether the no data bar should appear when the Split value is not present.
Bar Sort TypestringWhether to sort bars by category or by value. See also Bar Sort Order
Bar Sort OrderstringWhether the bars should be sorted in ascending or descending order. See also Bar Sort Type.
Axis Typestring
Show Value Axisboolean
Show Value Selectorboolean
General
Orientationstring
Show Mouse Over Rectboolean
Show Filtered RowsbooleanShow which part is filtered Only works with RowSource = All
Show Mouse Over Rowsboolean
Back Colornumber
Axis Colornumber
Bar Colornumber
Category Colornumber
Value Text Colornumber
Bar Border Line Mouse Over Colornumber
Bar Border Line Filtered Colornumber
Bar Border Line Colornumber
Outer Margin Leftnumber
Outer Margin Rightnumber
Outer Margin Topnumber
Outer Margin Bottomnumber
Show Empty Barsboolean
Show Labelsstring
Legend Visibilityvisibilitymode
Legend Positionflexautoposition
Allow Dynamic Menusboolean
Show Context MenubooleanProperties common for all viewers todo: use code generation
Titlestring
DescriptionstringViewer description that gets shown at the Descriptor Position. Markup is supported.
HelpstringHelp to be shown when user clicks on the ''?'' icon on top. Could either be in markdown, or a URL (starting with ''/'' or ''http'').
Description Positionflexposition
Description Visibility Modevisibilitymode
Category
Split Column NamestringA categorical column to split data on (each bar represents a category)
Split MapstringTime unit map function for Split (applicable to dates only).
Show Category Valuesboolean
Show Values Instead Of Categoriesboolean
Show Category Selectorboolean
Stack
Stack Column NamestringA categorical column to further split data on. Each category would become a part of the bar resulting from Split.
Stack MapstringTime unit map function for Stack (applicable to dates only).
Show Stack Selectorboolean
Color
Color Column NamestringNumerical column to be used for color-coding. The values in the bin get aggregated using the Color Aggr Type property.
Color Aggr TypestringColor aggregation type.
Invert Color Schemeboolean
Linear Color Schemelist
Selection
Show Selected RowsbooleanWhether the selected rows are indicated. Only works for cumulative aggregations such as count.
Style
Auto Layoutboolean
Max Category Widthnumber
Category Value Widthnumber
Show Value Axis Lineboolean
Bar Border Line Mouse Over Widthnumber
Bar Border Line Widthnumber
Max Bar Heightnumber
Bar Corner Radiusnumber
Vertical Alignverticalaligntype
Fontstring
Axis Fontstring
Min Text Heightnumber
Controls FontstringViewer controls elements font.
Description
Show Titleboolean

See also: