Forum Discussion

hsaini007's avatar
hsaini007
Icon for Microsoft rankMicrosoft
Jul 05, 2019

barchart Ignoring the ymin and ymax values

I know there is an open post but even that isn't closed. Along with these params many other properties also doesn't seem to work. e.g. legend

My query :

AzureDiagnostics
    | where replicationProviderName_s == "A2A"
    | where isnotempty(name_s) and isnotnull(name_s)
    | extend RPO = case(rpoInSeconds_d <= 900, "<15Min",
    rpoInSeconds_d <= 1800, "15-30Min",
    ">30Min")
    | summarize hint.strategy=partitioned arg_max(TimeGenerated, *) by name_s
    | project name_s , RPO
    | summarize Count = count() by RPO
| render barchart with (ymin=0)
 
 
My output :
Expected output:
 
I tried changing all the options, but it still looks like above. 
Also how can i fix the x axis to show 3 fix values i.e. <15, 15-20, >30 always
 
  • hsaini007 

     

    Would this help?

    AzureDiagnostics
        | where replicationProviderName_s == "A2A"
        | where isnotempty(name_s) and isnotnull(name_s)
        | extend RPO = case(
                rpoInSeconds_d <= 100,  "<15Min",
                rpoInSeconds_d <= 1000, "15-30Min",
                                        ">30Min")
        | summarize hint.strategy=partitioned arg_max(TimeGenerated, *) by name_s
        | project comp_list = name_s , RPO
        | summarize count(comp_list) by RPO, comp_list
    | render barchart kind=stacked 
    • hsaini007's avatar
      hsaini007
      Icon for Microsoft rankMicrosoft

      CliveWatson : thanks for your reply but the output is still not as expected.

      Elaborating the context here, I am trying to group the occurences based on time range showing the count of occurrences per range.

      E.g. How many vm's have RPO time <15 min, how many between 15-30min and rest.  

      The output of the updated query looks below. unstacking just result in a bar of height 1.

      • CliveWatson's avatar
        CliveWatson
        Icon for Microsoft rankMicrosoft

        hsaini007 

         

        If its just a count, wouldn't this be enough?

        AzureDiagnostics
            | where replicationProviderName_s == "A2A"
            | where isnotempty(name_s) and isnotnull(name_s)
            | extend RPO = case(
                    rpoInSeconds_d <= 100,  "<15Min",
                    rpoInSeconds_d <= 500, "15-30Min",
                                            ">30Min")
        | summarize count() by RPO , name_s
        | render barchart

         

        or (hide the name_s)

         

         

        Go to Log Analytics and Run Query

         

         

Resources