简体   繁体   中英

Kusto - rendering columnchart does not honor data row order

I have following data and I am rendering columnchart with it but columnchart does not create graphs in the same order as data ie first column as July then August and then so on.

Can someone help me here on how to ensure order in columnchart

datatable (Month: string, total_core_hours: long) [
    "July",long(2000000),
    "August",long(3361305),
    "September",long(2478058),
    "October",long(2869816),
    "November",long(1663719),
    "December",long(5039456),
    "January",long(22773168),
    "February",long(10974652),
    "March",long(27346583),
]
| project Month, total_core_hours
| render columnchart

在此处输入图像描述

Following worked for me, by converting string to datetime which brings natural order to data:

datatable (StartDate: datetime , total_core_hours: long) [
    datetime(2021-10-01),long(2869816),
    datetime(2021-11-01),long(1663719),
    datetime(2021-12-01),long(5039456),
    datetime(2022-01-01),long(22773168),
    datetime(2022-02-01),long(10974652),
    datetime(2022-03-01),long(27346583),
]
| extend formattedStartDate = format_datetime(StartDate, "yyyy-MM")
| project formattedStartDate, total_core_hours
| render columnchart

在此处输入图像描述

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