你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Applies to: ✅Microsoft Fabric✅Azure Data Explorer✅Azure Monitor✅Microsoft Sentinel
柱形图视觉对象至少需要查询结果中的两列。 默认情况下,第一列用作 x 轴。 此列可以包含文本、日期时间或数值数据类型。 其他列用作 y 轴,包含要显示为垂直线的数值数据类型。 柱形图用于比较主类别范围内的特定子类别项,其中每条线的长度表示其值。
Note
This visualization can only be used in the context of the render operator.
Syntax
T|rendercolumnchart [with(propertyName=propertyValue [, ...])]
Learn more about syntax conventions.
Parameters
| Name | 类型 | Required | Description |
|---|---|---|---|
| T | string |
✔️ | 输入表名称。 |
| propertyName, propertyValue | string |
键值属性对的逗号分隔列表。 See supported properties. |
Supported properties
所有属性都是可选的。
| PropertyName | PropertyValue |
|---|---|
accumulate |
是否将每个度量的值加到其所有前导度量中。 (true 或 false) |
kind |
可视化效果种类的进一步细化。 有关详细信息,请参阅 kind property。 |
legend |
是否显示图例(visible 或 hidden)。 |
series |
以逗号分隔的列列表,其中的每记录值组合定义了记录所属的系列。 |
ymin |
要在 Y 轴上显示的最小值。 |
ymax |
要在 Y 轴上显示的最大值。 |
title |
可视化效果的标题(string 类型)。 |
xaxis |
如何缩放 x 轴(linear 或 log)。 |
xcolumn |
结果中的哪一列用于 x 轴。 |
xtitle |
x 轴的标题(string 类型)。 |
yaxis |
如何缩放 y 轴(linear 或 log)。 |
ycolumns |
由逗号分隔的列列表,其中包含根据 x 列的值提供的值。 |
ytitle |
y 轴的标题(string 类型)。 |
ysplit |
如何将可视化效果拆分为多个 y 轴值。 有关详细信息,请参阅 ysplit property。 |
ysplit 属性
此可视化效果支持拆分为多个 y 轴值:
ysplit |
Description |
|---|---|
none |
为所有系列数据显示单个 y 轴。 这是默认值。 |
axes |
单个图表将显示多个 y 轴(每个系列一个)。 |
panels |
对于每个 ycolumn 值,均会呈现一个图表。 最多五个面板。 |
Supported properties
所有属性都是可选的。
| PropertyName | PropertyValue |
|---|---|
kind |
可视化效果种类的进一步细化。 有关详细信息,请参阅 kind property。 |
series |
以逗号分隔的列列表,其中的每记录值组合定义了记录所属的系列。 |
title |
可视化效果的标题(string 类型)。 |
kind 属性
可以通过提供 kind 属性来进一步详细阐述此可视化效果。
此属性支持的值为:
kind 值 |
Definition |
|---|---|
default |
每个“柱形”都独立存在。 |
unstacked |
与 default 相同。 |
stacked |
将“柱形”一个接一个地堆叠。 |
stacked100 |
对“柱形”进行堆叠,并将每个柱形拉伸到与其他柱形相同的高度。 |
Examples
本节中的示例演示如何使用语法帮助你入门。
The examples in this article use publicly available tables in the help cluster, such as the
StormEventstable in the Samples database.
The examples in this article use publicly available tables, such as the
Weathertable in the Weather analytics sample gallery. 可能需要修改示例查询中的表名称以匹配工作区中的表。
呈现柱形图
此查询提供具有高频率风暴事件的状态的可视表示形式,特别是使用柱形图处理超过 10 个事件的状态。
StormEvents
| summarize event_count=count() by State
| where event_count > 10
| project State, event_count
| render columnchart
使用 ysplit 属性
此查询提供风暴相关伤亡的每日摘要,以柱形图的形式可视化,并带有拆分轴/面板进行更好的比较。
StormEvents
| summarize
TotalInjuries = sum(InjuriesDirect) + sum(InjuriesIndirect),
TotalDeaths = sum(DeathsDirect) + sum(DeathsIndirect)
by bin(StartTime, 1d)
| project StartTime, TotalInjuries, TotalDeaths
| render columnchart with (ysplit=axes)
若要将视图拆分为单独的面板,请指定 panels 而不是 axes:
StormEvents
| summarize
TotalInjuries = sum(InjuriesDirect) + sum(InjuriesIndirect),
TotalDeaths = sum(DeathsDirect) + sum(DeathsIndirect)
by bin(StartTime, 1d)
| project StartTime, TotalInjuries, TotalDeaths
| render columnchart with (ysplit=panels)
Example
此查询可帮助你识别具有大量风暴事件的状态,并采用清晰、直观的格式显示信息。
StormEvents
| summarize event_count=count() by State
| where event_count > 10
| project State, event_count
| render columnchart