你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Applies to: ✅Microsoft Fabric✅Azure Data Explorer
折线图视觉对象是最基本的图表类型。 查询的第一列应是数值,并且用作 x 轴。 其他数值列是 y 轴。 折线图跟踪短期和长期的变化。 存在较小的变化时,折线图比条形图更有用。
Note
This visualization can only be used in the context of the render operator.
Syntax
T|renderlinechart [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)。 |
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 列的值提供的值。 |
ysplit |
如何将可视化效果拆分为多个 y 轴值。 有关详细信息,请参阅 ysplit property。 |
ytitle |
y 轴的标题(string 类型)。 |
ysplit 属性
此可视化效果支持拆分为多个 y 轴值:
ysplit |
Description |
|---|---|
none |
为所有系列数据显示单个 y 轴。 (Default) |
axes |
单个图表将显示多个 y 轴(每个系列一个)。 |
panels |
为每个 ycolumn 值呈现一个图表。 最多五个面板。 |
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. 可能需要修改示例查询中的表名称以匹配工作区中的表。
呈现折线图
此查询检索弗吉尼亚州的风暴事件,专注于开始时间和财产损坏,然后在折线图中显示此信息。
StormEvents
| where State=="VIRGINIA"
| project StartTime, DamageProperty
| render linechart
标记折线图
此查询检索弗吉尼亚州的风暴事件,专注于开始时间和财产损坏,然后在具有指定标题的折线图中显示此信息,以便更清晰和呈现。
StormEvents
| where State=="VIRGINIA"
| project StartTime, DamageProperty
| render linechart
with (
title="Property damage from storms in Virginia",
xtitle="Start time of storm",
ytitle="Property damage"
)
y 轴上显示的限制值
此查询检索弗吉尼亚州的风暴事件,专注于开始时间和属性损坏,然后在折线图中显示此信息,并具有指定的 y 轴限制,以便更好地可视化数据。
StormEvents
| where State=="VIRGINIA"
| project StartTime, DamageProperty
| render linechart with (ymin=7000, ymax=300000)
查看多个 y 轴
此查询检索德克萨斯州、内布拉斯加州和堪萨斯州的冰冻事件。 它计算每个州每天的冰冻事件数,然后在折线图中显示此信息,其中包含每个州的单独面板。
StormEvents
| where State in ("TEXAS", "NEBRASKA", "KANSAS") and EventType == "Hail"
| summarize count() by State, bin(StartTime, 1d)
| render linechart with (ysplit=panels)