Echarts4r新西兰地图
我正在尝试使用库echarts4r
在R中创建新西兰的地图,但是该地图看起来很小,我无法弄清楚如何放大或确定LAT/LONG BONDARIES,以使其更大可见的。 这是我的代码(改编自文档中的示例 https://echarts://echarts4r.john-john-r.john--john-- coene.com/articles/map.html )
library(echarts4r.maps)
df <- data.frame(
region = c("Wellington", "Auckland"),
value = c(10,20)
)
df |>
e_charts(region) |>
em_map("New_Zealand") |>
e_map(value, map = "New_Zealand") |>
e_visual_map(value) |>
e_theme("infographic")
您知道如何在echarts4r中放大地图或设置lat/long界限吗? 任何帮助将不胜感激!
I'm trying to create a map of New Zealand in R using the library echarts4r
but the map looks tiny and I couldn't figure out how to zoom in or determine lat/long boundaries to make it more visible.
Here is my code (adapted from the example in the documentation https://echarts4r.john-coene.com/articles/map.html)
library(echarts4r.maps)
df <- data.frame(
region = c("Wellington", "Auckland"),
value = c(10,20)
)
df |>
e_charts(region) |>
em_map("New_Zealand") |>
e_map(value, map = "New_Zealand") |>
e_visual_map(value) |>
e_theme("infographic")
Do you know how to zoom in maps, or set lat/long boundaries, in echarts4r?
Any help would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为来自
echarts4r.maps
的地图的编码可能有问题,但我不确定。我可以告诉你,惠灵顿在
echarts4r
背后的数据中没有被列为新西兰的城市。我认为这可能就是原因,但这与渲染/变焦问题无关。我查找了新西兰的纬度/长边界,并在情节中使用了这一点,现在肯定是可读的。
I think there may be something wrong with the encoding of the map coming from
echarts4r.maps
, but I'm not sure.I can tell you that Wellington is not listed as a city in New Zealand in the data behind
echarts4r
. I thought that might have been why, but it had nothing to do with the rendering/zoom issue.I looked up the lat/long boundaries of NZ and used that in the plot, and it's definitely readable now.
祝福你凯特,真的在努力代码以闪亮将其用作条形图的过滤器。
使用 https://psim.shinyapps.io/echarts4r_callbacks/ 从鼠标中获得过滤。
这有多容易。
Bless you Kat, really was struggling to Code to get it in shiny add this to a shiny app to use it as a filter for a bar chart.
using https://psim.shinyapps.io/echarts4r_callbacks/ to get the filtering from the mouse click.
how easy is that.