Charts: Send theme
parameter for default
charts
#226
Charts: Send theme
parameter for default
charts
#226
Conversation
@hreichert thanks for your PR, appreciate the effort! 👍 Unsure about the approach with the switch block though - as new themes are eventually added (and while they're hardcoded right now, they might be dynamically added in the future) we'd have to deal with those switch cases as well. What I would suggest instead is adding 2 additional settings to the chart widget so that the user could choose between the dark or light theme and whether to display the legend while configuring the widget. Those options would only appear if the "default" chart type is selected. Let me know what you think 😃 |
@ghys Thanks for your response! At least in ESH, the consens was, that the "UI provider" has to decide, which theme gets rendered. In my personal opinion, I find the "automatic" solution better, but I could live with a manual setting.
Do you see any kind of possibility to integrate the "chart theme name" in the existing theme files, to have a cleaner implementation? |
All things considered, you're right, the chart theme should be tied to the HABPanel theme.
Absolutely, I even have a clean solution in mind.
Therefore it makes perfect sense to add a new theme variable for the chart's theme - let's say
Here we use Then in each of the CSS files in web/assets/styles/themes you would need to add a new variable like:
(for instance after |
Well, that sounds like a plan! |
theme
parameter for default
chartstheme
parameter for default
charts
437cb9f
to
77c479b
Compare
theme
parameter for default
chartstheme
parameter for default
charts
77c479b
to
9e7b3bc
Compare
Take a matching chart theme for the current habpanel theme and send it to the ESH chart servlet. Signed-off-by: Holger Reichert <mail@h0lger.de>
@hreichert looks good! |
Take a matching chart theme for the current habpanel theme and send it to the ESH chart servlet.
The ESH
DefaultChartProvider
recently got a new feature to support different themes:eclipse-archived/smarthome#4291
This change adds the
&theme=xxx
parameter to the servlet URL, based on the current habpanel theme.