Note
This documentation for Azure workbooks is now located at: https://learn.microsoft.com/en-us/azure/azure-monitor/visualize/workbooks-composite-bar Please do not edit this file. All up-to-date information is in the new location and documentation should only be updated there.
Workbook allows rendering data using composite bar, a bar made up of multiple bars.
The image below shows the composite bar for database status representing how many servers are online, offline, and in recovering state.
Composite bar renderer is supported for Grids, Tiles, and Graphs Visualizations
- Switch the workbook to edit mode by clicking on the Edit toolbar item.
- Use the Add query link.
- Set data source to JSON and visualization to Grid.
- Add following JSON data
[
{"sub":"X", "server": "A", "online": 20, "recovering": 3, "offline": 4, "total": 27},
{"sub":"X", "server": "B", "online": 15, "recovering": 8, "offline": 5, "total": 28},
{"sub":"Y", "server": "C", "online": 25, "recovering": 4, "offline": 5, "total": 34},
{"sub":"Y", "server": "D", "online": 18, "recovering": 6, "offline": 9, "total": 33}
]
- Click on "Column Settings" to open the settings.
- Click on "total" column and choose Column renderer as "Composite Bar".
- Set following settings under Composite Bar Settings.
- Add Label:
["online"] of ["total"] are healthy
- Set renderer as Hidden for online, offline, and recovering columns (Optional).
- Go to Labels and update label for "total" column as "Database Status" (Optional).
- Click on "Apply".
Select column name and corresponding color to render that column in that color as a part of composite bar. You can insert, delete, move rows up and down.
Composite bar label is displayed at the top of the composite bar. You can use a mix of static text, columns, and parameters. If Label is empty, the value of the current columns is displayed as label ex. in above example the value of total columns is displayed if label field is blank.
Refer to columns with ["columnName"]
Refer to parameters with {paramName}
Both column name and parameter name are case sensitive.
You can also make label as a link by selecting "Make this item as a link" and then add Link settings.
Aggregations are useful for Tree/Group By visualizations. The data for a column for the group row is decided by the aggregation set for that column. There are three types of aggregations applicable for composite bars: None, Sum, and Inherit.
None aggregation means display no results for that column for the group rows
If aggregation is set as Sum, then the column in the group row will show the composite bar by using the sum of the columns used to render it. The label will also use the sum of the columns referred in it.
In below example, the online, offline, and the recovering, all have Max aggregation set to them and the aggregation for total column is Sum.
If aggregation is set as Inherit, then the column in the group row will show the composite bar by using the aggregation set by users for the columns used to render it. The columns used in label also use the aggregation set by user. If current column having renderer as composite bar is referred in label (like "total" in above example) then "Sum" is used as aggregation for that column.
In below example, the online, offline, and the recovering, all have Max aggregation set to them and the aggregation for total column is Inherit.
Select "Apply custom tooltip" and add a custom tooltip which acts as a tooltip for the label. You can use a mix of static text, columns, and parameters.
Use {0}
to use the current column value
Refer to columns with ["columnName"]
Refer to parameters with {paramName}
Both column name and parameter name are case sensitive.
For Grid Visualization, the sorting of the rows for the column having the composite bar renderer works based on the value that is the sum of the columns used to render the composite bar, computed dynamically. In above examples, the value used for sorting is the sum of the online, recovering, and the offline columns for that particular row.
The following images show the settings for composite bar renderer for Tiles visualization and the final result using the same JSON data mentioned above.
The following images show the settings for composite bar renderer for Graphs visualization(type Hive Clusters) and the final result using the same JSON data mentioned above.