diff --git a/docs/sources/features/panels/singlestat.md b/docs/sources/features/panels/singlestat.md index e16f182f9cd..9808446a2ce 100644 --- a/docs/sources/features/panels/singlestat.md +++ b/docs/sources/features/panels/singlestat.md @@ -57,8 +57,10 @@ Sparklines are a great way of seeing the historical data related to the summary 1. **Show**: The show checkbox will toggle whether the spark line is shown in the Panel. When unselected, only the Singlestat value will appear. 2. **Full Height**: Check if you want the sparklines to take up the full panel height, or uncheck if they should be below the main Singlestat value. -3. **Line Color**: This color selection applies to the color of the sparkline itself. -4. **Fill Color**: This color selection applies to the area below the sparkline. +3. **Y-Min**: The minimum Y value. (default auto) +4. **Y-Max**: The maximum Y value. (default auto) +5. **Line Color**: This color selection applies to the color of the sparkline itself. +6. **Fill Color**: This color selection applies to the area below the sparkline.
diff --git a/public/app/plugins/panel/singlestat/editor.html b/public/app/plugins/panel/singlestat/editor.html index dd9ca55a760..86244423ab7 100644 --- a/public/app/plugins/panel/singlestat/editor.html +++ b/public/app/plugins/panel/singlestat/editor.html @@ -88,6 +88,14 @@
+
+ + +
+
+ + +
diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index 3272323c354..70f897ff2b1 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -67,6 +67,8 @@ class SingleStatCtrl extends MetricsPanelCtrl { sparkline: { show: false, full: false, + ymin: null, + ymax: null, lineColor: 'rgb(31, 120, 193)', fillColor: 'rgba(31, 118, 189, 0.18)', }, @@ -548,12 +550,15 @@ class SingleStatCtrl extends MetricsPanelCtrl { lines: { show: true, fill: 1, - zero: false, lineWidth: 1, fillColor: getColorFromHexRgbOrName(panel.sparkline.fillColor, config.theme.type), }, }, - yaxes: { show: false }, + yaxes: { + show: false, + min: panel.sparkline.ymin, + max: panel.sparkline.ymax, + }, xaxis: { show: false, mode: 'time',