我正在尝试在jupyterlab中呈现一些highcharter
图表
data(diamonds, economics_long, mpg, package = "ggplot2")
library(dplyr)
library(highcharter)
hchart(mpg, "scatter", hcaes(x = displ, y = hwy, group = class))
要让plotlywrapper
正常工作,您需要安装扩展程序。我可以想象必须为highcharter
建立类似的东西?
错误消息:
HTML widgets cannot be represented in plain text (need html)
答案 0 :(得分:0)
https://blog.ouseful.info/2018/04/26/r-htmlwidgets-in-jupyter-notebooks/
data(diamonds, economics_long, mpg, package = "ggplot2")
library(dplyr)
library(highcharter)
x=hchart(mpg, "scatter", hcaes(x = displ, y = hwy, group = class)) %>%
hc_size(width=800, height = 400)
saveWidget(x, 'demox.html', selfcontained = FALSE)
display_html('<iframe src="demox.html", width = 900, height = 500 ></iframe>')