Bar chart in dashticz - block definition

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Bar chart in dashticz - block definition

Post by Daro1003 »

Please help me define a block in dashticz total energy.
I want to add a bar chart because now I have a linear one, I used the following instructions: https://dashticz.readthedocs.io/en/mast ... raphs.html
but somehow I don't manage to insert a block like this:
blocks[610] = { title: 'TV Kamer Całkowita', devices: [6], graph:'bar', width: 2,}
and still nothing, line graph.
Please help me how to define a block in dashticz so that a bar chart is displayed as in the instructions.
Attachments
wykress.jpg
wykress.jpg (19.58 KiB) Viewed 3989 times
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Bar chart in dashticz - block definition

Post by willemd »

Code: Select all

blocks[610] = { title: 'TV Kamer Całkowita', devices: [6], graph:'bar', width: 2,}
It seems 6 is your device so 610 is just a title, therefore it should be between quotes.

Code: Select all

blocks['610'] = { title: 'TV Kamer Całkowita', devices: [6], graph:'bar', width: 2,}
of course also in your column definition you should then refer to '610'

Better to give it a meaningfull title like 'TV Kamer Całkowita''in your case

so

Code: Select all

blocks['TV Kamer Całkowita'] = { title: 'TV Kamer Całkowita', devices: [6], graph:'bar', width: 2,}
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

Then something is wrong because this entry doesn't work:

Code: Select all

blocks['610'] = { title: 'TV Kamer Całkowita', devices: [6], graph:'bar', width: 2,}

columns[38] = { blocks : ['blocktitle_13',576,580,579,578,'610'], width: 12} 
610 - this is the idx of the device in domoticz that I want to display in a bar chart

So in this notation:

Code: Select all

blocks['TV Kamer Całkowita'] = { title: 'TV Kamer Całkowita', devices: [6], graph:'bar', width: 2,}
how does dashticz know what domoticz block should show?

Code: Select all

blocks[610] = { title: 'TV Kamer Całkowita', graph:'bar', width: 2,}
doesn't work
I want to display a bar chart of this device in domoticz:
Attachments
IDX610.jpg
IDX610.jpg (13.04 KiB) Viewed 3927 times
Lokonli
Posts: 2260
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Bar chart in dashticz - block definition

Post by Lokonli »

With '610' as key Dashticz normally will display a default Domoticz block for device with domoticz id 610

You can enforce to display it as a graph as follows:

Code: Select all

blocks['mykey'] = { title: 'TV Kamer Całkowita', graph:'bar', devices=[610], width: 2, type:'graph'}
If you want to show all data in one graph:

Code: Select all

blocks['mykey'] = { title: 'TV Kamer Całkowita', graph:'bar', devices=[576, 580, 579, 578, 610], width: 2, type:'graph'}
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

I managed to display the chart, but I wanted the dashticz to display a bar chart after clicking on the block, not a line chart as in the instructions.
In the code you sent you have the error "devices=[610]" it doesn't work, there is a total error, it should probably be "devices:[610]"
And then there is a graph in the block:
I would like to display a bar chart instead of a line chart as it is now when clicking on a block.
Attachments
Liniowy.jpg
Liniowy.jpg (94.39 KiB) Viewed 3911 times
wykresss.jpg
wykresss.jpg (141.85 KiB) Viewed 3917 times
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Bar chart in dashticz - block definition

Post by willemd »

If it is about the popup graph (you did not state that in your first question), then you should look at the documentation here:
https://dashticz.readthedocs.io/en/mast ... aph-window
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

I meant the chart that pops up after clicking on the block. Maybe I described it wrong, sorry.
But thanks to this I learned how to make a nice chart on a separate screen.
Now I will try to follow the instructions provided to make a pop-up bar graph after clicking on the block regarding total electricity.
Lokonli
Posts: 2260
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Bar chart in dashticz - block definition

Post by Lokonli »

You have to define a block for the popup parameter, like:

Code: Select all

blocks['tv'] = { title: 'TV Kamer Całkowita', idx:610, width: 2, popup: 'tvgraph'}
blocks[ 'tvgraph'] = { devices: [610], type: 'graph', graph: 'bar'}
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

I have a question about the chart below, how to set it to display - the last month?

Code: Select all

blocks['wykres_dom'] = { title: 'Dom Całkowita', graph:'bar', devices:[618], width: 12, height: '300px', type:'graph'}
Attachments
Ostatni miesiąc.jpg
Ostatni miesiąc.jpg (127.44 KiB) Viewed 3613 times
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Bar chart in dashticz - block definition

Post by willemd »

https://dashticz.readthedocs.io/en/mast ... tom-graphs

use range and filter as described in the manual, link above
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

I just wish the first view was a month and not 24 hours
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Bar chart in dashticz - block definition

Post by willemd »

Daro1003 wrote: Sunday 14 January 2024 14:56 I just wish the first view was a month and not 24 hours
Just change the order of the definition in your custom graph, so define the month graph first and then the 24 hours graph.
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

Do I understand correctly:

Code: Select all

custom: {range: 'month'}
I would like the month to be displayed because now I have to press the month button, by default it displays several hours
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Bar chart in dashticz - block definition

Post by willemd »

Daro1003 wrote: Monday 15 January 2024 22:31 Do I understand correctly:

Code: Select all

custom: {range: 'month'}
I would like the month to be displayed because now I have to press the month button, by default it displays several hours
You have to create a CUSTOM graph as shown in the link and then define the month as the first in the list.
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

Or so:

Code: Select all

blocks['wykres2'] = {
    title: 'Całkowita',
	height: '300px',
    devices: [618],
    graph: ['bar'],
    custom : {
        "Miesiąc": {
            range: 'month',
            filter: '1 month',
			 data: {
                
            }
        },
        "Dziś": {
            range: 'today',
            filter: '1 days',
            data: {
                
            }
        },
        "Ostatnie godziny": {
            range: 'days',
            filter: '6 hours',
            data: {
                
            }
        }
    },
    legend: true,
    datasetColors:['blue','red','yellow']
And what should I enter in data? ?
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Bar chart in dashticz - block definition

Post by willemd »

d.v_618 , in line with the example in the manaul
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

Code: Select all

blocks['wykres2'] = {
    title: 'Całkowita Dziś',
	height: '300px',
    devices: [770],
    graph: ['bar'],
    custom : {
        "Miesiąc": {
            range: 'month',
            filter: '1 month',
			 data: {
				 nett: 'd.v_770'
                
            }
        },
        "Dziś": {
            range: 'today',
            filter: '1 days',
            data: {
				nett: 'd.v_770'
                
            }
        },
        "Cały Rok": {
            range: 'year',
            filter: '6 months',
            data: {
				nett: 'd.v_770' 
                
            }
        }
    },
    legend: {nett: 'Godziny Dni Miesiące'},
    datasetColors:['blue','red','yellow']
}
Back to topic:
Monthly chart - ok, very good
Today Chart - Not ok indications as in the picture
Year Chart - No ok it doesn't show the year.

What's wrong with my code?

In the Year Chart it should show the months and in the Today Chart it should show the hours from 00 to 23:59 but it shows otherwise, what is wrong?
Miesiąc ok Good.jpg
Miesiąc ok Good.jpg (87.82 KiB) Viewed 751 times
CałyRok.jpg
CałyRok.jpg (104.2 KiB) Viewed 751 times
Attachments
Dziś - Today.jpg
Dziś - Today.jpg (118.95 KiB) Viewed 751 times
Last edited by Daro1003 on Monday 01 April 2024 0:25, edited 1 time in total.
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Bar chart in dashticz - block definition

Post by willemd »

How does the graph of this devcie in domoticz itself look like? Are you sure there is data for other moments?
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

In red, a positive graph of the same domoticz device like this:

Code: Select all

blocks['wykres_dom'] = { title: 'Dom Dziś', graph:'bar', devices:[770], width: 12, height: '300px', type:'graph',}
In blue, the custom chart shows differently as you can see.
But in the meantime - a month is ok.
Today2.jpg
Today2.jpg (306.1 KiB) Viewed 732 times
DomoticzW2.jpg
DomoticzW2.jpg (80.93 KiB) Viewed 732 times
DomoticzW1.jpg
DomoticzW1.jpg (82.6 KiB) Viewed 732 times
Last edited by Daro1003 on Monday 01 April 2024 0:24, edited 1 time in total.
Daro1003
Posts: 83
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

Domoticz All year round
DomoticzW3.jpg
DomoticzW3.jpg (22.81 KiB) Viewed 729 times
Last edited by Daro1003 on Monday 01 April 2024 0:24, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest