Hi
Im doing some finops analytics from Azure !
Im using infinity datasource !
I want to show price by day with stacked value of each service
exemple:
For the moment my result look like this !
I have the total of the day but no stacked values !
Im using those transformations :
"transformations": [
{
"id": "extractFields",
"options": {
"replace": true,
"source": "A"
}
},
{
"id": "organize",
"options": {
"excludeByName": {},
"indexByName": {
"0": 0,
"1": 1,
"2": 2,
"3": 3
},
"renameByName": {
"0": "Cost",
"1": "Date",
"2": "ServiceName",
"3": "Currency"
},
"includeByName": {}
}
},
{
"id": "groupBy",
"options": {
"fields": {
"Cost": {
"aggregations": [
"sum"
],
"operation": "aggregate"
},
"Date": {
"aggregations": [],
"operation": "groupby"
},
"ServiceName": {
"aggregations": [
"allValues"
],
"operation": "aggregate"
}
}
}
}
]
one data row look like this :
[1.2,20241001,"VM","EUR"]
I also want to make the date look like this
2024-10-09 insted of 20241009
Thanks
In case you want the ful pannel json
{
"datasource": {
"default": false,
"uid": "ee0fp0b2eyqdcb",
"type": "yesoreyeram-infinity-datasource"
},
"fieldConfig": {
"defaults": {
"custom": {
"lineWidth": 1,
"fillOpacity": 80,
"gradientMode": "none",
"axisPlacement": "auto",
"axisLabel": "",
"axisColorMode": "text",
"axisBorderShow": false,
"scaleDistribution": {
"type": "linear"
},
"axisCenteredZero": false,
"hideFrom": {
"tooltip": false,
"viz": false,
"legend": false
},
"thresholdsStyle": {
"mode": "line"
}
},
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 24,
"x": 0,
"y": 1
},
"id": 5,
"options": {
"orientation": "vertical",
"xTickLabelRotation": 0,
"xTickLabelSpacing": 0,
"showValue": "always",
"stacking": "none",
"groupWidth": 0.7,
"barWidth": 0.75,
"barRadius": 0,
"fullHighlight": false,
"tooltip": {
"mode": "multi",
"sort": "none"
},
"legend": {
"showLegend": true,
"displayMode": "list",
"placement": "bottom",
"calcs": []
},
"colorByField": "Cost",
"xField": "Date"
},
"pluginVersion": "11.2.2",
"targets": [
{
"datasource": {
"type": "yesoreyeram-infinity-datasource",
"uid": "ee0fp0b2eyqdcb"
},
"columns": [],
"filters": [],
"format": "table",
"global_query_id": "",
"parser": "backend",
"refId": "A",
"root_selector": "properties.rows[*]",
"source": "url",
"type": "json",
"url": "https://management.azure.com/subscriptions/e8134c01-8d85-4322-b67b-0d4259dd8fdc/providers/Microsoft.CostManagement/query?api-version=2023-11-01",
"url_options": {
"body_content_type": "application/json",
"body_type": "raw",
"data": "{\n \"type\": \"Usage\",\n \"timeframe\": \"Custom\",\n \"timePeriod\": {\n \"from\": \"$from\",\n \"to\": \"$to\"\n },\n \"dataset\": {\n \"granularity\": \"Daily\",\n \"aggregation\": {\n \"totalCost\": {\n \"name\": \"Cost\",\n \"function\": \"Sum\"\n }\n },\n \"grouping\": [\n {\n \"type\": \"Dimension\",\n \"name\": \"ServiceName\"\n }\n ]\n }\n}",
"method": "POST"
}
}
],
"title": "Usage Cost - Applied Duration",
"transformations": [
{
"id": "extractFields",
"options": {
"replace": true,
"source": "A"
}
},
{
"id": "organize",
"options": {
"excludeByName": {},
"indexByName": {
"0": 0,
"1": 1,
"2": 2,
"3": 3
},
"renameByName": {
"0": "Cost",
"1": "Date",
"2": "ServiceName",
"3": "Currency"
},
"includeByName": {}
}
},
{
"id": "groupBy",
"options": {
"fields": {
"Cost": {
"aggregations": [
"sum"
],
"operation": "aggregate"
},
"Date": {
"aggregations": [],
"operation": "groupby"
},
"ServiceName": {
"aggregations": [
"allValues"
],
"operation": "aggregate"
}
}
}
}
],
"type": "barchart"
}