繁体   English   中英

Rails-Chartkick-关闭工具提示

[英]Rails - Chartkick - Turning tooltip off

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

= 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}我无法想到的。

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

截至2017年夏季,chartkick.js不支持自定义工具提示。 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