This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

chartist to display nice pie...
#49
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 = 123
const addr = '1/2/3'
let progress

function onChange(value) {
  progress.value = value
}

Visu.on('widget-ready', widgetId, ({ widget }) => {
  progress = widget.getEl().querySelector('progress')
  localbus.listen('object', addr, onChange)
})

Visu.on('widget-hide', widgetId, () => {
  localbus.unlisten('object', addr, onChange)
})



Trends 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.
Reply


Messages In This Thread
chartist to display nice pie... - by domotiqa - 05.01.2022, 08:56
RE: chartist to display nice pie... - by jmir - 14.02.2022, 11:32
RE: chartist to display nice pie... - by jmir - 14.02.2022, 13:34
RE: chartist to display nice pie... - by jmir - 15.02.2022, 11:15
RE: chartist to display nice pie... - by Acla - 12.06.2023, 05:05
RE: chartist to display nice pie... - by JRP - 08.09.2022, 16:18
RE: chartist to display nice pie... - by Acla - 12.06.2023, 15:44
RE: chartist to display nice pie... - by jmir - 25.03.2024, 14:49
RE: chartist to display nice pie... - by admin - 04.11.2025, 12:03

Forum Jump: