Search

Travel Tips

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lifestyle

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Hotel Review

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

pyecharts绘制折线图-柱状图

使用Python中的pyecharts库读取json文件绘制折线图-柱状图

* 效果展示

image.png

* Python代码

```python
import json
from pyecharts import Bar, Line, Overlap
f = open('overlaps.json', encoding='gbk')
data = json.load(f)
date = data['date']
sales1 = data['sales1']
sales2 = data['sales2']
bar = Bar('line - bar')
bar.add('line', date, sales1)
line = Line('line')
line.add('Line', date, sales2)
overlap = Overlap()
overlap.add(bar)
overlap.add(line)
overlap.render('overlap.html')
```

* 注:数据文件链接: https://pan.baidu.com/s/1XLmgs0bqA8kt1Ws1TwoGNQ  密码: 5hja


这是一个简介
    互联网冲浪金牌选手。赖床世锦赛纪录保持者,拖延俱乐部顶级VIP,夜宵外卖一级鉴赏师,国家脱单脱贫重点扶持对象,中央戏精学院优秀学生,亚洲酸柠檬推广大使,国家一级退堂鼓表演艺术家。
评论 (125)
评论

我是 s enim interduante quis metus. Duis porta ornare nulla ut bibendum

Rosie

6 minutes ago

Sed ac lorem felis. Ut in odio lorem. Quisque magna dui, maximus ut commodo sed, vestibulum ac nibh. Aenean a tortor in sem tempus auctor

Agatha Christie

December 4, 2020 at 3:12 pm

Sed ac lorem felis. Ut in odio lorem. Quisque magna dui, maximus ut commodo sed, vestibulum ac nibh. Aenean a tortor in sem tempus auctor

Steven

December 4, 2020 at 3:12 pm

Donec in ullamcorper quam. Aenean vel nibh eu magna gravida fermentum. Praesent eget nisi pulvinar, sollicitudin eros vitae, tristique odio.

Danielle Steel

December 4, 2020 at 3:12 pm