cosname / recharts Goto Github PK
View Code? Open in Web Editor NEWAn interface to ECharts
Home Page: https://recharts.cosx.org
License: BSD 3-Clause "New" or "Revised" License
An interface to ECharts
Home Page: https://recharts.cosx.org
License: BSD 3-Clause "New" or "Revised" License
我用这个包在Rmarkdown的flexdashboard框架,单页的时候无任何问题,但是多页的时候,除了第一页后面的页面图都变得特别小。后来改成plotly包试了一下,就没有这个问题,有解决方案么?
如题,安装之后,显示找不到eMap函数,这是怎么回事呢
警告信息:
In Sys.setlocale("LC_CTYPE", "chs") :
操作系统报告说无法执行将本地化设成"chs"的请求.
本地系统本身就是中文的.
在Map例子里的代码跑出来地图全灰无着色,图例的中文不显示,鼠标放在某一区域只显示区域名,三个指标显示不出来
环境:国产Linuxdeepin系统,基于Ubuntu的,32位.R3.0.1
eBar 如何设置默认堆叠效果
代码如下:
eBar(as.data.frame(temp),opt=list(yAxis=list(list(name='a',type='value'),list(name='b',type='value',splitNumber=0.5)),series=list(list(stack='c'),list(stack='c'),list(type='line',yAxisIndex=1))))
得到的HTML code 如下:
"yAxis" : {
"" : {
"name" : "a",
"type" : "value"
},
"" : {
"name" : "b",
"type" : "value",
"splitNumber" : 0.5
},
"type" : "value"
},
yAxis参数该如何设置才能得到如下结果:
"yAxis" : [
{"name" : "a",
"type" : "value"
},
{"name" : "b",
"type" : "value",
"splitNumber" : 0.5
},
使用上述格式设置series参数可以得到希望的结果,为什么yAxis参数不行?
install_github(‘taiyun/recharts’)
Downloading github repo taiyun/recharts@master
Installing recharts
“C:/PROGRA1/R/R-311.2/bin/i386/R” –vanilla CMD
INSTALL
“C:\Users\AppData\Local\Temp\RtmpYPKjOV\devtools1cc8a6d5719\taiyun-recharts-8e4da23″
–library=”C:/Program Files/R/R-3.1.2/library”
–install-tests
您好,
我在安装的时候报错
require(devtools) devtools::install_github('taiyun/recharts')
Error in curl::curl_fetch_disk(url, x$path, handle = handle) :
Problem with the SSL CA cert (path? access rights?)
请问这个是怎么回事?
https://github.com/taiyun/recharts/blob/master/demo/recharts_knitr.Rmd
怀疑是js里变量冲突了造成的。
我把第二幅图和第三幅图的代码里的ec改成不同变量,就可以显示三幅图了
建议自动编号,避免冲突
Dear Maintainers,
I notice that some active R package developers publish this package for integrating html/js library with R.
Currently, rechrats does not work on shiny application, so maybe it is a time to refactor this package based on this framework.
How do you think?
麻烦帮忙看一下
library(recharts)
library(shiny)
app = shinyApp(
ui = fluidPage(eChartOutput('myChart')),
server = function(input, output) {
mapData <- head(mapTestData_chs, 5)
chart= eMap(mapData, namevar=~stdName, datavar = ~val1 + val2)
output$myChart = renderEChart(chart) }
)
if (interactive()) runApp(app)
@yummyZhou 把html5Vis中的几个好图塞进去吧:)
在下查看R中帮助文档好久,似乎没有发现如何绘制双Y轴的图形。如果可以,作者可否给一示例?谢啦~~~
預設會把所有的選項全部關閉。希望預設如同 http://echarts.baidu.com/doc/example/pie1.html 是打開的。
demo(recharts::recharts_shiny)
跑这个demo,跳出浏览器后初始状态是不显示图形的,要重新设置参数才能激活显出图形来.
自己做了一个小例子也是这样的:
https://gitcafe.com/badbye/shiny-recharts/blob/master/ui.R
里边设置了参数默认值是5,但运行出来没有图形,需要滑动sidebarPanel才能激活显示出来.如果在ui设置里没有那个sidebarPanel,那就永远没法激活了.
问题产生于用shiny做应用时,个别图形调用echarts,但又不需要shiny的ui交互的情况.
I can't see echarts plot when I use recharts in shiny app. Here is a reproducible example:
# server.R
library(shiny)
shinyServer(function(input, output) {
library(recharts)
option(shiny.transcode.json = FALSE)
output$res <- renderEcharts({
recharts.init()
eBarOutput <- eBar(iris[1:6, 1:4])
return(eBarOutput)
})
})
# ui.R
library(shiny)
library(recharts)
shinyUI(fluidPage(
titlePanel('test recharts shiny'),
sidebarLayout(
sidebarPanel(),
mainPanel(
includeHTML(recharts.shiny.init()),
htmlOutput('res')
)
)
))
And I tried demo(recharts::recharts_shiny)
, still couldn't see the results.
However, plot(eBar(iris[1:6, 1:4]))
will show echarts plot correctly.
I got the same result in both Ubuntu(12.04) and OS X(10.10). See sessioninfo below:
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
locale:
[1] zh_CN.UTF-8/zh_CN.UTF-8/zh_CN.UTF-8/C/zh_CN.UTF-8/zh_CN.UTF-8
attached base packages:
[1] tools stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] recharts_0.01 shiny_0.11 RJSONIO_1.3-0 colorout_1.0-3
loaded via a namespace (and not attached):
[1] digest_0.6.8 htmltools_0.2.6 httpuv_1.3.2 mime_0.2
[5] R6_2.0.1 Rcpp_0.11.3 xtable_1.7-4
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=zh_CN.UTF-8 LC_NUMERIC=C
[3] LC_TIME=zh_CN.UTF-8 LC_COLLATE=zh_CN.UTF-8
[5] LC_MONETARY=zh_CN.UTF-8 LC_MESSAGES=zh_CN.UTF-8
[7] LC_PAPER=zh_CN.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] tools stats graphics grDevices utils datasets methods base
other attached packages:
[1] recharts_0.01 RJSONIO_1.2-0.2 shiny_0.9.1
loaded via a namespace (and not attached):
[1] bitops_1.0-6 caTools_1.17 digest_0.6.4 httpuv_1.3.0 Rcpp_0.11.3 xtable_1.7-3
你好,阅读recharts包在线文档,我有个小问题。
帮助文档中有提到用echartsExample函数执行原生js代码,包中现在是不包含这个函数了吗?
用install_github安装包报错了...错误如下图:
查了一下据说是DESCRIPTION file里面的blank line造成的
https://groups.google.com/forum/#!topic/rdevtools/17da6WBNuqs
r-lib/devtools#394
把DESCRIPTION文件里面最后的空行删了试试?
有些shiny应用是在 这个recharts 的开发版本下做的 madlogos.github.io/recharts,现在想尝试这个包的新功能,发现包同名不能同时安装,如何共存
@yihui @yummyZhou recharts一搜一大把,r2echarts ?
load(url('http://yzhou.org/recharts/ChinaGDP.RData'))
plot(eMap(ChinaGDP, opt=list(title=list(text='2008~2010年大陆各省GDP占全国百分数'))))
在R3.1.0环境下,运行
ChinaGDP 数据集有三个变量,只画出来两个,第一个变量丢失。
另外在鼠标移动过去的时候 ,里面的有一个变量的值没有显示 :)
Sadly I am not successful in building the rechart. I am using RStudio and with R 2.15.2 in win7.
Here what I did and what I got:
> install_github('recharts','taiyun')
Installing github repo(s) recharts/master from taiyun
Downloading recharts.zip from https://github.com/taiyun/recharts/archive/master.zip
Installing package from C:\Users\ADMINI~1\AppData\Local\Temp\RtmpOAbRk5/recharts.zip
Installing recharts
"C:/PROGRA~1/R/R-215~1.2/bin/i386/R" --vanilla \
CMD INSTALL \
"C:\Users\Administrator\AppData\Local\Temp\RtmpOAbRk5\recharts-master" \
--library="C:/Program \
Files/R/R-2.15.2/library" --with-keep.source \
--install-tests
* installing *source* package 'recharts' ...
** R
** demo
** inst
** preparing package for lazy loading
Warning: package 'RJSONIO' was built under R version 2.15.3
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Warning: package 'RJSONIO' was built under R version 2.15.3
* DONE (recharts)
> demo(recharts::recharts)
错误于demo(recharts::recharts) : 没有与題目‘recharts’有关的演示
So do you have any suggestions?
thanks,
Sigma
在交互式命令行中,eMap()可以显示绘制的地图
但是当使用
Rscript test.r
执行脚本时,
地图无法绘制。
有什么现成的方法将Recharts的动态图嵌入Html5的slide?
请问如何控制图的尺寸, 如: width, height?
I can't find a way to customize the color and shape in scatter plot. I haven't try other plot but I wonder if you can show to how to do it? Thanks!
在一个坐标系统中绘制多个图形,比如一个柱状图一个折线图,如何绘制?
Hi,
I am working with this wonderful package, thank you very much for this.
I am working and I wanna use the title options like the app in ePlot iniside the opt parameter, i think that this behaivor is more naturally for the user.
Thanks for your atention
这是我的code:
df2 = data.frame(
saleNum=c(10,20,30,40,50,60,70,15,25,35,45,55,65,75,25,35,45,55,65,75,85),
weekDay=seq(1,21)
)
eLine(dat= df2, xvar=~weekDay, yvar=~saleNum) # 这个报错
eBar(dat= df2, xvar=~weekDay, yvar=~saleNum) # 这个没有问题
我想画指定x、y轴的折现折线图,是我的调用方法不对吗?
用eBar画堆叠图横坐标显示不全,有没有完整的参数说明?我看到eBar.R里面有一些参数,这些是所有的参数吗?想问具体的API文档有没有,
source("~/echartR.R")
library(recharts)
names(iris) = gsub(".", "", names(iris))
echartR(data=iris,x=~SepalLength,y=~PetalWidth,series = ~Species,
Error in echartR(data = iris, x = ~SepalLength, y = ~PetalWidth, series = ~Species, :type = 'scatter')
could not find function "mergeList"
以下是recharts更新计划, 将会按照功能逐步补齐代码, 文档等内容
~~内容将会在dev分支进行更新, 欢迎大家贡献代码. ~~
已经更新至master分支
文档结构已更新, 见:
JSON/List对象绘图
散点图
折线图
柱状图
地图
饼图
雷达图
K线图
箱线图
热力图
关系图
矩形树图
平行坐标
桑基图
漏斗图
仪表盘
象形柱图
主题河流图
日历图
工具箱修改
截图功能
图例修改
坐标轴修改
tooltip修改
图表联动
shiny
knitr
eBar如何设置X轴和Y轴的标题?
另外,opt 参数如何使用,可以提供例子吗?
eForce里面的例子 没画成功过,一片空白
networkMatrix <- matrix(c( c(0, 1, 2, 1, 2, 3, 6, 6, 1, 1, 1 ), c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), c(2, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 ), c(1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0 ), c(2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 ), c(3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 ), c(6, 0, 1, 1, 1, 1, 0, 6, 0, 1, 0 ), c(6, 0, 0, 1, 0, 0, 6, 0, 0, 0, 0 ), c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), c(1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 ), c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) ), ncol=11 ); propertyDf <- data.frame( category = c("人物", "家人", "家人", "家人", "家人", "朋友","朋友", "朋友", "朋友", "朋友", "朋友"), name = c("Steven Jobs", "Lisa Jobs", "Paul Jobs", " Kalala Jobs","Lauren Powell", "Steve woz Ike", "Obama", "Bill Gates","Jonathan", "Tim Cook", "Wayne"), value = c(10, 2, 3, 3, 7, 5, 8, 9, 4, 4, 0) ); rownames(propertyDf) = propertyDf$name; eForce(networkMatrix=networkMatrix, propertyDf=propertyDf)
Maybe due to the break change introduce in 0.10.0?
更改theme参数,图形效果没变,什么原因?
你好,请问怎样指定使用echarts的版本啊
以前有一个stack=T可以用,现在想通过stackGroup(unique(组名)),实现堆叠,可是不行。
x = data.frame(dt=1:6, buymoney=1:6, ordertype=c('充值','充值','充值','提现','提现', '提现'))
eBar(dat= x, xvar=~dt, yvar=~buymoney, series=~ordertype)
同一段代码在Rstudio的viewer中正常显示中文,但是在rmarkdown的flexdashboard格式里中文乱码了
title: 'test'
output:
flexdashboard::flex_dashboard:
orientation: rows
source_code: embed
runtime: shiny
现在是直接打开一个网页,用什么命令可以保持成一个文件或者压缩包呢?
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.