show y-axis labels on the right of graph

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
adeibiza
Posts: 27
Joined: Friday 19 October 2018 18:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

show y-axis labels on the right of graph

Post by adeibiza »

i have an embedded graph but would like to show the labels on the right not the left as to me it makes more sense to see the current data and not have to trace across from the left side

is this possible (i dont mind if it's moved & only on the right but preferable to show y axis on both left and right ?

Code: Select all

blocks['humidity'] = { 
    title:'Humidity',
    customHeader: {},
    devices: ['80','84','87','106','82', '131','83'],
    width:12,
    datasetColors: ['red','yellow','blue','orange','green','purple','black'],
    graphTypes:['hu'],
        legend: {
                'hu_80': '153',
                'hu_84': '163',
                'hu_87':'154',
                'hu_106':'151',
                'hu_82':'152',
                'hu_131':'Room',
                'hu_83': 'Outside',
        },
        
    height:'180px',
    width:12,
        buttonsPadX: 2,
        buttonsPadY: 2,
        buttonsBorder: 'orange',
        buttonsColor: '#fff',
        buttonsFill: '#000',
        buttonsIcon: 'orange',
        buttonsMarginX: 1,
        buttonsMarginY: 1,
        buttonsRadius: 5,
        //buttonsShadow: 'rgba(255, 255, 255, 0.1)',
        buttonsSize: 10,
        borderWidth:3,
}
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: show y-axis labels on the right of graph

Post by Lokonli »

That is relatively easy. I've implemented it in latest beta (16:20 today CET)

New block parameters:

Code: Select all

  axisRight: true,     //to show y axis on the right (default is false)
  axisAlternate: false //show multiple Y axes alternating left/right. (default is true)
adeibiza
Posts: 27
Joined: Friday 19 October 2018 18:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: show y-axis labels on the right of graph

Post by adeibiza »

b*lls, doesn't work for me (i haven't updated to v3.7 as i have some custom changes in a couple of js files (not related to graphs))

if i update will it over-write (cosmestic) changes i made in blocks.js or blocktypes.js ?
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: show y-axis labels on the right of graph

Post by Lokonli »

Yes.

If you've made changes to blocktypes you can move those to the hook in custom.js

What did you change to blocks.js?

Sent from my SM-A320FL using Tapatalk

adeibiza
Posts: 27
Joined: Friday 19 October 2018 18:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: show y-axis labels on the right of graph

Post by adeibiza »

around line 2100 getting rid of the dew point display

Code: Select all

  if (typeof device['DewPoint'] !== 'undefined') {
    if (single_block) {
      blockValues[0].value +=
        ' '; // + number_format(device['DewPoint'], 1) + ' °';
    } else {
no big deal, just wondering :)

noob, how do i implement that new beta and where do i find it :)
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: show y-axis labels on the right of graph

Post by Lokonli »

If you followed the installation instructions (manual or auto install) then type the following in the Dashticz folder:

If you are on master, first switch to beta:

Code: Select all

git checkout beta
Then get the latest changes with:

Code: Select all

git pull
If you have made some local changes to the source files then you may get an error. You can throw away all changes with:

Code: Select all

git reset --hard HEAD
adeibiza
Posts: 27
Joined: Friday 19 October 2018 18:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: show y-axis labels on the right of graph

Post by adeibiza »

thanks, just fyi - it overwrote the custom.js & custom.css files in custom folder - which seems odd (i did a backup before upgrading ;) )
User avatar
HansieNL
Posts: 964
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: show y-axis labels on the right of graph

Post by HansieNL »

adeibiza wrote: Thursday 24 December 2020 16:10 thanks, just fyi - it overwrote the custom.js & custom.css files in custom folder - which seems odd (i did a backup before upgrading ;) )
I can confirm that the files will be overwritten. @Lokonli Can these files be excluded if following command is executed?

Code: Select all

 git reset --hard HEAD
Blah blah blah
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: show y-axis labels on the right of graph

Post by Lokonli »

I'll check

Sent from my SM-A320FL using Tapatalk

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

Re: show y-axis labels on the right of graph

Post by Lokonli »

HansieNL wrote: Thursday 24 December 2020 18:42
adeibiza wrote: Thursday 24 December 2020 16:10 thanks, just fyi - it overwrote the custom.js & custom.css files in custom folder - which seems odd (i did a backup before upgrading ;) )
I can confirm that the files will be overwritten. @Lokonli Can these files be excluded if following command is executed?

Code: Select all

 git reset --hard HEAD
I've decided to remove the custom.css and custom.js files from the Dashticz repository. This has been implemented in 3.7.2

The first update might be painfull ...
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest