【问题标题】:In rails Label X and Y axis in chart. Implemented through chartkick and chart.js在 rails 标签 X 和 Y 轴在图表中。通过 chartkick 和 chart.js 实现
【发布时间】:2021-10-26 09:01:29
【问题描述】:

我想在我的图表中保留标签,以便它具有描述性。我参考了https://github.com/ankane/chartkick/issues/155 的图表,但对我不起作用。

我在视图中的代码如下:

               = line_chart @event_chart,discrete:true, legend: "bottom",curve: false,
           colors: ["#67b55e","#d43766","#729be0"],
          :library => {hAxis: {title: "months"}, vAxis: {title: "Y-label"}, title: "no. of events"}

我的图表如下所示:

【问题讨论】:

    标签: ruby-on-rails chart.js chartkick


    【解决方案1】:

    通过 chartkick 文档,我得到了答案:

     xtitle: "Time", ytitle: "Population"
    

    添加代码行而不是库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-10
      • 2015-03-10
      • 1970-01-01
      • 2016-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多