如何重命名 Azure Log Analytics 时间表查询中的轴

How to rename axes in Azure Log Analytics Timechart Query

我有以下查询要更改轴的名称。我尝试了 render 的可选属性,但它似乎无法识别其中的任何一个。我错过了什么?

AzureStorage_CL
| where ResourceGroup == "rg-sdl-adw"
| where PercentClientOtherError_d > 0
| summarize AV = any(PercentClientOtherError_d) by bin(TimeGenerated, 30m) | 
render timechart with (ytitle = "Y new title")

当前结果:

Log Analytics 不支持 "ytitle",因为它使用不同的呈现引擎。

已提交 issue 以跟踪它。

你得到答案了吗?

坐标轴不容易编辑,您所受的格式有点限制,但本质上您需要通过查询重命名坐标轴:

AzureStorage_CL
| where ResourceGroup == "rg-sdl-adw"
| where PercentClientOtherError_d > 0
| summarize AV = any(PercentClientOtherError_d) by bin(TimeGenerated, 30m) 
| render timechart

现在添加一行以重命名轴 | project-rename NewAxisTitle = AV 其中 NewAxisTitle 是您想要的名称,而 AV 是您的旧名称姓名:

AzureStorage_CL
| where ResourceGroup == "rg-sdl-adw"
| where PercentClientOtherError_d > 0
| summarize AV = any(PercentClientOtherError_d) by bin(TimeGenerated, 30m)
| project-rename NewAxisTitle = AV
| render timechart

请注意,任何时候在重命名点之后引用轴时,都需要按照新名称来引用它。

希望一切都有意义。