0

I really couldn't find any documentation about this simple question:

How to change the column width in a Chartkick column chart in RoR?

The aim is to avoid the case in the image below, where the column is too thick in case of a one-column chart

Too fat column

In the documentation it mentions Highchart, so I tried putting some hash parameters according to this example, like this:

<%= column_chart(
  @data,
  plotOptions: {
    series: {
      pointWidth: 15
    }
  }
  )
%>

but it's not working.

Simon
  • 701
  • 6
  • 25

1 Answers1

1

Highcharts options need to be nested inside the library option:

<%= column_chart @data, library: {plotOptions: {series: {pointWidth: 15}}} %>
Andrew Kane
  • 3,200
  • 19
  • 40