【问题标题】:Rails - Chartkick - Turning tooltip offRails - Chartkick - 关闭工具提示
【发布时间】:2017-08-30 16:42:37
【问题描述】:

我尝试关闭悬停工具提示的以下条形图:

= bar_chart [["", current_admin.company.progress_to_target_this_month]], colors: [current_admin.company.progress_bar_colour]

从他们的主页,我可以制作一个我已经完成的初始化文件:

config/initializers/chartkick.rb

Chartkick.options = {
  height: '300px',
  colors: ['#b00', '#666'],
  discrete: true,
  library: {
    pointSize: 0,
    vAxis: {
      points: false,
      legend: false,
      discrete: true
    },
    hAxis: {
      points: false,
      legend: false,
      discrete: true,
      textPosition: 'none'
    },
    tooltips: {
      enabled: false
    }
  },
  options: {
    tooltips: {
      enabled: false
    }
  },
  tooltips: {
    enabled: false
  }
}

关于 vaxis 和 haxis 的选项都可以工作,但是我对工具提示的工作没有任何关系。我已经尝试了各种插入工具提示:{ enabled: false },我可以不高兴地想到。

如果有人有任何建议,将不胜感激

【问题讨论】:

    标签: ruby-on-rails ruby chartkick


    【解决方案1】:

    自 2017 年夏季起,chartkick.js 不支持自定义工具提示。 GitHub 存储库中有两个未解决的问题:

    【讨论】:

      【解决方案2】:

      如果图表不需要任何其他指针事件,则只需为包含图表的div 设置pointer-events: none

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-12
        相关资源
        最近更新 更多