Skip to content

Commit

Permalink
add theme support to power graph
Browse files Browse the repository at this point in the history
  • Loading branch information
jneilliii committed Oct 8, 2022
1 parent fa52cc9 commit 5556ef1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions octoprint_tasmota/static/js/tasmota.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,20 @@ $(function() {
}
}

var background_color = ($('.tab-content').css('background-color') == 'rgba(0, 0, 0, 0)') ? '#FFFFFF' : $('.tab-content').css('background-color');
var foreground_color = ($('.tab-content').css('color') == 'rgba(0, 0, 0, 0)') ? '#FFFFFF' : $('#tabs_content').css('color');

var layout = {
autosize: true,
showlegend: false,
/* legend: {"orientation": "h"}, */
xaxis: { type:"date", /* tickformat:"%H:%M:%S", */ automargin: true, title: {standoff: 0},linecolor: 'black', linewidth: 2, mirror: true},
yaxis: { type:"linear", automargin: true, title: {standoff: 0},linecolor: 'black', linewidth: 2, mirror: true },
margin: {l:35,r:30,b:0,t:20,pad:5}
}
margin: {l:35,r:30,b:0,t:20,pad:5},
plot_bgcolor: background_color,
paper_bgcolor: background_color,
font: {color: foreground_color}
};

var options = {
showLink: false,
Expand All @@ -248,7 +254,7 @@ $(function() {
displayModeBar: false,
editable: false,
showTips: false
}
};

Plotly.react('tasmota_graph', traces, layout, options);
});
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "OctoPrint-Tasmota"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.1.3rc4"
plugin_version = "1.1.3rc5"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit 5556ef1

Please sign in to comment.