yihui / recharts Goto Github PK
View Code? Open in Web Editor NEWAn R Interface to Apache ECharts (incubating)
Home Page: https://recharts.yihui.org
License: Other
An R Interface to Apache ECharts (incubating)
Home Page: https://recharts.yihui.org
License: Other
Unfortunately someone else came up with the same name: http://recharts.org but our recharts still remains the top one in google search.
您好:
我使用如下命令进行安装recharts,install.packages('recharts',repos = c('http://yihui.name/xran', 'http://cran.rstudio.com'))。安装完毕之后在Rstudio中显示的版本是0.0.1。
当我运行https://github.com/taiyun/recharts/tree/master/inst/shiny/recharts_shiny_eForce这个网页中的例子时,提示错误“ERROR: could not find function "recharts.shiny.init"”。当不执行命令行“includeHTML(recharts.shiny.init()),”时,提示错误为“Error in (structure(function (input, output) :
could not find function "renderEcharts"“。
我使用的R版本为3.2.2,win7系统64位。
希望您能够帮我解决这个问题,谢谢~
Get this error in Rstudio.
> echart(iris, ~ Sepal.Length, ~ Sepal.Width)
Warning message:
In file(con, "r") :
file("") only supports open = "w+" and open = "w+b": using the former
It works in Rgui(open in a external browser). I've tried another package leaflet
, it works in Rstudio. So I have no idea where this warning come from.
hiyihui,
初次接触recharts这个强大的画图包,使用中遇到一些疑问,想请教下。盼解惑,非常感谢
1、使用echart()画出的图形中文显示均为乱码(完全使用 echart(chordEx1) 示例代码,只是将其中的部分英文改成中文)。我使用的R版本为64位3.2.2,图形结果显示在chrome浏览器里(结果链接粘到IE-8,图中的中文也还是乱码,初步排除是浏览器的原因)。
2、echart官网上各种图的OPTION数据代码都是json格式的数据,每次都要手动改成R代码才可以在R中运行么?有没有什么函数可以快速转换为R的格式?
echarty - Minimal R/Shiny Interface to ECharts.js
acknowledged this library as pioneer in its field 🥇
Hi!
Is this package still under dev ? Echart 3 is now out and seems very nice :)
Is this package will use it ?
Thanks!
Hello Yihui,
I'm trying to create K plot, but I can't let tool tip popup correctly. I think it's something wrong with JavaScript. Can you help me fix it up?
test=rbind( c(2320.26,2302.6,2287.3,2362.94),
c(2300,2291.3,2288.26,2308.38),
c(2295.35,2346.5,2295.35,2346.92),
c(2347.22,2358.98,2337.35,2363.8))
names(test)=c('open', 'close', 'high', 'low')
K1 = list(
title = list(
text = 'test',
subtext = 'From d3.js',
x = 'right',
y = 'bottom'
),
tooltip = list(
trigger = 'item',
# Something wrong here!!!
formatter = JS("function (params) {
var res = params[0].seriesName + ' ' + params[0].name;
res += 'open : ' + params[0].value[0] + ' high : ' + params[0].value[3];
res += ' close : ' + params[0].value[1] + ' low : ' + params[0].value[2];
return res;
}")
),
toolbox = list(
show = TRUE,
feature = list(
restore = list(show = TRUE),
saveAsImage = list(show = TRUE)
)
),
dataZoom =list(
show =TRUE,
realtime=TRUE,
start = 50,
end = 100
),
xAxis=list(
type = 'category',
boundaryGap = TRUE,
axisTick=list( onGap=FALSE),
splitLine=list(show=FALSE),
data =c(
"2013/1/24", "2013/1/25", "2013/1/28", "2013/1/29"
)
),
yAxis =list(
type='value',
scale=TRUE,
boundaryGap=c(0.01, 0.01)
),
series = list(
list(
type = 'k',
name = c('open','close','high','low'),
data = test
)))
echart(K1)
以堆叠的条形图为例:
http://echarts.baidu.com/doc/example/bar4.html
可以往series里面加的有stack, itemStyle, barGap, barCategoryGap等等。基本就是说这些bar怎么排列组合,标签怎么弄,柱子宽度高度什么的。
series : [
{
name:'直接访问',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
data:[320, 302, 301, 334, 390, 330, 320]
},
{
name:'邮件营销',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
data:[120, 132, 101, 134, 90, 230, 210]
},
{
name:'联盟广告',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
data:[220, 182, 191, 234, 290, 330, 310]
},
{
name:'视频广告',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
data:[150, 212, 201, 154, 190, 330, 410]
},
{
name:'搜索引擎',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
data:[820, 832, 901, 934, 1290, 1330, 1320]
}
]
你觉得怎么放进来比较合适?data_bar()还是拎另外一个函数出来?
echartr(mydata_count_prov, NAME, 病例数, type="map_china") %>% addHeatmap(data=mydata_count_town[,2:4], blurSize = 20, minAlpha=0.035,opacity=0.8) %>%
setTitle("") %>%
setTheme('dark')
In the server function, I cannot add the customize the input. My server function is as below:
server <- shinyServer( function(input, output) { output$scatterplot <- renderEChart({echartr(movies, x = input$x, y = input$y, type = 'point')}) } )
However, when I use ShinyApp, it keeps telling me object 'input' not found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.