Usage of popup graph window

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Usage of popup graph window

Post by NilsNijenhuis »

I like to make a popup graph and put the graph (1) as a popup under block (2) -> see attachment
if i use the code beneath i get an empty popup???

i did nog adjust the code of the graph, i only added -> blocks[p1_gas_vandaag]['popup'] = 'p1_grafiek_gas';
am i doing something wrong?

Code: Select all

blocks[p1_gas_vandaag] = {}
blocks[p1_gas_vandaag]['width'] = 6;
blocks[p1_gas_vandaag]['title'] = 'Gas vandaag';
blocks[p1_gas_vandaag]['show_lastupdate'] = false;
blocks[p1_gas_vandaag]['protected'] = true;
blocks[p1_gas_vandaag]['popup'] = 'p1_grafiek_gas';

// Definition 'Gas' graph
blocks[p1_grafiek_gas] = {
  title: 'Gas',
  custom : {
        "maand": {
            range: 'year',
	    datasetColors: ['yellow'],
	    graph: 'bar',
            filter: '1 months',
            data: {
                     m3: 'd.v_41',
		     }
		},
        "dag": {
	    graph: 'line',
	    datasetColors: ['yellow'],
            range: 'day',
            filter: '24 hours',
            data: {
                verbruik: 'd.v_41',
            }        
        }
    },
  legend: false,
  datasetColors: ['gray'],
	  displayFormats : {
	  minute: 'h:mm',
	  hour: 'h:mm',
	  day: 'DD MMM',
	  week: 'DD MMM',
	  month: 'MMM',
	}
}
Attachments
dashboard.jpg
dashboard.jpg (156.67 KiB) Viewed 462 times
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Usage of popup graph window

Post by Lokonli »

NilsNijenhuis wrote: Thursday 13 August 2020 12:33 I like to make a popup graph and put the graph (1) as a popup under block (2) -> see attachment
if i use the code beneath i get an empty popup???

i did nog adjust the code of the graph, i only added -> blocks[p1_gas_vandaag]['popup'] = 'p1_grafiek_gas';
am i doing something wrong?

Code: Select all

blocks[p1_gas_vandaag] = {}
blocks[p1_gas_vandaag]['width'] = 6;
blocks[p1_gas_vandaag]['title'] = 'Gas vandaag';
blocks[p1_gas_vandaag]['show_lastupdate'] = false;
blocks[p1_gas_vandaag]['protected'] = true;
blocks[p1_gas_vandaag]['popup'] = 'p1_grafiek_gas';

// Definition 'Gas' graph
blocks[p1_grafiek_gas] = {
  title: 'Gas',
  custom : {
        "maand": {
            range: 'year',
	    datasetColors: ['yellow'],
	    graph: 'bar',
            filter: '1 months',
            data: {
                     m3: 'd.v_41',
		     }
		},
        "dag": {
	    graph: 'line',
	    datasetColors: ['yellow'],
            range: 'day',
            filter: '24 hours',
            data: {
                verbruik: 'd.v_41',
            }        
        }
    },
  legend: false,
  datasetColors: ['gray'],
	  displayFormats : {
	  minute: 'h:mm',
	  hour: 'h:mm',
	  day: 'DD MMM',
	  week: 'DD MMM',
	  month: 'MMM',
	}
}
Try:

Code: Select all

blocks['p1_grafiek_gas']
instead of

Code: Select all

blocks[p1_grafiek_gas]
And probably the same for p1_gas_vandaag
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Usage of popup graph window

Post by NilsNijenhuis »

i change it -> blocks['p1_grafiek_gas']
and that gives empty window.

i tried the Original "graph_41" but it also gives me an empty popup see attachment

Code: Select all

blocks[p1_gas_vandaag] = {}
blocks[p1_gas_vandaag]['width'] = 6;
blocks[p1_gas_vandaag]['title'] = 'Gas vandaag';
blocks[p1_gas_vandaag]['show_lastupdate'] = false;
blocks[p1_gas_vandaag]['protected'] = true;
blocks[p1_gas_vandaag]['popup'] = 'graph_41';

// Definition 'Gas' graph
blocks['graph_41'] = {
  title: 'Gas',
  //width: 6,
  //height: '200px',
  custom : {
        "maand": {
            range: 'year',
			datasetColors: ['yellow'],
			graph: 'bar',
            filter: '1 months',
            data: {
                m3: 'd.v_41',
			}
		},
        "dag": {
			graph: 'line',
				datasetColors: ['yellow'],
            range: 'day',
            filter: '24 hours',
            data: {
                verbruik: 'd.v_41',
            }        
        }
    },
  legend: false,
  datasetColors: ['gray'],
	  displayFormats : {
	  minute: 'h:mm',
	  hour: 'h:mm',
	  day: 'DD MMM',
	  week: 'DD MMM',
	  month: 'MMM',
	}
}

Attachments
dashboard.jpg
dashboard.jpg (142.8 KiB) Viewed 455 times
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Usage of popup graph window

Post by Lokonli »

I think you have to add the devices parameter as well, like:
[block]
devices: [41]
[/block]
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Usage of popup graph window

Post by NilsNijenhuis »

i did that already with

Code: Select all

var p1_gas                    = 41;
var p1_gas_vandaag      = '41_1';
var p1_gas_totaal         = '41_2'; 
and

Code: Select all

blocks[p1_gas] = {}
blocks[p1_gas]['width'] = 6;
blocks[p1_gas]['show_lastupdate'] = false;
blocks[p1_gas]['protected'] = true;

blocks[p1_gas_vandaag] = {}
blocks[p1_gas_vandaag]['width'] = 6;
blocks[p1_gas_vandaag]['title'] = 'Gas vandaag';
blocks[p1_gas_vandaag]['show_lastupdate'] = false;
blocks[p1_gas_vandaag]['protected'] = true;
blocks[p1_gas_vandaag]['popup'] = 'graph_41';

blocks[p1_gas_totaal] = {}
blocks[p1_gas_totaal]['width'] = 6;
blocks[p1_gas_totaal]['title'] = 'Gas Totaal';
blocks[p1_gas_totaal]['show_lastupdate'] = false;
blocks[p1_gas_totaal]['protected'] = true;
or did you mean something else?
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Usage of popup graph window

Post by Lokonli »

NilsNijenhuis wrote: Friday 14 August 2020 15:11 i did that already with

Code: Select all

var p1_gas                    = 41;
var p1_gas_vandaag      = '41_1';
var p1_gas_totaal         = '41_2'; 
and

Code: Select all

blocks[p1_gas] = {}
blocks[p1_gas]['width'] = 6;
blocks[p1_gas]['show_lastupdate'] = false;
blocks[p1_gas]['protected'] = true;

blocks[p1_gas_vandaag] = {}
blocks[p1_gas_vandaag]['width'] = 6;
blocks[p1_gas_vandaag]['title'] = 'Gas vandaag';
blocks[p1_gas_vandaag]['show_lastupdate'] = false;
blocks[p1_gas_vandaag]['protected'] = true;
blocks[p1_gas_vandaag]['popup'] = 'graph_41';

blocks[p1_gas_totaal] = {}
blocks[p1_gas_totaal]['width'] = 6;
blocks[p1_gas_totaal]['title'] = 'Gas Totaal';
blocks[p1_gas_totaal]['show_lastupdate'] = false;
blocks[p1_gas_totaal]['protected'] = true;
or did you mean something else?
I mean in the block definition of the graph block. like:

Code: Select all

blocks['graph_41'] = {
  devices: [41],
  title: 'Gas',
  //width: 6,
  //height: '200px',
  custom : {
        "maand": {
            range: 'year',
			datasetColors: ['yellow'],
			graph: 'bar',
            filter: '1 months',
            data: {
                m3: 'd.v_41',
			}
		},
        "dag": {
			graph: 'line',
				datasetColors: ['yellow'],
            range: 'day',
            filter: '24 hours',
            data: {
                verbruik: 'd.v_41',
            }        
        }
    },
  legend: false,
  datasetColors: ['gray'],
	  displayFormats : {
	  minute: 'h:mm',
	  hour: 'h:mm',
	  day: 'DD MMM',
	  week: 'DD MMM',
	  month: 'MMM',
	}
}
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Usage of popup graph window

Post by NilsNijenhuis »

i know what is going wrong, i was using :

Code: Select all

var p1_grafiek_gas      	  = 'graph_41'; 
and was using the name in the blocks and columns

Code: Select all

p1_grafiek_gas

and i was missing

Code: Select all

devices: [41], 
without the var line and with the devices: [41] it works:

thanks!!!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest