matteodanelli / MMM-cryptocurrency

A MagicMirror module for crypto currencies value.
MIT License
95 stars 42 forks source link

IOTA graph not showing, significant digits only showing 2 not 5 #19

Closed jinjirosan closed 6 years ago

jinjirosan commented 6 years ago

Can't figure this one out. I'm using the latest version of the code and the options:

  {
      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'
      }
  },

The graphs for Ethereum, Ripple and Bitcoin are showing but the graph for IOTA is not. In webpage source it shows empty instead of <img src="https://files.coinmarketcap.com/generated/sparklines/1.png?cachePrevention=0.7866182075290848">

Also the significantDigits setting of 5 are not showing anymore which did work in an older version.

CriticalPoint commented 6 years ago

How are you finding the SparkLine for a specific crypto? For arguments sake, Tronix (TRX)?

Looking at your link, the SparkLine has been generated and displays perfectly well at the link you've stipulated - https://files.coinmarketcap.com/generated/sparklines/1.png?cachePrevention=0.7866182075290848

EDIT - I found this here I just needed to inspect the image from the coinmarketcap main page and also add it to the MMM-cryptocurrency.js file. Works a charm :+1:

CriticalPoint commented 6 years ago

So for you @jinjirosan , add the line in the screenshot below, save, reboot. Sorted.

https://pasteboard.co/H1P4FPJ.png

matteodanelli commented 6 years ago

Exactly. Just add them to your javascript file. I'll push an update with them later.

matteodanelli commented 6 years ago

Also, what do you mean significant digits are not more working? Which currency? Remember that prices are taken from coinmarketcap, which has its own rounding.

jinjirosan commented 6 years ago

@CriticalPoint awesome, that works. Thx! @matteodanelli Ripple (XRP) for instance, it first showed 0.1745 and now it shows 1.99. it's a minor thing that it shows two decimals after the point, just wondering.

matteodanelli commented 6 years ago

Yes I got it, but unfortunately it's my source (coinmarketcap) which drops third and fourth decimal :)