diff --git a/octoprint_toptemp/__init__.py b/octoprint_toptemp/__init__.py index cba0352..ab01352 100644 --- a/octoprint_toptemp/__init__.py +++ b/octoprint_toptemp/__init__.py @@ -103,6 +103,7 @@ def __init__(self): 'graphSettings': { 'height': 50, 'show': True, + 'forceStyle': False, 'opa': 0.2, 'width': 1, 'color' : '#000000', diff --git a/octoprint_toptemp/static/js/TopTemp.js b/octoprint_toptemp/static/js/TopTemp.js index 69a4e07..10e9875 100644 --- a/octoprint_toptemp/static/js/TopTemp.js +++ b/octoprint_toptemp/static/js/TopTemp.js @@ -1544,10 +1544,25 @@ $(function() { // Add CSS for the graphs self.setGraphStyle = function(name,settings){ + var important = ""; + if (settings.forceStyle()){ + important = " !important"; + } // Remove old $('#TopTempGraph_'+name+'_style').remove(); + + var styleSet = ` + #TopTempGraph_${name}_graph{ + height:${settings.height()}%${important}; + } + #TopTempGraph_${name}_graph.TopTempGraph > svg >g .ct-line{ + stroke-width: ${settings.width()}px${important}; + stroke-opacity: ${settings.opa()}${important}; + stroke: ${settings.color()}${important}; + }`; + // Build new - $('head').append('' ); + $('head').append(''); // Show the graph? if (settings.show){ $('#TopTempGraph_'+name+'_graph').show(); diff --git a/octoprint_toptemp/templates/toptemp_settings.jinja2 b/octoprint_toptemp/templates/toptemp_settings.jinja2 index 48ef225..7f3cdfc 100644 --- a/octoprint_toptemp/templates/toptemp_settings.jinja2 +++ b/octoprint_toptemp/templates/toptemp_settings.jinja2 @@ -199,6 +199,13 @@
+
+
+ +
+
@@ -353,6 +360,13 @@
+
+
+ +
+
@@ -514,6 +528,13 @@
+
+
+ +
+
@@ -729,6 +750,13 @@
+
+
+ +
+