Use specific data in graphs

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
moses123
Posts: 18
Joined: Thursday 06 September 2018 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Use specific data in graphs

Post by moses123 »

Hello,

i used the graphs in dashticz to display the data of a weatherstation in the garden. It was anoying, that the value of the barometer ruined the graph. Because all three values where displayed on the same y-axis. In this case, the Temperature was no longer displayed properly, because of values 1000hpa to 1,2C.

So i changed the graph.js. Insert this before the line Morris.Line({

Code: Select all

    graphProperties=getChangedGraphProperties(idx,graphProperties);
And then change the custom.js like this:

Code: Select all

function getChangedGraphProperties(idx,graphproperties) {
        if (idx=432) {
                graphproperties.keys=["hu","te"];
        }
        return graphproperties;
}
The above example changed the displayed data from baro,temp and hum to temp and hum only, if the device is 432, which is my garden weather station.

If you changed the graphs.js, you have to insert at least this into custom.js:

Code: Select all

function getChangedGraphProperties(idx,graphproperties) {
       return graphproperties;
}
Maybe this is something do implement permanently to dashticz.


Moses123
moses123
Posts: 18
Joined: Thursday 06 September 2018 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Use specific data in graphs

Post by moses123 »

I have forgotten the labels line:

Code: Select all

	if (idx=432) {
		graphproperties.keys=["hu","te"];
		graphproperties.labels=["%","°C"];
	}
Changing the if-part to this, shows the right format and appendix of the values in the hover-popup.
ArthurNL
Posts: 15
Joined: Friday 05 October 2018 14:36
Target OS: Windows
Domoticz version: 4.10717
Location: The Netherlands
Contact:

Re: Use specific data in graphs

Post by ArthurNL »

Interesting, but can't it to work like I want.

If I insert/change the code to the above, my graphs (or better, the plotted lines/data) of my Gas & Electra meters also disappear. It looks like it doesn't doesn't execute the (idx=xxx) part. It acts the same, even if I put an imaginary idx-number in it.
Dashticz V2.4.0 Beta
moses123
Posts: 18
Joined: Thursday 06 September 2018 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Use specific data in graphs

Post by moses123 »

Hello,
post your code please.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest