简体   繁体   中英

Kusto - Remove additional text from variable (Legend) in Kusto chart

I have a Kusto chart that has Legend with the Variable name (Platform) from the Query. I would like to remove the additional text from this Legend. I did some research and was able to see similar results from SQL but could you please tell me how do I do it in KQL.

for example, from below I would like to remove the word Platform and package size from the Legend and display just the Win_T3 & Linux_T3

  1. "Platform": "Win"_"T3": PackageSize
  2. "Platform": "Linux"_"T3": PackageSize

在此处输入图像描述

Below is the Data Table在此处输入图像描述

Below is how the Legend appears in the Chart在此处输入图像描述

I wanted the chart Legend to show just windows_C4. Remove the Legend and Patch Size from the Legend. You could see in the first picture from the table the Patch Size for Legend in doff time

You want something like...

<Your query>
| render linechart with (legend = hidden)

For more options refer to the following page with the properties section

https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/renderoperator?pivots=azuredataexplorer

This is pretty hacky, but I thought I'd share it anyway because it somewhat helps the readability.

<query>
| summarize ['&nbsp;']=PatchSize by ['&#32;']=LegendName, Timestamp

You can manipulate the value in the relevant column, just before you render the chart. Something like this:

<your query>
| parse Platform with '"Platform": "' PlatformPart1 '"_"' PlatformPart2 '" : PackageSize'
| extend Platform = strcat(PlatformPart1, '_', PlatformPart2)
| project-away PlatformPart1, PlatformPart2
| render ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM