Skip to content

Commit 101b152

Browse files
Merge pull request #3 from ZhengqiaoWang/2-offline-support-pyecharts-with-offline-assets
2-offline-support-pyecharts-with-offline-assets
2 parents b8f0c69 + 55f1258 commit 101b152

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "assets"]
2+
path = assets
3+
url = git@github.com:pyecharts/pyecharts-assets.git

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
## 如何使用
1515

16+
### 下载程序
17+
18+
```shell
19+
git clone --recursive git@github.com:ZhengqiaoWang/SystemResourceMonitor.git
20+
```
21+
1622
### 环境准备
1723

1824
首先,你需要保证你可以运行`Python3`,如果没有安装`Python3`请移步[Python官方网站](https://www.python.org/)下载安装`Python3`和对应的`Pip`

assets

Submodule assets added at be84584

exporter.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
from pyecharts import charts
22
from pyecharts import options as opts
3+
from pyecharts.globals import CurrentConfig, OnlineHostType
34
import os
45
import datetime
6+
import shutil
57

8+
CurrentConfig.ONLINE_HOST = "./assets/"
69

710
def exportCharts(process_name, data, output_path):
811
page = charts.Page(
@@ -39,6 +42,8 @@ def export(data_dict: dict, output_path: str, interval):
3942
summury_txt_path = os.path.join(output_path, "summury.txt")
4043

4144
os.makedirs(process_dat_path, exist_ok=True)
45+
shutil.copytree(os.path.join(os.path.dirname(os.path.abspath(
46+
__file__)), "assets", "assets"), os.path.join(process_dat_path, "assets"))
4247

4348
# 统计信息
4449
close_process_set = set() # 统计这个时间段内关闭的进程

0 commit comments

Comments
 (0)