Page 3 of 3

Re: [Experimental] New graph module. Testers needed.

Posted: Friday 13 September 2019 17:25
by Lokonli
Could you post the resulting graph of the two previous steps? Just to check the results.

Re: [Experimental] New graph module. Testers needed.

Posted: Friday 13 September 2019 22:00
by madradrakie
Lokonli wrote: Friday 13 September 2019 17:25 Could you post the resulting graph of the two previous steps? Just to check the results.
This is the code i used:

Code: Select all

blocks['graph_903'] = {
    graph: 'bar',
    datasetColors: ['lightblue'],
    legend: true,
    custom : {
        "last hours": {
            range: 'day',
            filter: '6 hours',
            data: {
                liter: 'd.v*100'            }
            },

 	"today": {
            range: 'day',
            filter: '12 hours',
            data: {
                liter: 'd.v*100'            }
            },
	
	"last week": {
            range: 'month',
            filter: '7 days',
            data: {
                liter: 'd.v*1000'            }
            }


        }
   }
And this is the result:
Knipsel3.JPG
Knipsel3.JPG (59.28 KiB) Viewed 1097 times
Knipsel2.JPG
Knipsel2.JPG (54.74 KiB) Viewed 1097 times
Do you know how to adjust the x-values of the last week graph? It now shows 0:00

Re: [Experimental] New graph module. Testers needed.

Posted: Friday 13 September 2019 23:13
by Lokonli
It's documented:
https://dashticz.readthedocs.io/en/char ... the-x-axis

(Pull the latest version of the chartjs branch.)

Re: [Experimental] New graph module. Testers needed.

Posted: Saturday 14 September 2019 20:15
by madradrakie
Lokonli wrote: Friday 13 September 2019 23:13 It's documented:
https://dashticz.readthedocs.io/en/char ... the-x-axis

(Pull the latest version of the chartjs branch.)
I adjusted the x-files but in the week graph is still shows 0:00. This is the same at the water usage graph and also at the power usage graph. By all the other graphs is is possible to adjust the x-values. I use range: month, filter 1 week.

Re: [Experimental] New graph module. Testers needed.

Posted: Thursday 19 September 2019 20:11
by Lokonli
You can change the time-format on the x-axis with the displayFormats setting. like:

Code: Select all

blocks['graph_903'] = {
    graph: 'bar',
    datasetColors: ['lightblue'],
    legend: true,
    custom : {
        "last hours": {
            range: 'day',
            filter: '6 hours',
            data: {
                liter: 'd.v*100'            }
            },

 	"today": {
            range: 'day',
            filter: '12 hours',
            data: {
                liter: 'd.v*100'            }
            },
	
	"last week": {
            range: 'month',
            filter: '7 days',
            data: {
                liter: 'd.v*1000'            }
            },
            displayFormats: {
                'hour': 'D MMM',
            }
        }
   }
The range 'month' provides only one measurement per day. I cannot change that: it's controlled by Domoticz.

Since you filter 'just' 7 days, the chart.js module uses the 'hour' format. The default format for the hour format is 'H:mm'. That explains the '00:00' you see. By setting it to 'D MMM' you get the day/month label.

What I will do is modifying the default hour format to 'D MMM' in case the 'month' range is selected. For a month range is doesn't make sense to add the hour information, since we only get one measurement per day anyway,

Re: [Experimental] New graph module. Testers needed.

Posted: Saturday 21 September 2019 13:02
by madradrakie
Lokonli wrote: Thursday 19 September 2019 20:11 You can change the time-format on the x-axis with the displayFormats setting. like:

Code: Select all

blocks['graph_903'] = {
    graph: 'bar',
    datasetColors: ['lightblue'],
    legend: true,
    custom : {
        "last hours": {
            range: 'day',
            filter: '6 hours',
            data: {
                liter: 'd.v*100'            }
            },

 	"today": {
            range: 'day',
            filter: '12 hours',
            data: {
                liter: 'd.v*100'            }
            },
	
	"last week": {
            range: 'month',
            filter: '7 days',
            data: {
                liter: 'd.v*1000'            }
            },
            displayFormats: {
                'hour': 'D MMM',
            }
        }
   }
The range 'month' provides only one measurement per day. I cannot change that: it's controlled by Domoticz.

Since you filter 'just' 7 days, the chart.js module uses the 'hour' format. The default format for the hour format is 'H:mm'. That explains the '00:00' you see. By setting it to 'D MMM' you get the day/month label.

What I will do is modifying the default hour format to 'D MMM' in case the 'month' range is selected. For a month range is doesn't make sense to add the hour information, since we only get one measurement per day anyway,
Thnk you again, it is working now :-). I already tried some settings but did not use this one :-)

Re: [Experimental] New graph module. Testers needed.

Posted: Sunday 22 September 2019 9:08
by Lokonli
The chart.js branch has been merged into beta 3.1.0.

I'll remove the chart.js branch and close this topic here.

Re: [Experimental] New graph module. Testers needed.

Posted: Sunday 22 September 2019 9:17
by renerene
Before you close: any updates on request to combine multiple graphs?

Re: [Experimental] New graph module. Testers needed.

Posted: Sunday 22 September 2019 10:46
by Lokonli
No, not yet. My priority list:
Calendar formatting
Icons for the special blocks
Chromecast support
Multiple graphs

Sent from my SM-A320FL using Tapatalk


Re: [Experimental] New graph module. Testers needed.

Posted: Monday 23 September 2019 6:56
by renerene
Ok, thank you for the update. I will be waiting patiently ;-)

Re: [Experimental] New graph module. Testers needed.

Posted: Friday 28 August 2020 16:33
by JacKok
i got it working too, but the graph shows M3 instead of liters
M3.png
M3.png (159.21 KiB) Viewed 767 times
Can this also be adjusted?
it is displayed correctly in Domoticz