How to hide axis in column_chart using chartkick

Viewed 270

In chartkick's column_chart, I want to remove the axes of the chart as shown in the attached image.

I tried this code, but I couldn't hide axis.

<%= column_chart data, library: { hAxis: { textPosition: 'none'  },vAxis: { textPosition: 'none'  } } %>

enter image description here

2 Answers

The problem is now solved.

<%= column_chart data, library: { scales: { xAxes: [display: false], yAxes: [display: false] } %>

Maybe depends on the underlying library, but when using chartjs this is what worked

 <%= column_chart data, library: { scales: {
                         x: {
                           ticks: {
                             display: false
                           }
                         },
                         y: {
                           ticks: {
                             display: false
                           }
                         }
                       } } %>
    ```
Related