【发布时间】:2019-10-31 19:21:34
【问题描述】:
我似乎无法使用 tooltip: { pointFormat: "custom label"} 选项更改工具提示值标签。
我正在将 Highcharts 集成到 chartkick gem 中,并且我已确保 chartkick 确实在使用 highcharts 适配器。其他库选项可用,例如 xAxis 和 yAxis。
这里是有问题的代码:
column_chart @registrations.joins(:clinic).group("clinics.name").count,
title: "Registrations Per Clinic",
library: {
tooltip: {
pointFormat: "Registrations: <b>{point.y}</b>"
},
xAxis: {
title: { text: "Clinic" }
},
yAxis: {
allowDecimals: false,
title: { text: "Number of Registrations" }
}
}
【问题讨论】:
-
嗨@mtprogrammer,请尝试在系列级别定义选项。接口:api.highcharts.com/highcharts/series.column.tooltip
-
不幸的是,这个建议没有雪茄。我尝试了许多系列和 plotOptions 的变体。
-
所以
chartkick有问题。该选项适用于基本的 Highcharts:jsfiddle.net/BlackLabel/dm0yc4nq
标签: ruby-on-rails highcharts chartkick