Forum Discussion
How to show montly costs in time chart
- Oct 16, 2022
Select Visualization: Bar Chart (Categorical)
Then open Advanced Editor and add
"chartSettings": {"xAxis": "BillingMonth","yAxis": ["Cost"],"group": null,"createOtherGroup": 0,"showLegend": true}
Thanks Clive_Watson for you response.
I removed the formatting of the Billing column in the 'Column Setting' popup.
Resulting in these date values:
2022-09-01T00:00:00
2022-08-01T00:00:00
2022-07-01T00:00:00
But I still can't create any chart. This is my json result:
{
"id": "subscriptions/**/resourcegroups/**/providers/Microsoft.CostManagement/query/**",
"name": "**",
"type": "Microsoft.CostManagement/query",
"location": null,
"sku": null,
"eTag": null,
"properties": {
"nextLink": null,
"columns": [
{
"name": "Cost",
"type": "Number"
},
{
"name": "BillingMonth",
"type": "Datetime"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
43.19129521752406,
"2022-09-01T00:00:00",
"EUR"
],
[
61.30075222086911,
"2022-08-01T00:00:00",
"EUR"
],
[
37.593943340208604,
"2022-07-01T00:00:00",
"EUR"
]
]
}
}
In this block I get the data:
I probably need to do some additional formatting, but I'm not sure how and where.
I see the same error with "Time Chart" and other chart controls. As a test, I used the export parameter and then read in the selected row (you can see the ARG query), and you can build a chart from the results - so the data is good.
The data shows as the right type as well, its a puzzle, I will have a think on this
- PmeemsSep 28, 2022Copper Contributor