From e977c6d3ebd7c7d2ae301b9ea35d97baaa2466a6 Mon Sep 17 00:00:00 2001
From: Bjarke Madsen <bjarke.madsen@geant.org>
Date: Wed, 10 Mar 2021 16:15:26 +0100
Subject: [PATCH] Modify panel template to support more stuff

---
 .../templating/templates/shared/panel.json.j2 | 23 +++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/brian_dashboard_manager/templating/templates/shared/panel.json.j2 b/brian_dashboard_manager/templating/templates/shared/panel.json.j2
index f3e2389..005e069 100644
--- a/brian_dashboard_manager/templating/templates/shared/panel.json.j2
+++ b/brian_dashboard_manager/templating/templates/shared/panel.json.j2
@@ -1,10 +1,15 @@
-{
+{   
+    {% if alias_colors %}
+    "aliasColors": {{ alias_colors }},
+    {% else %}
     "aliasColors": {},
+    {% endif %}
     "bars": false,
     "collapsed": null,
     "dashLength": 10,
     "dashes": false,
     "datasource": "{{ datasource }}",
+    "decimals": 2,
     "fieldConfig": {
         "defaults": {
             "custom": {}
@@ -12,15 +17,20 @@
         "overrides": []
     },
     "fill": 1,
-    "fillGradient": 5,
+    "fillGradient": 10,
     "gridPos": {
         "h": {{ height }},
         "w": {{ width }},
+        {% if x %}
+        "x": {{ x }},
+        {% else %}
         "x": 0,
+        {% endif %}
         "y": {{ y }}
     },
     "hiddenSeries": false,
     "id": {{ id }},
+    {% if not disable_legend %}
     "legend": {
         "alignAsTable": true,
         "avg": true,
@@ -32,8 +42,9 @@
         "total": false,
         "values": true
     },
+    {% endif %}
     "lines": true,
-    "linewidth": 1,
+    "linewidth": {{ linewidth }},
     "nullPointMode": "null",
     "options": {
         "alertThreshold": true
@@ -45,7 +56,11 @@
     "search": null,
     "seriesOverrides": [],
     "spaceLength": 10,
-    "stack": null,
+    {% if stack %}
+    "stack": true,
+    {% else %}
+    "stack": false,
+    {% endif %}
     "steppedLine": false,
     "tags": null,
     "thresholds": [],
-- 
GitLab