[Experimental] New graph module. Testers needed.
Moderators: leecollings, htilburgs, robgeerts
-
- Posts: 2291
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [Experimental] New graph module. Testers needed.
Could you post the resulting graph of the two previous steps? Just to check the results.
-
- Posts: 64
- Joined: Wednesday 11 September 2019 21:24
- Target OS: -
- Domoticz version:
- Contact:
Re: [Experimental] New graph module. Testers needed.
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' }
}
}
}
-
- Posts: 2291
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [Experimental] New graph module. Testers needed.
It's documented:
https://dashticz.readthedocs.io/en/char ... the-x-axis
(Pull the latest version of the chartjs branch.)
https://dashticz.readthedocs.io/en/char ... the-x-axis
(Pull the latest version of the chartjs branch.)
-
- Posts: 64
- Joined: Wednesday 11 September 2019 21:24
- Target OS: -
- Domoticz version:
- Contact:
Re: [Experimental] New graph module. Testers needed.
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 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.)
-
- Posts: 2291
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [Experimental] New graph module. Testers needed.
You can change the time-format on the x-axis with the displayFormats setting. like:
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,
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',
}
}
}
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,
-
- Posts: 64
- Joined: Wednesday 11 September 2019 21:24
- Target OS: -
- Domoticz version:
- Contact:
Re: [Experimental] New graph module. Testers needed.
Thnk you again, it is working nowLokonli wrote: ↑Thursday 19 September 2019 20:11 You can change the time-format on the x-axis with the displayFormats setting. like:
The range 'month' provides only one measurement per day. I cannot change that: it's controlled by Domoticz.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', } } }
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,


-
- Posts: 2291
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [Experimental] New graph module. Testers needed.
The chart.js branch has been merged into beta 3.1.0.
I'll remove the chart.js branch and close this topic here.
I'll remove the chart.js branch and close this topic here.
Re: [Experimental] New graph module. Testers needed.
Before you close: any updates on request to combine multiple graphs?
-
- Posts: 2291
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [Experimental] New graph module. Testers needed.
No, not yet. My priority list:
Calendar formatting
Icons for the special blocks
Chromecast support
Multiple graphs
Sent from my SM-A320FL using Tapatalk
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.
Ok, thank you for the update. I will be waiting patiently 

-
- 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.
i got it working too, but the graph shows M3 instead of liters
it is displayed correctly in Domoticz
Can this also be adjusted?it is displayed correctly in Domoticz
Who is online
Users browsing this forum: No registered users and 1 guest