前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >R语言绘图:echart4r绘制动态趋势线

R语言绘图:echart4r绘制动态趋势线

作者头像
拴小林
发布2022-08-31 09:25:30
3900
发布2022-08-31 09:25:30
举报
文章被收录于专栏:数据驱动实践
代码语言:javascript
复制
setwd("C:\\Users\\USER\\Desktop")
df <- readxl::read_xlsx("io2021tonow.xlsx")
# library(stringr)
# df[,1] <- apply(df[,1], 2, function(x) paste0(str_sub(x,1,4),"-",str_sub(x,5,6)))

library(echarts4r)
df %>%
  e_chart(年月,reorder=TRUE) %>%
  e_line(出口) %>%
  e_line(进口) %>%
  e_bar(贸易差额) %>%
  # e_labels(show = TRUE, position = "top",rotate=TRUE) %>%
  e_animation(duration = 10000) %>%
  # e_tooltip(formatter = e_tooltip_item_formatter("currency"),
  #           axisPointer = list(type = "cross")) %>%
  e_axis_labels(x = "年月",y = "亿元人民币") %>%
  e_title("2021年1月~2022年3月海关进出口统计",
          subtext="http://www.customs.gov.cn/",left="25%") %>%
  e_legend(show = TRUE,type = "plain",top="95%")
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-05-03,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 数据驱动实践 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档