Rails 4:删除网格线图表吗? [英] Rails 4: Removing grid lines chartkick?

查看:78
本文介绍了Rails 4:删除网格线图表吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使该代码起作用,以便使用带有导轨4的Chartkick移除两个轴:

Hi I am trying to make that code work in order to remove both axis using Chartkick with rails 4:

<%= line_chart Score.where(employee_id: params[:id]).limit(10).group(:created_at).sum(:average), :library => {hAxis: {lineColor: 'transparent'}, vAxis: {lineColor: 'transparent'}, title: "#{@employee.name} latest results"}, max: 5.5, min: 0%>

但是我得到的结果在这里不起作用:

But it does not work here is what I get:

我只想要蓝线,我不想

感谢您的帮助。

推荐答案

我找到了答案:所以我将 google chart与红宝石宝石图表一起使用。

I found the answer: So I do use "google chart" with the ruby gem chartkick.

这对我有用:

<%= line_chart Score.where(employee_id: params[:id]).limit(10).group(:created_at).sum(:average), discrete: true, library: {vAxis: {gridlines: {color: "transparent"}}}%>

实际上就像@chad的答案,但经过研究和尝试, gridlines中的 L必须不是资本。

Its actually like @chad answer but after researching and trying, the "L" in "gridlines" must not be capital.

这篇关于Rails 4:删除网格线图表吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆