Page 1 of 1

show y-axis labels on the right of graph

Posted: Wednesday 23 December 2020 14:33
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,
}

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

Posted: Wednesday 23 December 2020 16:25
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)

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

Posted: Wednesday 23 December 2020 16:47
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 ?

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

Posted: Wednesday 23 December 2020 17:28
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


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

Posted: Wednesday 23 December 2020 17:38
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 :)

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

Posted: Thursday 24 December 2020 15:54
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

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

Posted: Thursday 24 December 2020 16:10
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 ;) )

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

Posted: Thursday 24 December 2020 18:42
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

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

Posted: Thursday 24 December 2020 20:34
by Lokonli
I'll check

Sent from my SM-A320FL using Tapatalk


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

Posted: Monday 28 December 2020 23:05
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 ...