【问题标题】:How to set certain columns to Bubble Chart dataLabel in highcharts (Rcharts)?如何在highcharts(Rcharts)中将某些列设置为气泡图数据标签?
【发布时间】:2019-01-08 12:39:49
【问题描述】:

如何将“prd_nm”列设置为气泡图的数据标签? 我尝试使用“绘图选项:格式”选项,但我找不到它。

data <- top30

 colnames(data) <- c('prd_rk', 'prd_nm', 'category', 'strategy', 'plc', 
'sales', 'purchases', 'customers', 'age', 'purchase_rate', 
'repurchase_rate')

hc <- hPlot(sales ~ purchases, data = data, type = "bubble", size = 
"customers", group = "strategy")

hc$plotOptions(series=list(dataLabels=list(enabled=TRUE, formmat= . 
{"y"})))

hc$set(height = 500)

hc$colors(palette)

hc

【问题讨论】:

标签: highcharts shiny rcharts


【解决方案1】:

formmat 有一点错别字。请尝试将您的代码更改为:

hc$plotOptions(series=list(dataLabels=list(enabled=TRUE, format="{prd_nm}")))

【讨论】:

  • 谢谢。但是,您的代码还将数据标签显示为 y 值,而不是 prd_nm
猜你喜欢
  • 1970-01-01
  • 2014-04-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-03-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多