ankane / chartkick

Create beautiful JavaScript charts with one line of Ruby
https://chartkick.com
MIT License
6.33k stars 565 forks source link

I can't use library param with pie charts #589

Closed marcosvolpiok closed 2 years ago

marcosvolpiok commented 2 years ago

I have already checked out this issue: https://github.com/ankane/chartkick/issues/268, and all the other tickets that talk about the 'library' param. As well I look for a similar issue on StackOverflow

When I use a pie chart, it ignores the 'library' param. If I use a column chart it works well.

For example:

<%= column_chart @zip_codes, adapter: "chartjs", library: { legend: {display: false} } %>

It doesn't hide the legend. I tried with other options (eg: background) and it ignores them.

I'm using Chartkick v4.1.1 with and chartjs adapter, Ruby on Rails 5.2.6.

ankane commented 2 years ago

Hey @marcosvolpiok, check the Chart.js docs how to configure the legend (and please use Stack Overflow for additional help).

marcosvolpiok commented 2 years ago

Hey @marcosvolpiok, check the Chart.js docs how to configure the legend (and please use Stack Overflow for additional help).

I know that I can set the legend visibility without the 'library' param. I used the 'display' value to show an example. Actually, I want to use more advanced customization and I need to do it with the library option.

StanBright commented 1 year ago

Hey @marcosvolpiok did you find a solution?

marcosvolpiok commented 1 year ago

Hey @marcosvolpiok did you find a solution?

Hi. I used the JS API of Chartkick