[Experimental] New graph module. Testers needed.

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Lokonli »

Could you post the resulting graph of the two previous steps? Just to check the results.
madradrakie
Posts: 64
Joined: Wednesday 11 September 2019 21:24
Target OS: -
Domoticz version:
Contact:

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

Post 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 1096 times
Knipsel2.JPG
Knipsel2.JPG (54.74 KiB) Viewed 1096 times
Do you know how to adjust the x-values of the last week graph? It now shows 0:00
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Lokonli »

It's documented:
https://dashticz.readthedocs.io/en/char ... the-x-axis

(Pull the latest version of the chartjs branch.)
madradrakie
Posts: 64
Joined: Wednesday 11 September 2019 21:24
Target OS: -
Domoticz version:
Contact:

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

Post 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.
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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,
madradrakie
Posts: 64
Joined: Wednesday 11 September 2019 21:24
Target OS: -
Domoticz version:
Contact:

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

Post 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 :-)
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
renerene
Posts: 351
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

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

Post by renerene »

Before you close: any updates on request to combine multiple graphs?
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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

renerene
Posts: 351
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

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

Post by renerene »

Ok, thank you for the update. I will be waiting patiently ;-)
JacKok
Posts: 11
Joined: Friday 08 February 2019 21:27
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10717
Contact:

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

Post by JacKok »

i got it working too, but the graph shows M3 instead of liters
M3.png
M3.png (159.21 KiB) Viewed 766 times
Can this also be adjusted?
it is displayed correctly in Domoticz
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest