31.10.2025, 11:59
It should already be possible to do using HTML widget.
|
chartist to display nice pie...
|
|
31.10.2025, 11:59
It should already be possible to do using HTML widget.
Ok, thanks. But in that case using CSS and not Chartist.js..?
Because I also have some of these: Code: // UPS Load
31.10.2025, 12:44
Old JS examples won't work. New Visu does not use jQuery so the $ function won't work. localbus should be used instead of grp. Function reference: https://kb.logicmachine.net/misc/visu/
A major difference is that old visu rendered all plans and widgets once loaded but new Visu renders only the currently active plan.
03.11.2025, 13:28
This turned a bit off topic, but... I can use this:
Code: localbus.listen('object', '35/0/6', (value) => {and have this in a html-widget: Code: <progress id="p1" value="0" max="100"></progress>and it works - after the first update of 35/0/6. Since the JS is run before the page is completely rendered, I have no way to have this value from start. I'm sure there is a workaround I just don't understand..?
03.11.2025, 13:43
(31.10.2025, 12:36)stianj Wrote: Ok, thanks. But in that case using CSS and not Chartist.js..? hello. I wasn't aware of this change. so it mean if we upgrade our customer building that use chartist, they will not have it working anymore ?
-----------
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION SE ECO EXPERT
03.11.2025, 13:48
@stianj, you need to listen to widget-ready and widget-hide events and only then execute localbus.listen / localbus.unlisten.
Or you can use slider in read-only mode without the handle to display a progress bar. Set Additional classes to slider-progress. You can adjust active / inactive color as needed. Code: .slider-progress {@domotiqa, as mentioned before any Custom JS and CSS from old visu won't work with new Visu.
03.11.2025, 14:49
Thanks, using the slider widget is the right solution here (especially since I wasn't able to get any listen-events working). But this is much cleaner anyway.
Code: .slider-progress {But it's minimum width of 200px is a bit too much for me. 150 would be much better ? And to get back on topic, would still really, really like a way to use Chartist.js or another similar library.
Yesterday, 11:43
(30.10.2025, 13:57)admin Wrote: What exactly do you want to display in this chart? Maybe making a new widget for this is a better solution. Maybe I've changed my mind. The trend widget is actually quite good. So if there would be a widget that resembles the Home Assistant history graph then I would be happy ![]() (Of course, given identical size and time span/resolution, the x-axis must match the trend widget) For me that would be incredibly useful! ?
Yesterday, 12:03
Here's a working example for HTML progress element.
HTML widget contents: Code: <progress max="100" class="w-100"></progress>Custom JS, change widgetId and addr as needed: Code: const widgetId = 123Trends cannot be used to display on/off times for a binary object. Trends aggregate the data without storing changes as exact timestamps. For this you need something like Graph widget from old visu that uses data from object logs.
Really appreciate the example, it will for sure be useful for other things! Thank you!
And yes, I didn't mean that the Trends widget could or should be used for showing on/off states. But I was hoping you'd consider making a separate widget that does just this. It's an very convenient way of visualizing the object logs... |
|
« Next Oldest | Next Newest »
|