nagix / chartjs-plugin-style

Chart.js plugin for more styling options
MIT License
66 stars 19 forks source link

Legend Box without styling #13

Open satisfazm2bezes opened 4 years ago

satisfazm2bezes commented 4 years ago

Hi,

Is it possible to configure the plugin to not draw the styling on the legend?

Something like this: image

chasedeanda commented 3 years ago

@nagix I have the same request. I want to add drop shadows to my line charts but that should not affect my legend. Is there a simple way to disable this for the legend?

satisfazm2bezes commented 3 years ago

@nagix I have the same request. I want to add drop shadows to my line charts but that should not affect my legend. Is there a simple way to disable this for the legend?

What I did was adding a new boolean option named 'legendShadow' which gives you the possibility to enable/disable shadow on legend.

And use it like this: { type: 'horizontalBar', label: 'Post', yAxisID: 'y-axis-left', data: dataPost, labels, fill: true, borderColor: '#5b9bd5', backgroundColor: '#5b9bd5', shadowOffsetX: 1, shadowOffsetY: 1, shadowBlur: 7, shadowColor: colorPost, legendShadow: false }

Please find it under: https://github.com/satisfazm2bezes/chartjs-plugin-style

Hope it helps.

vin-ni commented 2 years ago

@satisfazm2bezes Hello, I'm trying to port this repo to work with chartjs v3. But there are some variables that need to be updated in the code. I was trying to do that, but i have issues exporting a new version with gulp. Somehow the dist stays empty after gulp build. Do you happen to know why? Thank you!