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 屬性。 |
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 屬性。 |
ysplit 屬性
此視覺效果支援分割成多個 Y 軸值:
ysplit |
Description |
|---|---|
none |
所有數列數據都會顯示單一 Y 軸。 這是預設值。 |
axes |
單一圖表會以多個 Y 軸顯示(每個數列一個)。 |
panels |
每個 ycolumn 值都會轉譯一張圖表。 最多五個面板。 |
Supported properties
所有屬性都是選擇性的。
| PropertyName | PropertyValue |
|---|---|
kind |
進一步闡述視覺效果種類。 如需詳細資訊,請參閱 kind 屬性。 |
series |
以逗號分隔的數據行清單,其合併每個記錄值會定義記錄所屬的數位。 |
title |
視覺效果的標題(類型 string為 )。 |
kind 屬性
藉由提供 kind 屬性,即可進一步詳細說明此視覺效果。
此屬性的支援值為:
kind 值 |
Definition |
|---|---|
default |
每個「數據行」各自站立。 |
unstacked |
與 default 相同。 |
stacked |
堆疊 「columns」 一個頂端。 |
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. 您可能需要修改範例查詢中的資料表名稱,以符合工作區中的資料表。
轉譯柱形圖
此查詢會以高頻率的 Storm 事件,特別是具有超過 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
此查詢可協助您識別具有大量 Storm 事件的狀態,並以清楚、可視化的格式呈現資訊。
StormEvents
| summarize event_count=count() by State
| where event_count > 10
| project State, event_count
| render columnchart