将值添加到R Leaflet.minicharts中的图表

问题描述 投票:0回答:1

我想使用leaflet.minicharts包在我的图表上方添加值。

我目前的代码看起来像这样

addMinicharts(
87.2180, -45.3496,
chartdata = c(20, 40),
colorPalette = c("darkred", "darkblue"),
width = 45, height = 45, popup = popupArgs(
labels = c("Test1", "Test2")), showLabels = TRUE, labelText = TRUE) 

它给我一个带有标签“true”的图表和带有标签和值的弹出窗口。但我希望在图表顶部或栏内(而不是文本)上有值(不是标签)。

看着documentation,无法弄明白。谢谢

Map

r leaflet
1个回答
0
投票

解决了我自己。

我禁用了labelText = TRUE并增加了宽度/高度。它修复了一切。

目前的代码

addMinicharts(
87.2180, -45.3496,
chartdata = c(20, 40),
colorPalette = c("darkred", "darkblue"),
width = 100, height = 100, popup = popupArgs(
  labels = c("Test1", "Test2")), showLabels = TRUE) 

Map

© www.soinside.com 2019 - 2024. All rights reserved.