betterme
commited on
Commit
•
c2f20b2
1
Parent(s):
6083c32
update
Browse files- pages/_pyecharts.py +31 -0
- pages/echarts.py +2 -2
- run.sh +1 -1
pages/_pyecharts.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
# @Project : AI. @by PyCharm
|
4 |
+
# @File : pyecharts
|
5 |
+
# @Time : 2023/4/25 19:52
|
6 |
+
# @Author : betterme
|
7 |
+
# @WeChat : meutils
|
8 |
+
# @Software : PyCharm
|
9 |
+
# @Description :
|
10 |
+
|
11 |
+
from meutils.pipe import *
|
12 |
+
import streamlit as st
|
13 |
+
from pyecharts import options as opts
|
14 |
+
from pyecharts.charts import Bar
|
15 |
+
from streamlit_echarts import st_pyecharts
|
16 |
+
|
17 |
+
st.title('测试')
|
18 |
+
|
19 |
+
bar = Bar()
|
20 |
+
|
21 |
+
# 添加数据和配置项
|
22 |
+
bar.add_xaxis(['a', 'b', 'c'])
|
23 |
+
bar.add_yaxis('', [200, 100, 300])
|
24 |
+
bar.set_global_opts(
|
25 |
+
title_opts=opts.TitleOpts(title="测试图"),
|
26 |
+
xaxis_opts=opts.AxisOpts(name=''),
|
27 |
+
yaxis_opts=opts.AxisOpts(name=''),
|
28 |
+
)
|
29 |
+
|
30 |
+
# 在 Streamlit 页面上显示图表
|
31 |
+
st_pyecharts(bar)
|
pages/echarts.py
CHANGED
@@ -8,8 +8,8 @@
|
|
8 |
# @Software : PyCharm
|
9 |
# @Description :
|
10 |
|
11 |
-
from
|
12 |
-
from
|
13 |
from streamlit_echarts import st_pyecharts
|
14 |
import streamlit as st
|
15 |
|
|
|
8 |
# @Software : PyCharm
|
9 |
# @Description :
|
10 |
|
11 |
+
from _pyecharts import options as opts
|
12 |
+
from _pyecharts.charts import Bar, WordCloud
|
13 |
from streamlit_echarts import st_pyecharts
|
14 |
import streamlit as st
|
15 |
|
run.sh
CHANGED
@@ -6,5 +6,5 @@
|
|
6 |
# @Software : PyCharm
|
7 |
# @Description : ${DESCRIPTION}
|
8 |
|
9 |
-
streamlit run _👋_.py --server.port
|
10 |
|
|
|
6 |
# @Software : PyCharm
|
7 |
# @Description : ${DESCRIPTION}
|
8 |
|
9 |
+
streamlit run _👋_.py --server.port 9955
|
10 |
|