2

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

jones
  • 41
  • 3

2 Answers2

2

The problem is now solved.

<%= column_chart data, library: { scales: { xAxes: [display: false], yAxes: [display: false] } %>
jones
  • 41
  • 3
1

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
                           }
                         }
                       } } %>
    ```
aqwan
  • 470
  • 4
  • 6