From a20678c3c15b6c51f9ffdf0751d3639caa3cf0f3 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 10 May 2023 13:16:46 +0200 Subject: [PATCH] FEATURE: Add support for tooltip sorting --- grafana_dashboards/components/panels.py | 1 + tests/grafana_dashboards/components/graph/full.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/grafana_dashboards/components/panels.py b/grafana_dashboards/components/panels.py index b53db1e..3bba520 100644 --- a/grafana_dashboards/components/panels.py +++ b/grafana_dashboards/components/panels.py @@ -81,6 +81,7 @@ def gen_json_from_data(self, data, context): panel_json['tooltip'] = { 'value_type': self.data['tooltip'].get('value_type', 'individual'), 'shared': self.data['tooltip'].get('shared', False), + 'sort': self.data['tooltip'].get('sort', 0), } if 'seriesOverrides' in self.data: overrides = [] diff --git a/tests/grafana_dashboards/components/graph/full.json b/tests/grafana_dashboards/components/graph/full.json index dd1ffc8..f31fc3f 100644 --- a/tests/grafana_dashboards/components/graph/full.json +++ b/tests/grafana_dashboards/components/graph/full.json @@ -55,7 +55,8 @@ }, "tooltip": { "value_type": "cumulative", - "shared": true + "shared": true, + "sort": 0 }, "seriesOverrides": [ {