好吧,看起来
chartkick
具有
chart.js
有一些
limitations
. 所以我切换到
google charts
.
我删除了图表。我的应用程序中的js代码。html。erb和应用。js并将其替换为
google chart code
.
更改折线图的步骤
this page
很有帮助。
以下是我眼中的工作代码:
<%= line_chart $tweet_day, id:"line_chart $tweet_day",xtitle: "Day of the Week", ytitle: "Tweets Count", colors: ["#C2F4FF"], download: "tweet_day", refresh: 60,
library: {
vAxis: { baselineColor: "#F76161", gridlines: {Color: "" }, textStyle: { color: "#76BDD1"}, titleTextStyle: {color: "#F76161"} },
hAxis: { baselineColor: "#F76161" , gridlines: {Color: "" }, textStyle: { color: "#76BDD1"} , titleTextStyle: {color: "#F76161"} } } %>
希望它能帮助别人。