1、pyexharts中文官方文档:
https://pyecharts.org/#/zh-cn/global_vars
2、pyecharts安装命令:
python -m pip install pyecharts
3、若pyecharts安装成功但是导包出现 cannot import name 'Line' 解决方法:
- 输入命令:python -m pip install wheel
- 然后在输入:python -m pip install pyecharts==0.1.9.4
4、代码如下:
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from pyecharts import Line
def get_datas(file_name):
"""
获取文件数据
:param file_name: 目标文件名称
:return: [15.5,7.8]
"""
datas_list = []
with open(file_name, 'r') as f:
for line in f.readlines():
datas_list.append(line)
# 需要对数据进行切割