Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.15.0 is available! For more information about this release, check out this topic.

    Trouble converting to a config.js or CSS parameter

    Troubleshooting
    2
    5
    48
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ankonaskiff17
      ankonaskiff17 last edited by ankonaskiff17

      I have installed the MMM-WeatherChart module ( Tatsuma Matsuki) but I am struggling to understand how to convert

              datasets.push({
                  label: 'Minimum Temparature',
                  backgroundColor: this.config.backgroundColor,
                  borderColor: this.config.color,
                  pointBackgroundColor: this.config.color,
                  datalabels: {
                      color: this.config.color,
                      align: 'top'
      

      In to someething resembling this below

      minimumTemperatureAlign : "below",

      Because I don’t see where there is anything resembling this.config.minimumTemperature .
      There is just the one reference to label: `Minimum Temperature`,
      In a nutshell align is referring to the text being above the Minimum Temperature trend line.
      There are several blocks in this same style relating to various of what seem to be CSS elements. I don’t understand how to get from the code block to the CSS property since I think this is being done using chart.js to build the grah.

      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @ankonaskiff17 last edited by

        @ankonaskiff17 chartjs doesn’t expose its css. It does expose tons of settings.

        Which i expose on my MyCovid19 module

        1 Reply Last reply Reply Quote 0
        • ankonaskiff17
          ankonaskiff17 last edited by ankonaskiff17

          Put in issue in on Github about why the rain amount was not converting to inches when units are specified as imperial. Author of module resolved that yesterday. Also asked about scale on vertical axis as it seems too tight and rain trend wants to bang in to temperature trends.
          Just sent him picture showing that.
          Several things were able to be changed directly in the script but after following your advice to do all that in ether custom.css or config.js there was no way to access those parameters.

          Spent a few hours looking at chart.js to see ifI could translate that to items in module but couldn’t find anything.

          S 1 Reply Last reply Reply Quote 0
          • S
            sdetweil @ankonaskiff17 last edited by sdetweil

            @ankonaskiff17 when u ask chartsjs to draw. U pass in an options structure. It has all the styles

            See my module
            https://github.com/sdetweil/MyCovid19
            the updateOptions function

            1 Reply Last reply Reply Quote 0
            • ankonaskiff17
              ankonaskiff17 last edited by

              I read through you code and reasonably easy to follow along and you gave everything unique names which helps.
              The WeatherChart OTOH that uses the same block of code but doesn’t really lay out the underlying chart.js stuff which in that case I have failed to make work.
              Obviously if I can change it in the script itself I should be able to make it work in config.js but that has not been the case after trying oodles of different combinations.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy