kurkle / chartjs-plugin-gradient

Easy gradients for Chart.js
MIT License
33 stars 6 forks source link

Tooltip gradient doesn't working #38

Closed beastovsk closed 1 year ago

beastovsk commented 1 year ago

I've some problem with gradient at tooltip. Can you guys give some advice?

tooltip: {
    gradient: {
        backgroundColor: {
            // linear-gradient(180deg, rgba(44, 110, 250, 0.7) 0%, rgba(2, 189, 173, 0.13) 100%);
            axis: "x",
            colors: {
                      0: "rgba(2, 189, 173, 0.13)",
                      5: "rgba(44, 110, 250, 0.2)",
                 10: "rgba(2, 189, 173, 0.12)",
                     15: "rgba(2, 189, 173, 0.13)",
                        }
        },
    },
},
stockiNail commented 1 year ago

@beastovsk AFAIK the plugin is not designed for tooltip but to use gradients in the datasets.

See https://github.com/kurkle/chartjs-plugin-gradient#configuration

kurkle commented 1 year ago

Could probably be a new feature though