Graph question

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
Pauls
Posts: 28
Joined: Sunday 19 June 2016 9:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Graph question

Post by Pauls »

Maybe somebody can help me with the following issue.
I have a simple graph for my P1 meter.
All works fine, but the week view shows the same value as my day value.
I would assume that for the week view, all the values of the 7 days will be added up?
Also the month and year does the same.
What am i doing wrong?

Code: Select all

//Stroom
blocks['graph_496'] = {
    title: 'Stroom verbruik',
    devices: [496],
    graph: ['bar','bar'],
    spanGaps: true,
    beginAtZero: [false, false],
    toolTipStyle: true,
    stacked: true,
    zoom: 'xy',
    custom : {
        "afgelopen 24 uur": {
		range: 'last',
        	groupBy: 'hour',
        	filter: '24 hours',
		data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
	        }
	},
        "per dag": {
		range: 'month',
        	groupBy: 'day',
        	filter: '14 days',	   
		data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
		}
        },
        "per week": {
            	range: 'month',
		groupBy: 'week',
		filter: '8 weeks',
		data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
              }
        },
        "per maand": {
            	range: 'year',
		groupBy: 'month',
            	filter: '12 months',
            	data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
              }
        },
	"per jaar": {
            	range: 'year',
		groupBy: 'year',
            	filter: '1 year',
            	data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
             }
        }
    },
    legend: true, 
    datasetColors:['blue','red']
}
Pauls
Posts: 28
Joined: Sunday 19 June 2016 9:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Graph question

Post by Pauls »

Hi guys,
Meanwhile searched the forum and the "show yours", but the graph code (blocks and config) shows the same.
Really nobody with the same problem (and hopefully the answer)?
Lokonli
Posts: 2262
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Graph question

Post by Lokonli »

Pauls wrote: Monday 27 June 2022 19:58 Maybe somebody can help me with the following issue.
I have a simple graph for my P1 meter.
All works fine, but the week view shows the same value as my day value.
I would assume that for the week view, all the values of the 7 days will be added up?
Also the month and year does the same.
What am i doing wrong?

Code: Select all

//Stroom
blocks['graph_496'] = {
    title: 'Stroom verbruik',
    devices: [496],
    graph: ['bar','bar'],
    spanGaps: true,
    beginAtZero: [false, false],
    toolTipStyle: true,
    stacked: true,
    zoom: 'xy',
    custom : {
        "afgelopen 24 uur": {
		range: 'last',
        	groupBy: 'hour',
        	filter: '24 hours',
		data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
	        }
	},
        "per dag": {
		range: 'month',
        	groupBy: 'day',
        	filter: '14 days',	   
		data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
		}
        },
        "per week": {
            	range: 'month',
		groupBy: 'week',
		filter: '8 weeks',
		data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
              }
        },
        "per maand": {
            	range: 'year',
		groupBy: 'month',
            	filter: '12 months',
            	data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
              }
        },
	"per jaar": {
            	range: 'year',
		groupBy: 'year',
            	filter: '1 year',
            	data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
             }
        }
    },
    legend: true, 
    datasetColors:['blue','red']
}
Dashticz can't read your mind :)

By default Dashticz will assume you want to show the average of the grouped values. If you want to show the sum, add the following to the block definition:

Code: Select all

aggregate:'sum',
Lokonli
Posts: 2262
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Graph question

Post by Lokonli »

Lokonli wrote: Monday 04 July 2022 22:26
Pauls wrote: Monday 27 June 2022 19:58 Maybe somebody can help me with the following issue.
I have a simple graph for my P1 meter.
All works fine, but the week view shows the same value as my day value.
I would assume that for the week view, all the values of the 7 days will be added up?
Also the month and year does the same.
What am i doing wrong?

Code: Select all

//Stroom
blocks['graph_496'] = {
    title: 'Stroom verbruik',
    devices: [496],
    graph: ['bar','bar'],
    spanGaps: true,
    beginAtZero: [false, false],
    toolTipStyle: true,
    stacked: true,
    zoom: 'xy',
    custom : {
        "afgelopen 24 uur": {
		range: 'last',
        	groupBy: 'hour',
        	filter: '24 hours',
		data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
	        }
	},
        "per dag": {
		range: 'month',
        	groupBy: 'day',
        	filter: '14 days',	   
		data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
		}
        },
        "per week": {
            	range: 'month',
		groupBy: 'week',
		filter: '8 weeks',
		data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
              }
        },
        "per maand": {
            	range: 'year',
		groupBy: 'month',
            	filter: '12 months',
            	data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
              }
        },
	"per jaar": {
            	range: 'year',
		groupBy: 'year',
            	filter: '1 year',
            	data: {
                laag: 'd.v_496',
                hoog: 'd.v2_496',
             }
        }
    },
    legend: true, 
    datasetColors:['blue','red']
}
Dashticz can't read your mind :)

By default Dashticz will assume you want to show the average of the grouped values. If you want to show the sum, add the following to the block definition:

Code: Select all

aggregate:'sum',
And I see that groupBy:'year' doesn't work at the moment. I'll fix that.
Pauls
Posts: 28
Joined: Sunday 19 June 2016 9:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Graph question

Post by Pauls »

Thanks Lokonli,

I had added aggregate, but instead of "sum" i tried something like week or so.
Nevertheless, it's working now.
About the year bug, that will need a new dashticz version?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest