Echarts实现今日头条疫情地图和用户画像

Echarts Chartjs

最近因为公司图表展示需求较多,因此学习整理下相关资料。javascript

前端图表框架也比较多,这里介绍两款。html

  • Apache Echarts
  • Chartjs

Apache Echarts 涵盖各行业图表,知足各类需求,功能至关丰富。然后起之秀chartjs以其简单灵活特性,也深得开发设计人员喜好。前端

https://echarts.apache.org (Echarts)

https://www.chartjs.org (Charts)java

二者都是开源项目,托管在Githubgit

https://github.com/apache/inc...

https://github.com/chartjs/Ch...github

二者社区活跃简单对比web

Apache Echarts

Chartjs

看上去Chartjs彷佛更活跃。apache

疫情地图

使用echarts map 来实现。npm

npm install echarts --save

导入地图数据后端

ECharts 中提供了Javascript和Json两种格式的地图数据

从Github项目文件下载 https://github.com/apache/inc...

从阿里提供地址下载 http://datav.aliyun.com/tools...

百度网盘 连接: https://pan.baidu.com/s/1fHfW... 提取码: 6fu5

项目代码片断

echarts.registerMap("china", chinaMap);

series: [
            {
              name: '确诊数',
              type: 'map',
              mapType: 'china',
              roam: false,
              label: {
                show: true,
                color: 'rgb(63, 63, 63)'
              },
              data: actualData
            }
          ]

配置 visualMap

对照配置文档调整相应的参数便可,也很简单。

https://echarts.apache.org/zh...

疫情数据来源 《腾讯新闻》

全国疫情

用户画像

仿照今日头条简版粉丝画像图。

粉丝画像

IP来源查询

IP分布

小结

该篇主要是对Echarts map 整理。欢迎分享和学习交流。

项目地址

https://github.com/cuteJ/shop... (后端)

https://github.com/cuteJ/shop... (前端)

项目演示地址

http://shop-web-mgt.onlythink...
相关文章
相关标签/搜索