简体   繁体   English

Rails-Chartkick-关闭工具提示

[英]Rails - Chartkick - Turning tooltip off

I have the following barchart for which I'm trying to turn the hover tooltip off: 我有以下试图关闭悬停工具提示的条形图:

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

From their homepage, I can make an initializer file which I've done: 在他们的主页上,我可以完成一个初始化文件:

config/initializers/chartkick.rb 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
  }
}

The options regarding vaxis and haxis all work, however I can't get anything to do with tooltips working. 关于vaxis和haxis的选项都可以使用,但是我无法与工具提示一起使用。 I've tried every variety of inserting tooltips: { enabled: false } that I can think of with no joy. 我尝试了各种插入工具提示:{enabled:false}我无法想到的。

If anyone has any advise it would be greatly appreciated 如果有人有任何建议,将不胜感激

As of summer 2017 custom tooltips are not supported in chartkick.js. 截至2017年夏季,chartkick.js不支持自定义工具提示。 There are two open issues about this on the GitHub repository: GitHub存储库上有两个未解决的问题:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM