你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Area chart

Applies to: ✅Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

面积图视觉对象显示时序关系。 查询的第一列应是数值,并且用作 x 轴。 其他数值列是 y 轴。 与折线图不同,面积图还可以直观地显示体积。 面积图非常适用于指示不同数据集之间的变化。

Note

This visualization can only be used in the context of the render operator.

Syntax

T|renderareachart [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 是否将每个度量的值加到其所有前导度量中。 (truefalse
kind 可视化效果种类的进一步细化。 有关详细信息,请参阅 kind property
legend 是否显示图例(visiblehidden)。
series 以逗号分隔的列列表,其中的每记录值组合定义了记录所属的系列。
ymin 要在 Y 轴上显示的最小值。
ymax 要在 Y 轴上显示的最大值。
title 可视化效果的标题(string 类型)。
xaxis 如何缩放 x 轴(linearlog)。
xcolumn 结果中的哪一列用于 x 轴。
xtitle x 轴的标题(string 类型)。
yaxis 如何缩放 y 轴(linearlog)。
ycolumns 由逗号分隔的列列表,其中包含根据 x 列的值提供的值。
ysplit 如何拆分多个可视化效果的 y 轴值。
ytitle y 轴的标题(string 类型)。

ysplit 属性

此可视化效果支持拆分为多个 y 轴值:

ysplit Description
none 为所有序列数据显示单个 y 轴。 (Default)
axes 单个图表显示具有多个 y 轴(每个系列一个)。
panels 为每个 ycolumn 值呈现一个图表。 最多五个面板。

Supported properties

所有属性都是可选的。

PropertyName PropertyValue
kind 可视化效果种类的进一步细化。 有关详细信息,请参阅 kind property
series 以逗号分隔的列列表,其中的每记录值组合定义了记录所属的系列。
title 可视化效果的标题(string 类型)。

kind 属性

可以通过提供 kind 属性来进一步详细阐述此可视化效果。 此属性支持的值为:

kind Description
default 每个“区域”都独立存在。
unstacked default 相同。
stacked 将“区域”堆叠到右侧。
stacked100 将“区域”堆叠到右侧,并将每个区域拉伸到与其他区域相同的宽度。

Examples

本节中的示例演示如何使用语法帮助你入门。

The examples in this article use publicly available tables in the help cluster, such as the StormEvents table in the Samples database.

The examples in this article use publicly available tables, such as the Weather table in the Weather analytics sample gallery. 可能需要修改示例查询中的表名称以匹配工作区中的表。

简单面积图

以下示例显示了基本面积图可视化效果。

demo_series3
| render areachart

面积图可视化效果的屏幕截图。

使用属性的面积图

以下示例显示了使用多个属性设置的面积图。

OccupancyDetection
| summarize avg_temp= avg(Temperature), avg_humidity= avg(Humidity) by bin(Timestamp, 1h)
| render areachart
    with ( 
        kind = unstacked,
        legend = visible,
        ytitle ="Sample value",
        ymin = 10,
        ymax =100,
        xtitle = "Time",    
        title ="Humidity and temperature"
    )

带属性的面积图可视化的屏幕截图。

使用拆分面板的面积图

以下示例显示了使用拆分面板的面积图。 在此示例中,ysplit 属性设置为 panels

StormEvents
| where State in ("TEXAS", "NEBRASKA", "KANSAS") and EventType == "Hail"
| summarize count=count() by State, bin(StartTime, 1d)
| render areachart
    with (
        ysplit= panels,
        legend = visible,
        ycolumns=count,
        yaxis =log,
        ytitle ="Count",
        ymin = 0,
        ymax =100,
        xaxis = linear,
        xcolumn = StartTime,
        xtitle = "Date",    
        title ="Hail events"
    )

带拆分面板的面积图可视化的屏幕截图。