azureazure-availability-set

Azure KQL Query render as chart, can't set y axis data or split to none


I'm trying to get a query to render as a chart in KQL (availability monitor) following the syntax here: https://learn.microsoft.com/en-us/kusto/query/render-operator?view=microsoft-fabric

As far as I can tell, I have the syntax correct, it appears I can set which column appears as the x-axis, however, I can't seem to set the y-axis column or set it to 'don't split' the Split-by

This is what I am seeing: Currently what I am seeing

However what I am expecting to see is (and I can do this by changing those drop downs): What I am expecting to see

Does anyone have any idea what I might be doing wrong here??

I've a hunch that it's something to do with ycolumns needs to be comma separated but can't figure out the exact syntax to give it just one column here, and reordering them so ycolumns is last doesn't make it not split either

Code example:

availabilityResults
| where timestamp > ago(24h) //set the time range
| where name == "sitename" //set the monitor name 
| render areachart with (xcolumn=timestamp,ysplit=none,ycolumns=duration)

Solution

  • You need to use project before the render to select just the columns you want to appear in the chart

    | project timestamp, duration
    

    so in full would be:

    availabilityResults
    | where timestamp > ago(24h) //set the time range
    | where name == "sitename" //set the monitor name 
    | project timestamp, duration
    | render areachart with (xcolumn=duration,ycolumns=timestamp)
    

    https://learn.microsoft.com/en-us/kusto/query/tutorials/learn-common-operators?view=microsoft-fabric#select-a-subset-of-columns