Page 1 of 1

Usage of popup graph window

Posted: Thursday 13 August 2020 12:33
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',
	}
}

Re: Usage of popup graph window

Posted: Thursday 13 August 2020 13:02
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

Re: Usage of popup graph window

Posted: Thursday 13 August 2020 13:19
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',
	}
}


Re: Usage of popup graph window

Posted: Thursday 13 August 2020 15:08
by Lokonli
I think you have to add the devices parameter as well, like:
[block]
devices: [41]
[/block]

Re: Usage of popup graph window

Posted: Friday 14 August 2020 15:11
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?

Re: Usage of popup graph window

Posted: Saturday 15 August 2020 0:00
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',
	}
}

Re: Usage of popup graph window

Posted: Monday 17 August 2020 13:29
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!!!