Page 1 of 1
Graph dont show correct.
Posted: Friday 01 May 2020 9:40
by magicnld
I have updated to the latest beta version, The graphs are not displayed correctly. In the previous version it worked well.
The bars are gone, these are standard line again
The adjusted colors are gone
The legend is also gone
Sorry for my English. I am Dutch
blocks['graph_27'] = {}
blocks['graph_27']['title'] = 'Stroom';
blocks['graph_27']['legend'] = {'v2':'Dag', 'v':'Nacht', 'r2': 'Retour dag', 'r1': 'Retour nacht'};
blocks['graph_27']['datasetColors'] = ['#b3d0ff','#0062ff','#f170ff','#e600ff'];
blocks['graph_27']['graph'] = 'bar';
blocks['graph_27']['width'] = 12;
Re: Graph dont show correct.
Posted: Friday 01 May 2020 10:11
by Jimster
There has been a lot of changes since 3.3.2 beta I think. See this topic
https://www.domoticz.com/forum/viewtopi ... 67&t=31534 and
https://dashticz.readthedocs.io/en/beta ... raphs.html
You can try this:
Code: Select all
blocks['graph_27'] = {
devices: [27],
title: ['Stroom'],
graph: ['bar'],
width: [12],
datasetColors: ['#b3d0ff','#0062ff','#f170ff','#e600ff'],
legend: {
'v2':'Dag', 'v':'Nacht', 'r2': 'Retour dag', 'r1': 'Retour nacht',
}
}
Re: Graph dont show correct.
Posted: Friday 01 May 2020 10:28
by Lokonli
Small addition: Since all graph now support combining the data from several devices, you have to add the device id to the legend keys, like this:
Code: Select all
blocks['graph_27'] = {
devices: [27],
title: ['Stroom'],
graph: ['bar'],
width: [12],
datasetColors: ['#b3d0ff', '#0062ff', '#f170ff', '#e600ff'],
legend: {
'v2_27': 'Dag',
'v_27': 'Nacht',
'r2_27': 'Retour dag',
'r1_27': 'Retour nacht',
}
}
Re: Graph dont show correct.
Posted: Friday 01 May 2020 16:31
by magicnld
graphs are now properly displayed. But the colors in the legend that I applied are not displayed properly. has this also changed?
Re: Graph dont show correct.
Posted: Saturday 02 May 2020 12:13
by Jimster
magicnld wrote: ↑Friday 01 May 2020 16:31
graphs are now properly displayed. But the colors in the legend that I applied are not displayed properly. has this also changed?
I checked the beta documentation, you problably have to give the colors a name.
Change the datasetcolors to this
datasetColors: [colourBlue1, colourBlue2, colourPurple1, colourPurple2],
And add this, I think outside the graph code:
var colourBlue1= '#b3d0ff';
var colourBlue2= '#0062ff';
var colourPurple1= '#f170ff';
var colourPurple2= '#e600ff';
See
https://dashticz.readthedocs.io/en/beta ... raphs.html
Re: Graph dont show correct.
Posted: Saturday 02 May 2020 12:26
by clinkadink
Jimster wrote: ↑Saturday 02 May 2020 12:13
I checked the beta documentation, you problably have to give the colors a name.
You can do this, but it is
optional.
Supported color formats are:
Code: Select all
datasetColors: [colorRed, colorGreen, colorOrange], <----- color variables
datasetColors: ["#e0ecf4", "#9ebcda", "#8856a7"], <----- hex colors
datasetColors: ["red", "yellow", "blue"], <----- html web safe colors
datasetColors: ["rgb(1, 2, 3)", "rgb(4, 5, 6)", "rgb(7, 8, 9)"], <----- rgb colors
datasetColors: ["rgba(1, 2, 3, 0.5)", "rgba(4, 5, 6, 0.6)", "rgba(7, 8, 9, 0.8)"], <----- rgba colors
Re: Graph dont show correct.
Posted: Saturday 02 May 2020 12:27
by clinkadink
magicnld wrote: ↑Friday 01 May 2020 16:31
graphs are now properly displayed. But the colors in the legend that I applied are not displayed properly. has this also changed?
Please can you post your graph block?