Chartkick yAxis 和 Rails

Chartkick yAxis and Rails

谁能帮我解决这个问题? 我在 rails 应用程序上有一个 ruby,我正在尝试使用 ChartKick。 我的控制器中有以下代码来获取所有出版物:

@mentor_pub = Publication.all.where(user: current_user).order("mentor ASC")

我在我的观点中使用了下面的代码。

<%= column_chart @mentor_pub.group(:mentor).count, height: "600px",   discrete: true%>

You can see the image of what I am talking about here

图表以我想要的方式显示,但 Yaxis 显示的是小数而不是整数。 请问如何修改 Yaxis 以显示整数?

Chartkick 在后台使用 Google 可视化,并允许您使用 library 选项将选项直接传递给库,如下所示:

<%= line_chart data, library: {backgroundColor: "#eee"} %>

对于您的确切问题,您必须查看 Google 的文档或这个 Whosebug 答案 可能会有所帮助。