Page 1 of 1

[solved] Popup graphs to use block definitions

Posted: Saturday 15 February 2020 15:17
by Sjonnie2017
With the huge overhaul of the graphs functionality of Dashticz, one feature would be very very welcome to create a consistent user interface:

Popup graphs to use settings of corresponding block definitions.

As it is now the graphs on the dashboard are looking at the block definitions and they are rather consistent in their appearance. Unfortunately the popup graphs ignore these definitions and therefor look different from the graphs on the dashboard.

More info here: https://www.domoticz.com/forum/viewtopi ... 40#p236891 and subsequent replies.

TIA

Greetz,

Sjonnie

Re: Popup graphs to use block definitions

Posted: Tuesday 25 February 2020 9:28
by clinkadink
This is now available in the latest beta.

Popups can now be defined by adding a new block parameter, “popup”, to the block that popup is for. This allows the popup to use all the block parameters that a graph block does, allowing users to style the graph however they want. It also means the legend and tooltips can display custom names (instead of the key names). Note: this replaces the CSS method provided in the previous beta update.

For example, the user as an Energy meter block defined as follows:
Spoiler: show

Code: Select all

blocks[258] = {
    title: 'Consumption',
    flash: 500,
    width: 4,
    popup: 'popup_consumption'
}
In this example, I have specified that the popup will use a defined graph called 'popup_consumption' instead of the default popup. This defined graph is then added to the config.js just like a normal graph:
Spoiler: show

Code: Select all

blocks['popup_consumption'] = {
    title: 'Energy Consumption Popup',
    devices: [258],
    toolTipStyle: true,
    datasetColors: ['red', 'yellow'],
    graph: 'line',
    legend: {
        'v_258' : 'Usage',          
        'c_258' : 'Total'
    }
}
Image

Re: Popup graphs to use block definitions

Posted: Tuesday 25 February 2020 18:34
by Sjonnie2017
Excellent! A few glitches to work out on my side of things but nothing major :lol: