复合条呈现器Composite bar renderer

工作簿允许使用复合条(由多个条形组成的条)呈现数据。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.

添加复合条呈现器Adding composite bar renderer

  1. 选择“编辑”工具栏项,将工作簿切换到编辑模式。Switch the workbook to edit mode by selecting Edit toolbar item.
  2. 选择“添加”,然后选择“添加查询” 。Select Add then Add query.
  3. 将“数据源”设置为“JSON”,并将“可视化效果”设置为“网格” 。Set Data source to "JSON" and Visualization to "Grid".
  4. 添加以下 JSON 数据。Add the 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}
]
  1. 运行查询。Run query.
  2. 选择“列设置”以打开设置。Select Column Settings to open the settings.
  3. 从“列”中选择“总计”,然后为“列呈现器”选择“复合条” 。Select "total" from Columns and choose "Composite Bar" for Column renderer.
  4. 在“复合条设置”下设置以下设置。Set the following settings under Composite Bar Settings.
列名Column Name 颜色Color
联机online 绿色Green
恢复recovering YellowYellow
offlineoffline 红色(亮)Red (Bright)
  1. 添加标签:["online"] of ["total"] are healthyAdd Label:["online"] of ["total"] are healthy
  2. 在“联机”、“脱机”和“正在恢复”列设置中,可以将列呈现器设置为“隐藏”(可选)。In the column settings for online, offline, and recovering you can set column renderer to "Hidden" (Optional).
  3. 选择顶部的“标签”,然后将总计列的标签更新为“数据库状态”(可选)。Select Labels at the top and update label for the total column as "Database Status" (Optional).
  4. 选择“应用”Select on Apply

复合条设置将类似于以下屏幕截图:The composite bar settings will look like the screenshot below:

具有上述设置的复合条设置的屏幕截图。

具有上述设置的复合条:The composite bar with the settings above:

复合条的屏幕截图。

复合条设置Composite bar settings

选择列名和相应颜色,可将该颜色的相应列呈现为复合条的一部分。Select column name and corresponding color to render that column in that color as a part of composite bar. 可以插入、删除和上下移动行。You can insert, delete, and move rows up and down.

LabelLabel

复合条标签显示在复合条的顶部。Composite bar label is displayed at the top of the composite bar. 可以搭配使用静态文本、列和参数。You can use a mix of static text, columns, and parameter. 如果“标签”为空,则当前列的值将显示为标签。If Label is empty, the value of the current columns is displayed as the label. 在前面的示例中,如果将标签字段保留为黑色,则将显示总计列的值。In the previous example if we left the label field black the value of total columns would be displayed.

请参考具有 ["columnName"] 的列。Refer to columns with ["columnName"].

请参考具有 {paramName} 的参数。Refer to parameters with {paramName}.

列名和参数名均区分大小写。Both column name and parameter name are case sensitive. 还可以通过选择“将此项设为链接”使标签成为链接,然后添加链接设置。You can also make labels a link by selecting "Make this item as a link" and then add link settings.

聚合Aggregation

聚合对于“树/分组依据”可视化效果很有用。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. 有三种类型的聚合适用于复合条:None、Sum 和 Inherit。There are three types of aggregations applicable for composite bars: None, Sum, and Inherit.

若要添加“分组依据”设置,请执行以下操作:To add Group By settings:

  1. 在列设置中,转到要向其添加设置的列。In column settings, go to the column you want to add settings to.
  2. 在“树类型”下的“树/分组依据设置”中,选择“分组依据” In Tree/Group By Settings under Tree type, select Group By
  3. 选择要按其分组的字段。Select the field you would like to group by.

分组依据设置的屏幕截图。

None

None 聚合表示对于组行,该列不显示任何结果。None aggregation means display no results for that column for the group rows.

使用 None 聚合的复合条的屏幕截图。

SumSum

如果将聚合设置为 Sum,则组行中的列将使用用于呈现它的列的总和来显示复合条。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.

在下面的示例中,所有“联机”、“脱机”和“正在恢复”列均将最大聚合设置为 sum,并且总计列的聚合为 sum。In the example below the online, offline, and recovering all have max aggregation set to them and the aggregation for the total column is sum.

使用 sum 聚合的复合条的屏幕截图。

继承Inherit

如果将聚合设置为 inherit,则组行中的列将使用用于呈现它的列的用户设置的聚合来显示复合条。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 the user. 如果当前的列呈现器是复合条且在标签中被引用(如上面示例中的“总计”),则 sum 将用作相应列的聚合。If the current column renderer is composite bar and is refereed in the label (like "total" in the example above), then sum is used as the aggregation for that column.

在下面的示例中,所有“联机”、“脱机”和“正在恢复”列均将最大聚合设置为自身,并且总计列的聚合是 inherit。In the example below, the online, offline, and recovering all have max aggregation set to them and the aggregation for total column is inherit.

使用 inherit 聚合的复合条的屏幕截图。

排序Sorting

对于网格可视化效果,使用复合条呈现器对列的行进行排序的依据是一个值,该值是用于动态呈现复合条计算机的列的总和。For grid visualizations, the sorting of the rows for the column with the composite bar renderer works based on the value that is the sum of the columns used to render the composite bar computer dynamically. 在前面的示例中,用于排序的值是该特定行的“联机”、“正在恢复”和“脱机”列的总和。In the previous examples, the value used for sorting is the sum of the online, recovering, and the offline columns for that particular row.

图块可视化效果Tiles visualization

  1. 选择“添加”,然后选择“添加查询”。Select Add and add query.

  2. 将数据源更改为 JSON,然后输入上一个示例中的数据。Change the data source to JSON enter the data from the previous example.

  3. 将可视化效果更改为“图块”。Change visualization to Tiles.

  4. 运行查询。Run query.

  5. 选择“图块设置”。Select Tile Settings.

  6. 在“图块”字段中选择“左”。Select Left in Tile fields.

  7. 在“字段设置”下输入以下设置。Enter the settings below under Field Settings.

    1. 使用列:“服务器”。Use column: "server".
    2. 列呈现器:“文本”。Column renderer: "Text".
  8. 在“图块”字段中选择“底部”。Select Bottom in Tile fields.

  9. 在“字段设置”下输入以下设置。Enter the settings below under Field Settings.

    1. 使用列:“总计”。Use column: "total".
    2. 列呈现器:“复合条”。Column renderer: "Composite Bar".
    3. 在“复合条设置”下输入“设置以下设置”。Enter Set the following settings under "Composite Bar Settings".
    列名Column Name 颜色Color
    联机online 绿色Green
    恢复recovering YellowYellow
    offlineoffline 红色(亮)Red (Bright)
    1. 添加标签:["online"] of ["total"] are healthyAdd Label:["online"] of ["total"] are healthy.
  10. 选择“应用”。Select Apply.

图块的复合条设置:Composite bar settings for tiles:

具有上述设置的复合条图块设置的屏幕截图。

具有上述设置的“图块”的“复合条”视图将如下所示:The Composite bar view for Tiles with the above settings will look like this:

复合条图块的屏幕截图。

图形可视化效果Graphs visualization

若要制作用于图形可视化效果(类型为 Hive 群集)的复合条呈现器,请按照以下说明操作。To make a composite bar renderer for Graphs visualization (type Hive Clusters), follow the instructions below.

  1. 选择“添加”,然后选择“添加查询”。Select Add and add query.

  2. 将数据源更改为 JSON,然后输入上一个示例中的数据。Change the data source to JSON enter the data from the previous example.

  3. 将可视化更改为“图形”。Change visualization to Graphs.

  4. 运行查询。Run query.

  5. 选择“图形设置”。Select Graph Settings.

  6. 在“节点格式设置”中选择“中心内容”。Select Center Content in Node Format Settings.

  7. 在“字段设置”下输入以下设置。Enter the settings below under Field Settings.

    1. 使用列:“总计”。Use column: "total".
    2. 列呈现器:“复合条”。Column renderer: "Composite Bar".
    3. 在“复合条设置”下输入以下设置。Enter the following settings under Composite Bar Settings.
    列名Column Name 颜色Color
    联机online 绿色Green
    恢复recovering YellowYellow
    offlineoffline 红色(亮)Red (Bright)
    1. 添加标签:["online"] of ["total"] are healthyAdd Label:["online"] of ["total"] are healthy.
  8. 在“布局设置”下输入以下设置。Enter the settings below under Layout Settings.

    1. 图形类型:Hive 群集。Graph Type: Hive Clusters.
    2. 节点 ID 选择:“服务器”。Node ID select: "server".
    3. 分组依据字段:“无”。Group By Field: "None".
    4. 节点大小:100。Node Size: 100.
    5. 六边形之间的边距:5。Margin between hexagons: 5.
    6. “着色类型”:Coloring Type type: None.
  9. 选择“应用”。Select Apply.

图形的复合条设置:Composite bar settings for graphs:

具有上述设置的复合条图形设置的屏幕截图。

具有上述设置的“图形”的“复合条”视图将如下所示:The Composite bar view for Graph with the above settings will look like this:

具有 hive 群集的复合条图形的屏幕截图。

后续步骤Next steps

  • 使用 Azure 资源管理器部署工作簿。Deploy workbooks with Azure Resource Manager.
  • 控制和共享对工作簿资源的访问权限。Control and share access to your workbook resources.