MMM-cryptocurrency icon indicating copy to clipboard operation
MMM-cryptocurrency copied to clipboard

Change graph width

Open jinjirosan opened this issue 7 years ago • 11 comments

The graph itself, on my mirror, is about 93px wide however only the right half of that is the actual graph. The left half is just empty space.

Do you know how I can remove that white space?

It currently makes the whole top right region too wide. Thx.

jinjirosan avatar Dec 30 '17 15:12 jinjirosan

sorry i dont know. And what white space do you mean? Could you please make a screenshot?

lordvalium avatar Jan 02 '18 17:01 lordvalium

Thx for getting back to me.

This image shows the actual graph and this image shows the total width. There is quite some space in that cell between the text and the actual graph itself.

(edit: images urls)

jinjirosan avatar Jan 02 '18 19:01 jinjirosan

Well, I am not able to reproduce the spacing. Could you please post module configuration?

matteodanelli avatar Jan 07 '18 13:01 matteodanelli

of course. I've been digging through CSS and with Chrome Developer Tools but can't seem to narrow down why the spacing is there.

            {
                    module: "MMM-cryptocurrency",
                    position: "top_right",
                    config: {
                            currency: ['ethereum', 'ripple', 'bitcoin', 'iota'],
                            conversion: 'EUR',
                            displayLongNames: 'false',
                            displayType: 'logoWithChanges',
                            significantDigits: '5',
                            showGraphs: 'true',
                            headers: ['change24h', 'change1h', 'change7d'],
                            fontSize: 'medium'
                    }
            },

jinjirosan avatar Jan 10 '18 19:01 jinjirosan

Pretty strange. Where are you running the module? Raspberry? Which version?

matteodanelli avatar Jan 15 '18 21:01 matteodanelli

I'm running it on a Pi3 with an up-to-date Jessie.

yes weird. Not sure but is there a dependency in the cryptocurrency table on other modules located in Top Right position?

I have a weather graph that is wider than the cryptocurrency module.

jinjirosan avatar Jan 16 '18 07:01 jinjirosan

@jinjirosan if you comment out your weather app and restart the process/reboot the mirror, does it scale correctly?

CriticalPoint avatar Jan 23 '18 16:01 CriticalPoint

Hello

I have fixed my graph size issues by adding one line to the code

                   console.log(graph.src)
                   graph.style.maxWidth="150px";        // This line is added
                   graphWrapper.appendChild(graph)

Also the logos sometimes have size issues i solved it with changing these lines

                logo.src = '/my-crypto/' + this.folder + apiResult[j].id + '.png'
                //logo.setAttribute('width', '50px')            ** remarked out
                //logo.setAttribute('height', '50px')           ** remarked out
                logo.style.maxWidth="50px";                    // added these two lines
                logo.style.maxHeight="50px";                   //  using style is better then attr
                logoWrapper.appendChild(logo)

Now the layout is always proper

newset

SpoturDeal avatar Feb 10 '18 09:02 SpoturDeal

@CriticalPoint, sorry for the late reply. Yes it seems it pulls the space wider.

@SpoturDeal, you fixed it! Thx for looking into this. The module is now exactly how I like to see it. (looking at your screenshot, you're also Dutch :-) )

jinjirosan avatar Feb 14 '18 20:02 jinjirosan

@jindirosan Yes I am Dutch I did an extended version of this module https://github.com/spoturdeal/MMM-crypto-portfolio there you can add the values of the coin you actually own

SpoturDeal avatar Feb 15 '18 07:02 SpoturDeal

@SpoturDeal made an amazing extended Version!!

lordvalium avatar Feb 15 '18 07:02 lordvalium