razorness / vue3-calendar-heatmap

A lightweight calendar heatmap Vue 3 component built on SVG, inspired by julienr114's vue-calendar-heatmap and github's contribution calendar graph
https://razorness.github.io/vue3-calendar-heatmap
MIT License
90 stars 18 forks source link

dark mode not turning on? #15

Closed benmag closed 2 years ago

benmag commented 2 years ago

First off, great library! This is exactly what I've been looking for for the last 2 days and it's imo by far and away one of the best out there

Just having an issue turning dark mode on and i'm not sure why...

This is my code:

                <calendar-heatmap
                    :dark-mode="dark"
                    :values="values"
                    :end-date="endDate"
                    :no-data-text="false" />

///////////////////////////

    data() {
        return {
            values: [
                {
                    date: '2020-11-30T23:00:00Z',
                    count: 635000
                }, 
               // ....
            ],
            endDate: new Date('2021-08-01'),
            picked: 'Dings',
            orientation: 'horizontal',
            dark: true
        };
    },

Can't quite figure out what I'm doing wrong. I tried to inspect the code but I couldn't seem to find anything related to dark-mode so I may be misunderstanding the functionality

Alternatively I'll look to just change the theme to suit my required colors :)

Thanks

razorness commented 2 years ago

Hi @benmag,

thank you for your compliment.

Here is the line of code which decides what range color has to be used: https://github.com/razorness/vue3-calendar-heatmap/blob/master/src/components/CalendarHeatmap.vue#L186 As you can see, it gets overwritten by the property rangeColor.

You can find a working example in the docs.

If this doesn't help, I suggest creating a repository with an example.

benmag commented 2 years ago

Thank you!