簡體   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