added elevation summary (#2449)

Implements #2439
This commit is contained in:
coreGreenberet
2022-02-09 17:13:08 +01:00
committed by GitHub
parent c89088f7d6
commit b9dc86aa71
+108 -1
View File
@@ -22,7 +22,8 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"iteration": 1642784325385,
"id": 20,
"iteration": 1644262750775,
"links": [
{
"icon": "dashboard",
@@ -985,6 +986,112 @@
"align": false
}
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 2,
"w": 12,
"x": 0,
"y": 31
},
"id": 20,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "vertical",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "/.*/",
"values": false
},
"text": {},
"textMode": "value_and_name"
},
"pluginVersion": "8.3.4",
"targets": [
{
"datasource": "TeslaMate",
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "WITH height as (SELECT\n\televation-LAG(elevation,1) over ( order BY\n\tdate ASC ) as diff\nFROM\n\tpositions\nWHERE\n car_id = $car_id AND\n $__timeFilter(date)\nORDER BY\n\tdate ASC\n\t)\n\t\n\nselect convert_m(sum(diff), '$alternative_length_unit') || ' $alternative_length_unit' as \"UP\" from height where diff > 0",
"refId": "A",
"select": [
[
{
"params": [
"start_km"
],
"type": "column"
}
]
],
"table": "drives",
"timeColumn": "start_date",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
},
{
"datasource": "TeslaMate",
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "WITH height as (SELECT\n\televation-LAG(elevation,1) over ( order BY\n\tdate ASC ) as diff\nFROM\n\tpositions\nWHERE\n car_id = $car_id AND\n $__timeFilter(date)\nORDER BY\n\tdate ASC\n\t)\n\t\n\t\nselect convert_m(sum(diff), '$alternative_length_unit') || ' $alternative_length_unit' as \"DOWN\" from height where diff < 0",
"refId": "B",
"select": [
[
{
"params": [
"start_km"
],
"type": "column"
}
]
],
"table": "drives",
"timeColumn": "start_date",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Elevation Summary",
"type": "stat"
},
{
"datasource": "TeslaMate",
"fieldConfig": {