我如何阻止 chartkick 显示 X 轴日期(ruby on rails)
How do i stop chartkick from showing the X-axis date (ruby on rails)
第一次在 Whosebug。
它在 x 轴下显示图表中每个点的日期。
有人可以帮我删除它吗?
<%= area_chart website.pings.limit(5).order(created_at: :desc).pluck(:created_at, (:ms)),
width: "70x", height: "130px", messages: {empty: "No Ping made yet"}, curve: false, refresh: 10 %>
也检查这个问题。正如您的问题所暗示的那样。
How to hide axis using Chartkick.js
Chartkick 还有一些选项,如果您遵循文档,您可能会遇到这些选项:Chartkick website
因此,在合并答案时,您必须将此添加到您的代码中:
<%= area_chart website.pings.limit(5).order(created_at: :desc).pluck(:created_at, (:ms)),
width: "70x", height: "130px", messages: {empty: "No Ping made yet"},
curve: false, refresh: 10, library: { scales: { xAxes: [{ display: false }] } } %>
使用 library: { scales: { xAxes: [{ display: false }] } }
可以添加选项,标度是 x 和 y 标度,您也可以在其中更改选项。
在此处查看完整的 API:Full Chartkick API
第一次在 Whosebug。
它在 x 轴下显示图表中每个点的日期。 有人可以帮我删除它吗?
<%= area_chart website.pings.limit(5).order(created_at: :desc).pluck(:created_at, (:ms)),
width: "70x", height: "130px", messages: {empty: "No Ping made yet"}, curve: false, refresh: 10 %>
也检查这个问题。正如您的问题所暗示的那样。 How to hide axis using Chartkick.js
Chartkick 还有一些选项,如果您遵循文档,您可能会遇到这些选项:Chartkick website
因此,在合并答案时,您必须将此添加到您的代码中:
<%= area_chart website.pings.limit(5).order(created_at: :desc).pluck(:created_at, (:ms)),
width: "70x", height: "130px", messages: {empty: "No Ping made yet"},
curve: false, refresh: 10, library: { scales: { xAxes: [{ display: false }] } } %>
使用 library: { scales: { xAxes: [{ display: false }] } }
可以添加选项,标度是 x 和 y 标度,您也可以在其中更改选项。
在此处查看完整的 API:Full Chartkick API