main
parent
62e200b706
commit
2cec91ba4f
@ -0,0 +1,53 @@
|
||||
# coding:utf-8
|
||||
from lxml import etree
|
||||
import os
|
||||
import csv
|
||||
|
||||
|
||||
def get_filenames(path):
|
||||
filenames = []
|
||||
for name in os.listdir(path):
|
||||
if os.path.isfile(os.path.join(path, name)):
|
||||
if name.find("html")!=-1:
|
||||
filenames.append(name)
|
||||
# print(filenames)
|
||||
return filenames
|
||||
|
||||
|
||||
def analysis_html(file_list):
|
||||
csv_title=["电影名","电影类型","上映时间","电影时长","票房"]
|
||||
file_info=[]
|
||||
box_title = ["电影名", "评论"]
|
||||
box_info = []
|
||||
for file_name in file_list:
|
||||
# print(file_name)
|
||||
fp=open("./file/"+file_name,"r",encoding="utf-8", errors='ignore')
|
||||
html=fp.read()
|
||||
fp.close()
|
||||
# print(html)
|
||||
h = etree.HTML(html)
|
||||
title = h.xpath("//div[@class='movie-cn-name']/h1/text()")[0]
|
||||
film_type = h.xpath("//div[@class='movie-type']/span/text()")[0]
|
||||
film_address_time = h.xpath("//div[@class='movie-show-time']/span/text()")[0]
|
||||
num=h.xpath("//div[@class='data-box']/div[3]//text()")
|
||||
box_office=''.join(num)
|
||||
film_address=film_address_time.split("/")[0]
|
||||
film_time=film_address_time.split("/")[-1]
|
||||
file_info.append([title,film_type,film_address,film_time,box_office])
|
||||
with open('./file/filmInfo.csv', 'w', newline='')as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(csv_title)
|
||||
writer.writerows(file_info)
|
||||
for i in h.xpath("//div[@class='comments']/article"):
|
||||
evaluate=i.xpath(".//span[@class='comment-content']/text()")[0]
|
||||
# print([title,evaluate])
|
||||
box_info.append([title,evaluate])
|
||||
print(box_info)
|
||||
with open('./file/box_info.csv', 'w', newline='', encoding='utf-8')as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(box_title)
|
||||
writer.writerows(box_info)
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_list=get_filenames('./file')
|
||||
analysis_html(file_list)
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
|
@ -0,0 +1,48 @@
|
||||
# coding: utf-8
|
||||
from pyecharts import options as opts
|
||||
from pyecharts.charts import Bar, Line
|
||||
from pyecharts.globals import ThemeType
|
||||
import pandas as pd
|
||||
film=pd.read_csv('./dataCleanFile/film_all.csv')
|
||||
print(film['电影名'].to_list)
|
||||
print(film['票房'].to_list)
|
||||
print([i for i in film['评分']])
|
||||
name_list=[i for i in film['电影名']]
|
||||
score=[i for i in film['评分']]
|
||||
num=[i for i in film['票房']]
|
||||
|
||||
|
||||
def overlap_bar_line(v1, v2, v4, v5):
|
||||
bar = (
|
||||
Bar(init_opts=opts.InitOpts(theme=ThemeType.DARK)) # 这里可以选择主题
|
||||
.add_xaxis(v1)
|
||||
.add_yaxis("票房", v2)
|
||||
.extend_axis(
|
||||
yaxis=opts.AxisOpts(
|
||||
axislabel_opts=opts.LabelOpts(formatter="{value}分"), interval=5
|
||||
)
|
||||
)
|
||||
.set_series_opts(label_opts=opts.LabelOpts(is_show=False))
|
||||
.set_global_opts(
|
||||
title_opts=opts.TitleOpts(title="电影票房评分关系图"),
|
||||
yaxis_opts=opts.AxisOpts(
|
||||
axislabel_opts=opts.LabelOpts(formatter="{value}万票")
|
||||
),
|
||||
xaxis_opts=opts.AxisOpts(name="电影名", axislabel_opts=opts.LabelOpts(rotate=-90, interval=0, font_size=10))
|
||||
)
|
||||
)
|
||||
line = Line()
|
||||
line.add_xaxis(v4).add_yaxis("评分", v5, yaxis_index=1, )
|
||||
bar.overlap(line)
|
||||
bar.render('./visualizationFile/bar_line_mixed_chart.html')
|
||||
|
||||
|
||||
v1 = name_list # x轴坐标
|
||||
v2 = num # 票房
|
||||
v4 = [i for i in range(0, 1000000)] # y轴
|
||||
v5 = score
|
||||
# y对应的数据
|
||||
|
||||
overlap_bar_line(v1, v2, v4, v5)
|
||||
|
||||
|
@ -0,0 +1,58 @@
|
||||
# coding:utf-8
|
||||
import requests
|
||||
import time
|
||||
from lxml import etree
|
||||
import csv
|
||||
# import requests
|
||||
import sys
|
||||
import io
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')
|
||||
|
||||
header = {
|
||||
"Cookie": "_lxsdk_cuid=17d9260857ac8-0261ae8e8cf9cf-404b032d-15f900-17d9260857ac8; _lx_utm=utm_source%3DBaidu%26utm_medium%3Dorganic; uuid_n_v=v1; uuid=781C6E1056F811EC8FA005B59D5174D5DC740A9AC92C4E35961CD1F8E2A30E14; _csrf=8a489d7aa02e782a3d650bb2c6b75d59905f022dc2cf7bfe73cea5aa615cd653; Hm_lvt_703e94591e87be68cc8da0da7cbd0be2=1638838573; _lxsdk=781C6E1056F811EC8FA005B59D5174D5DC740A9AC92C4E35961CD1F8E2A30E14; Hm_lpvt_703e94591e87be68cc8da0da7cbd0be2=1638845128; __mta=141972365.1638838584122.1638844841395.1638845127805.14; _lxsdk_s=17d928b96b8-f72-49f-714%7C%7C27",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
|
||||
}
|
||||
csv_tab=["电影名","评分"]
|
||||
def get_url():
|
||||
url_list = []
|
||||
score_list = []
|
||||
url = 'https://www.maoyan.com/films'
|
||||
html = requests.get(url, headers=header).content.decode()
|
||||
# print(html)
|
||||
h = etree.HTML(html)
|
||||
text = h.xpath('//dd')
|
||||
# print(text)
|
||||
for i in text:
|
||||
url1 = i.xpath('./div/a/@href')[0]
|
||||
url_list.append('https://www.maoyan.com'+url1)
|
||||
title=i.xpath("./div[@class='channel-detail movie-item-title']/a/text()")[0]
|
||||
score = i.xpath('./div[3]//text()')
|
||||
if len(score)>1:
|
||||
score1=score[0]+score[1]
|
||||
else:
|
||||
score1=score[0]
|
||||
# print(score1)
|
||||
# print(title)
|
||||
score_list.append([title,score1])
|
||||
# print(len(url_list))
|
||||
# with open('./file/score.csv', 'w', newline='')as f:
|
||||
# writer = csv.writer(f)
|
||||
# writer.writerow(csv_tab)
|
||||
# writer.writerows(score_list)
|
||||
return url_list
|
||||
def get_html_info(url_list):
|
||||
for url in url_list:
|
||||
header2 = {
|
||||
"Cookie": "H_WISE_SIDS_BFESS=40210_40320_40079_40364_40351_40366_40376_40398_40445_40466_40472_40317_40513; BDUSS_BFESS=pvcXVPZFpNMGlnLVRqMGdMRXJ4UGxKU2ZDRjZvWEJtM2RSYUhYd3cwczJiMEJtSVFBQUFBJCQAAAAAAAAAAAEAAABAYT~0tMCz5rPmbG92ZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADbiGGY24hhmMV; BDSFRCVID_BFESS=UJ4OJeC624xDmubtX6v5rpzIEm47KB5TH6f3ojSHmBX7Qt33nYFJEG0Psx8g0Kub-FLJogKKLmOTHpuF_2uxOjjg8UtVJeC6EG0Ptf8g0f5; H_BDCLCKID_SF_BFESS=JnCH_DDhJKt3fP36q4ofK4_WKUnh-I62aJ0f3qbvWJ5TMCoL04jO-4D30fR3-MQ7bN5y2tta5hOKShPCb6-M3qFq-UriJ-LfLaQLhUby3l02VhQIe-t2yU_IXJJXQ4RMW23rWl7mWPJKfJbND55KLntYhpJBKpIf2J6KaJoCbnLWeIJIjjCMD5v-jaLeq6naaK6H0n6VMTrjDCvvW5Ocy4LdjG5QLMPe0anJXCJD3qvVh-K4ylQpMRIg3-Aq54RkJjQjLMcgWxj8SRcaLJjqQfbQ0-5hqP-jW2cua-KXHR7JOpvshfnxyb80QRPH-Rv92DQMVU52QqcqEIQHQT3m5-5bbN3ht6IJfRKf_K-MtKvbfP0k2KcfbJttbUIX5-RLf5QkVp7F5l8-hl8x3qQWKR0RjxRJbJOEWmTfWM7DtDQxOKQphpQaypjbbqj7-ljRt6baKInN3KJmHpC9bT3vLfuwDJ0L2-biW2JL2Mbd-P5P_IoG2Mn8M4bb3qOpBtQmJeTxoUJ25DnJh-PGe6KWj65LDaLOqbO0K5v0QbP8Kbu38fnDXU6qLT5XeH7wbPnNbN-qBhQ--PczsJCmjU4Kjl0njxQybt6KWD6NXfnhLf5FelQH0MonDh8-3H7MJUntKHTuaMoO5hvv8b6O3M725fKmDloOW-TB5bbPLUQF5l8-sq0x0bOte-bQbG_EJjLjfRkf_KtQ-n8_fbTph4OhhR08-UAX5-RLfaTZ_p7F5l8-hCb9Q-ch-R0RjlDtbJOEWmTL_I3c0D5xOKQIDPn80UkDLRAfQR0etKokKqcN3KJmqPP9bT3v5tjDQ4vZ2-biW2JL2Mbd-P5P_IoG2Mn8M4bb3qOpBtQmJeTxoUJ25DnJhbLGe4bK-TryjNADtUK; ZFY=b:BflOtj91mDiN9pZVZa5s8mhkTL0e:BAjKS5DO:A2Hl18:C; BAIDUID_BFESS=6DE054C0AAD46F264BDDF0A3F9303A0D:FG=1",
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36"
|
||||
}
|
||||
html = requests.get(url, headers=header2).content.decode()
|
||||
h = etree.HTML(html)
|
||||
title = h.xpath("//div[@class='movie-cn-name']/h1//text()")
|
||||
print(title)
|
||||
fp=open("./file/"+str(title)+".html","w",encoding='utf-8')
|
||||
fp.write(html)
|
||||
fp.close()
|
||||
# print(html)
|
||||
if __name__ == '__main__':
|
||||
get_html_info(get_url())
|
@ -0,0 +1,16 @@
|
||||
from pyecharts.charts import Pie
|
||||
from pyecharts import options as opts
|
||||
|
||||
import pandas as pd
|
||||
|
||||
film_type=pd.read_csv('./dataCleanFile/film_all.csv').groupby("电影类型").count()["电影名"]
|
||||
pie = Pie()
|
||||
|
||||
# 添加数据
|
||||
pie.add('', [list(z) for z in zip(film_type.index,film_type)], radius=["40%", "75%"])
|
||||
|
||||
# 设置全局选项
|
||||
pie.set_global_opts(title_opts=opts.TitleOpts(title="各类型电影占比",pos_top=20))
|
||||
|
||||
# 渲染图表到文件
|
||||
pie.render("./visualizationFile/pie_chart.html")
|
@ -0,0 +1,23 @@
|
||||
from pyecharts.charts import Line
|
||||
from pyecharts import options as opts
|
||||
|
||||
import pandas as pd
|
||||
data = {
|
||||
}
|
||||
film=pd.read_csv('./dataCleanFile/film_all.csv')
|
||||
film['上映时间']=film['上映时间'].str[0:10]
|
||||
group_film=film.sort_values("上映时间").groupby("上映时间")["票房"].sum()
|
||||
for i in zip(group_film.index,group_film):
|
||||
data[i[0]]=i[1]
|
||||
print(list(data.values()))
|
||||
line=Line()
|
||||
line.add_xaxis(list(data))
|
||||
line.add_yaxis("票房(万)", list(data.values()))
|
||||
|
||||
|
||||
line.set_global_opts(title_opts=opts.TitleOpts(title="近日热播电影每日票房",pos_left="right"),
|
||||
yaxis_opts=opts.AxisOpts(name="票房(万)"),
|
||||
xaxis_opts=opts.AxisOpts(name="日期",axislabel_opts=opts.LabelOpts(rotate=-90,interval=0,font_size=10)))
|
||||
line.render("./visualizationFile/line_example.html")
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
# coding:utf-8
|
||||
import requests
|
||||
import time
|
||||
from lxml import etree
|
||||
import csv
|
||||
# import requests
|
||||
import sys
|
||||
import io
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')
|
||||
url="https://www.maoyan.com/films/1334237?requestCode=ab89e2c80d235bfd33c7d2fe39bc9b2amfbdg"
|
||||
header2 = {
|
||||
"Cookie": "H_WISE_SIDS_BFESS=40210_40320_40079_40364_40351_40366_40376_40398_40445_40466_40472_40317_40513; BDUSS_BFESS=pvcXVPZFpNMGlnLVRqMGdMRXJ4UGxKU2ZDRjZvWEJtM2RSYUhYd3cwczJiMEJtSVFBQUFBJCQAAAAAAAAAAAEAAABAYT~0tMCz5rPmbG92ZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADbiGGY24hhmMV; BDSFRCVID_BFESS=UJ4OJeC624xDmubtX6v5rpzIEm47KB5TH6f3ojSHmBX7Qt33nYFJEG0Psx8g0Kub-FLJogKKLmOTHpuF_2uxOjjg8UtVJeC6EG0Ptf8g0f5; H_BDCLCKID_SF_BFESS=JnCH_DDhJKt3fP36q4ofK4_WKUnh-I62aJ0f3qbvWJ5TMCoL04jO-4D30fR3-MQ7bN5y2tta5hOKShPCb6-M3qFq-UriJ-LfLaQLhUby3l02VhQIe-t2yU_IXJJXQ4RMW23rWl7mWPJKfJbND55KLntYhpJBKpIf2J6KaJoCbnLWeIJIjjCMD5v-jaLeq6naaK6H0n6VMTrjDCvvW5Ocy4LdjG5QLMPe0anJXCJD3qvVh-K4ylQpMRIg3-Aq54RkJjQjLMcgWxj8SRcaLJjqQfbQ0-5hqP-jW2cua-KXHR7JOpvshfnxyb80QRPH-Rv92DQMVU52QqcqEIQHQT3m5-5bbN3ht6IJfRKf_K-MtKvbfP0k2KcfbJttbUIX5-RLf5QkVp7F5l8-hl8x3qQWKR0RjxRJbJOEWmTfWM7DtDQxOKQphpQaypjbbqj7-ljRt6baKInN3KJmHpC9bT3vLfuwDJ0L2-biW2JL2Mbd-P5P_IoG2Mn8M4bb3qOpBtQmJeTxoUJ25DnJh-PGe6KWj65LDaLOqbO0K5v0QbP8Kbu38fnDXU6qLT5XeH7wbPnNbN-qBhQ--PczsJCmjU4Kjl0njxQybt6KWD6NXfnhLf5FelQH0MonDh8-3H7MJUntKHTuaMoO5hvv8b6O3M725fKmDloOW-TB5bbPLUQF5l8-sq0x0bOte-bQbG_EJjLjfRkf_KtQ-n8_fbTph4OhhR08-UAX5-RLfaTZ_p7F5l8-hCb9Q-ch-R0RjlDtbJOEWmTL_I3c0D5xOKQIDPn80UkDLRAfQR0etKokKqcN3KJmqPP9bT3v5tjDQ4vZ2-biW2JL2Mbd-P5P_IoG2Mn8M4bb3qOpBtQmJeTxoUJ25DnJhbLGe4bK-TryjNADtUK; ZFY=b:BflOtj91mDiN9pZVZa5s8mhkTL0e:BAjKS5DO:A2Hl18:C; BAIDUID_BFESS=6DE054C0AAD46F264BDDF0A3F9303A0D:FG=1",
|
||||
"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36"
|
||||
}
|
||||
html = requests.get(url, headers=header2).content.decode()
|
||||
h = etree.HTML(html)
|
||||
print(html)
|
||||
title= h.xpath("//div[@class='movie-cn-name']/h1//text()")
|
||||
print(title)
|
@ -0,0 +1,427 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Awesome-pyecharts</title>
|
||||
<script type="text/javascript" src="https://assets.pyecharts.org/assets/v5/echarts.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body >
|
||||
<div id="a96155b406474ac49dbae6ecab7251d5" class="chart-container" style="width:900px; height:500px; "></div>
|
||||
<script>
|
||||
var chart_a96155b406474ac49dbae6ecab7251d5 = echarts.init(
|
||||
document.getElementById('a96155b406474ac49dbae6ecab7251d5'), 'dark', {renderer: 'canvas'});
|
||||
var option_a96155b406474ac49dbae6ecab7251d5 = {
|
||||
"animation": true,
|
||||
"animationThreshold": 2000,
|
||||
"animationDuration": 1000,
|
||||
"animationEasing": "cubicOut",
|
||||
"animationDelay": 0,
|
||||
"animationDurationUpdate": 300,
|
||||
"animationEasingUpdate": "cubicOut",
|
||||
"animationDelayUpdate": 0,
|
||||
"aria": {
|
||||
"enabled": false
|
||||
},
|
||||
"series": [
|
||||
{
|
||||
"type": "bar",
|
||||
"name": "\u7968\u623f",
|
||||
"legendHoverLink": true,
|
||||
"data": [
|
||||
2508,
|
||||
4813,
|
||||
62875,
|
||||
171373,
|
||||
1566,
|
||||
79003,
|
||||
118,
|
||||
36773,
|
||||
0,
|
||||
148,
|
||||
16170,
|
||||
95385,
|
||||
286,
|
||||
0,
|
||||
8321,
|
||||
0,
|
||||
0,
|
||||
1839,
|
||||
665,
|
||||
176,
|
||||
200011,
|
||||
836,
|
||||
18835,
|
||||
458,
|
||||
50632,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
4963,
|
||||
28586
|
||||
],
|
||||
"realtimeSort": false,
|
||||
"showBackground": false,
|
||||
"stackStrategy": "samesign",
|
||||
"cursor": "pointer",
|
||||
"barMinHeight": 0,
|
||||
"barCategoryGap": "20%",
|
||||
"barGap": "30%",
|
||||
"large": false,
|
||||
"largeThreshold": 400,
|
||||
"seriesLayoutBy": "column",
|
||||
"datasetIndex": 0,
|
||||
"clip": true,
|
||||
"zlevel": 0,
|
||||
"z": 2,
|
||||
"label": {
|
||||
"show": false,
|
||||
"margin": 8
|
||||
},
|
||||
"rippleEffect": {
|
||||
"show": true,
|
||||
"brushType": "stroke",
|
||||
"scale": 2.5,
|
||||
"period": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "line",
|
||||
"name": "\u8bc4\u5206",
|
||||
"connectNulls": false,
|
||||
"xAxisIndex": 0,
|
||||
"yAxisIndex": 1,
|
||||
"symbolSize": 4,
|
||||
"showSymbol": true,
|
||||
"smooth": false,
|
||||
"clip": true,
|
||||
"step": false,
|
||||
"data": [
|
||||
[
|
||||
0,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
1,
|
||||
8.1
|
||||
],
|
||||
[
|
||||
2,
|
||||
9.3
|
||||
],
|
||||
[
|
||||
3,
|
||||
9.4
|
||||
],
|
||||
[
|
||||
4,
|
||||
9.3
|
||||
],
|
||||
[
|
||||
5,
|
||||
8.5
|
||||
],
|
||||
[
|
||||
6,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
7,
|
||||
8.5
|
||||
],
|
||||
[
|
||||
8,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
9,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
10,
|
||||
9.7
|
||||
],
|
||||
[
|
||||
11,
|
||||
9.3
|
||||
],
|
||||
[
|
||||
12,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
13,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
14,
|
||||
8.2
|
||||
],
|
||||
[
|
||||
15,
|
||||
9.6
|
||||
],
|
||||
[
|
||||
16,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
17,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
18,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
19,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
20,
|
||||
9.4
|
||||
],
|
||||
[
|
||||
21,
|
||||
9.0
|
||||
],
|
||||
[
|
||||
22,
|
||||
8.6
|
||||
],
|
||||
[
|
||||
23,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
24,
|
||||
8.7
|
||||
],
|
||||
[
|
||||
25,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
26,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
27,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
28,
|
||||
0.0
|
||||
],
|
||||
[
|
||||
29,
|
||||
9.3
|
||||
]
|
||||
],
|
||||
"hoverAnimation": true,
|
||||
"label": {
|
||||
"show": true,
|
||||
"margin": 8
|
||||
},
|
||||
"logBase": 10,
|
||||
"seriesLayoutBy": "column",
|
||||
"lineStyle": {
|
||||
"show": true,
|
||||
"width": 1,
|
||||
"opacity": 1,
|
||||
"curveness": 0,
|
||||
"type": "solid"
|
||||
},
|
||||
"areaStyle": {
|
||||
"opacity": 0
|
||||
},
|
||||
"zlevel": 0,
|
||||
"z": 0
|
||||
}
|
||||
],
|
||||
"legend": [
|
||||
{
|
||||
"data": [
|
||||
"\u7968\u623f",
|
||||
"\u8bc4\u5206"
|
||||
],
|
||||
"selected": {},
|
||||
"show": true,
|
||||
"padding": 5,
|
||||
"itemGap": 10,
|
||||
"itemWidth": 25,
|
||||
"itemHeight": 14,
|
||||
"backgroundColor": "transparent",
|
||||
"borderColor": "#ccc",
|
||||
"borderRadius": 0,
|
||||
"pageButtonItemGap": 5,
|
||||
"pageButtonPosition": "end",
|
||||
"pageFormatter": "{current}/{total}",
|
||||
"pageIconColor": "#2f4554",
|
||||
"pageIconInactiveColor": "#aaa",
|
||||
"pageIconSize": 15,
|
||||
"animationDurationUpdate": 800,
|
||||
"selector": false,
|
||||
"selectorPosition": "auto",
|
||||
"selectorItemGap": 7,
|
||||
"selectorButtonGap": 10
|
||||
}
|
||||
],
|
||||
"tooltip": {
|
||||
"show": true,
|
||||
"trigger": "item",
|
||||
"triggerOn": "mousemove|click",
|
||||
"axisPointer": {
|
||||
"type": "line"
|
||||
},
|
||||
"showContent": true,
|
||||
"alwaysShowContent": false,
|
||||
"showDelay": 0,
|
||||
"hideDelay": 100,
|
||||
"enterable": false,
|
||||
"confine": false,
|
||||
"appendToBody": false,
|
||||
"transitionDuration": 0.4,
|
||||
"textStyle": {
|
||||
"fontSize": 14
|
||||
},
|
||||
"borderWidth": 0,
|
||||
"padding": 5,
|
||||
"order": "seriesAsc"
|
||||
},
|
||||
"xAxis": [
|
||||
{
|
||||
"name": "\u7535\u5f71\u540d",
|
||||
"show": true,
|
||||
"scale": false,
|
||||
"nameLocation": "end",
|
||||
"nameGap": 15,
|
||||
"gridIndex": 0,
|
||||
"axisLabel": {
|
||||
"show": true,
|
||||
"rotate": -90,
|
||||
"margin": 8,
|
||||
"interval": 0,
|
||||
"fontSize": 10
|
||||
},
|
||||
"inverse": false,
|
||||
"offset": 0,
|
||||
"splitNumber": 5,
|
||||
"minInterval": 0,
|
||||
"splitLine": {
|
||||
"show": true,
|
||||
"lineStyle": {
|
||||
"show": true,
|
||||
"width": 1,
|
||||
"opacity": 1,
|
||||
"curveness": 0,
|
||||
"type": "solid"
|
||||
}
|
||||
},
|
||||
"data": [
|
||||
"\u4e09\u53c9\u621f",
|
||||
"\u4e0d\u80fd\u9519\u8fc7\u7684\u53ea\u6709\u4f60",
|
||||
"\u4e5d\u9f99\u57ce\u5be8\u4e4b\u56f4\u57ce",
|
||||
"\u4eba\u751f\u5927\u4e8b",
|
||||
"\u4eca\u591c\uff0c\u5c31\u7b97\u8fd9\u4efd\u7231\u604b\u4ece\u4e16\u754c\u4e0a\u6d88\u5931",
|
||||
"\u4f60\u60f3\u6d3b\u51fa\u600e\u6837\u7684\u4eba\u751f",
|
||||
"\u518d\u4f1a\u957f\u6c5f",
|
||||
"\u529f\u592b\u718a\u732b4",
|
||||
"\u52a0\u83f2\u732b\u5bb6\u65cf",
|
||||
"\u53d1\u5c0f\u513f\u4e07\u5c81",
|
||||
"\u54c8\u5c14\u7684\u79fb\u52a8\u57ce\u5821",
|
||||
"\u54e5\u65af\u62c9\u5927\u6218\u91d1\u521a2\uff1a\u5e1d\u56fd\u5d1b\u8d77",
|
||||
"\u56db\u6708\u5973\u53cb",
|
||||
"\u5742\u672c\u9f99\u4e00\uff1a\u6770\u4f5c",
|
||||
"\u5f77\u5fa8\u4e4b\u5203",
|
||||
"\u6211\u624d\u4e0d\u8981\u548c\u4f60\u505a\u670b\u53cb\u5462",
|
||||
"\u626b\u9ed1\u00b7\u51b3\u4e0d\u653e\u5f03",
|
||||
"\u671d\u4e91\u66ae\u96e8",
|
||||
"\u6731\u540c\u5728\u4e09\u5e74\u7ea7\u4e22\u5931\u4e86\u8d85\u80fd\u529b",
|
||||
"\u6bcd\u4eb2\u7684\u76f4\u89c9",
|
||||
"\u718a\u51fa\u6ca1\u00b7\u9006\u8f6c\u65f6\u7a7a",
|
||||
"\u7279\u6280\u72c2\u4eba",
|
||||
"\u7329\u7403\u5d1b\u8d77\uff1a\u65b0\u4e16\u754c",
|
||||
"\u76df\u519b\u6562\u6b7b\u961f",
|
||||
"\u7ef4\u548c\u9632\u66b4\u961f",
|
||||
"\u7f8e\u56fd\u5185\u6218",
|
||||
"\u8c08\u5224\u4e13\u5bb6",
|
||||
"\u8d70\u8d70\u505c\u505c",
|
||||
"\u9519\u8fc7\u4f60\u7684\u90a3\u4e9b\u5e74",
|
||||
"\u95f4\u8c0d\u8fc7\u5bb6\u5bb6 \u4ee3\u53f7\uff1a\u767d"
|
||||
]
|
||||
}
|
||||
],
|
||||
"yAxis": [
|
||||
{
|
||||
"show": true,
|
||||
"scale": false,
|
||||
"nameLocation": "end",
|
||||
"nameGap": 15,
|
||||
"gridIndex": 0,
|
||||
"axisLabel": {
|
||||
"show": true,
|
||||
"margin": 8,
|
||||
"formatter": "{value}\u4e07\u7968"
|
||||
},
|
||||
"inverse": false,
|
||||
"offset": 0,
|
||||
"splitNumber": 5,
|
||||
"minInterval": 0,
|
||||
"splitLine": {
|
||||
"show": true,
|
||||
"lineStyle": {
|
||||
"show": true,
|
||||
"width": 1,
|
||||
"opacity": 1,
|
||||
"curveness": 0,
|
||||
"type": "solid"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"show": true,
|
||||
"scale": false,
|
||||
"nameLocation": "end",
|
||||
"nameGap": 15,
|
||||
"interval": 5,
|
||||
"gridIndex": 0,
|
||||
"axisLabel": {
|
||||
"show": true,
|
||||
"margin": 8,
|
||||
"formatter": "{value}\u5206"
|
||||
},
|
||||
"inverse": false,
|
||||
"offset": 0,
|
||||
"splitNumber": 5,
|
||||
"minInterval": 0,
|
||||
"splitLine": {
|
||||
"show": true,
|
||||
"lineStyle": {
|
||||
"show": true,
|
||||
"width": 1,
|
||||
"opacity": 1,
|
||||
"curveness": 0,
|
||||
"type": "solid"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"title": [
|
||||
{
|
||||
"show": true,
|
||||
"text": "\u7535\u5f71\u7968\u623f\u8bc4\u5206\u5173\u7cfb\u56fe",
|
||||
"target": "blank",
|
||||
"subtarget": "blank",
|
||||
"padding": 5,
|
||||
"itemGap": 10,
|
||||
"textAlign": "auto",
|
||||
"textVerticalAlign": "auto",
|
||||
"triggerEvent": false
|
||||
}
|
||||
]
|
||||
};
|
||||
chart_a96155b406474ac49dbae6ecab7251d5.setOption(option_a96155b406474ac49dbae6ecab7251d5);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,280 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Awesome-pyecharts</title>
|
||||
<script type="text/javascript" src="https://assets.pyecharts.org/assets/v5/echarts.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body >
|
||||
<div id="ee0cf3b94bdd4a299381e315bfd81d59" class="chart-container" style="width:900px; height:500px; "></div>
|
||||
<script>
|
||||
var chart_ee0cf3b94bdd4a299381e315bfd81d59 = echarts.init(
|
||||
document.getElementById('ee0cf3b94bdd4a299381e315bfd81d59'), 'white', {renderer: 'canvas'});
|
||||
var option_ee0cf3b94bdd4a299381e315bfd81d59 = {
|
||||
"animation": true,
|
||||
"animationThreshold": 2000,
|
||||
"animationDuration": 1000,
|
||||
"animationEasing": "cubicOut",
|
||||
"animationDelay": 0,
|
||||
"animationDurationUpdate": 300,
|
||||
"animationEasingUpdate": "cubicOut",
|
||||
"animationDelayUpdate": 0,
|
||||
"aria": {
|
||||
"enabled": false
|
||||
},
|
||||
"color": [
|
||||
"#5470c6",
|
||||
"#91cc75",
|
||||
"#fac858",
|
||||
"#ee6666",
|
||||
"#73c0de",
|
||||
"#3ba272",
|
||||
"#fc8452",
|
||||
"#9a60b4",
|
||||
"#ea7ccc"
|
||||
],
|
||||
"series": [
|
||||
{
|
||||
"type": "line",
|
||||
"name": "\u7968\u623f(\u4e07)",
|
||||
"connectNulls": false,
|
||||
"xAxisIndex": 0,
|
||||
"symbolSize": 4,
|
||||
"showSymbol": true,
|
||||
"smooth": false,
|
||||
"clip": true,
|
||||
"step": false,
|
||||
"data": [
|
||||
[
|
||||
"2024-02-10",
|
||||
200011
|
||||
],
|
||||
[
|
||||
"2024-03-22",
|
||||
36773
|
||||
],
|
||||
[
|
||||
"2024-03-29",
|
||||
95385
|
||||
],
|
||||
[
|
||||
"2024-04-03",
|
||||
79003
|
||||
],
|
||||
[
|
||||
"2024-04-30",
|
||||
44756
|
||||
],
|
||||
[
|
||||
"2024-05-01",
|
||||
113507
|
||||
],
|
||||
[
|
||||
"2024-05-10",
|
||||
18835
|
||||
],
|
||||
[
|
||||
"2024-05-17",
|
||||
10996
|
||||
],
|
||||
[
|
||||
"2024-05-18",
|
||||
1852
|
||||
],
|
||||
[
|
||||
"2024-05-19",
|
||||
4963
|
||||
],
|
||||
[
|
||||
"2024-05-20",
|
||||
4813
|
||||
],
|
||||
[
|
||||
"2024-05-24",
|
||||
3408
|
||||
],
|
||||
[
|
||||
"2024-05-25",
|
||||
172038
|
||||
],
|
||||
[
|
||||
"2024-05-31",
|
||||
0
|
||||
],
|
||||
[
|
||||
"2024-06-01",
|
||||
0
|
||||
],
|
||||
[
|
||||
"2024-06-07",
|
||||
0
|
||||
],
|
||||
[
|
||||
"2024-06-08",
|
||||
0
|
||||
]
|
||||
],
|
||||
"hoverAnimation": true,
|
||||
"label": {
|
||||
"show": true,
|
||||
"margin": 8
|
||||
},
|
||||
"logBase": 10,
|
||||
"seriesLayoutBy": "column",
|
||||
"lineStyle": {
|
||||
"show": true,
|
||||
"width": 1,
|
||||
"opacity": 1,
|
||||
"curveness": 0,
|
||||
"type": "solid"
|
||||
},
|
||||
"areaStyle": {
|
||||
"opacity": 0
|
||||
},
|
||||
"zlevel": 0,
|
||||
"z": 0
|
||||
}
|
||||
],
|
||||
"legend": [
|
||||
{
|
||||
"data": [
|
||||
"\u7968\u623f(\u4e07)"
|
||||
],
|
||||
"selected": {},
|
||||
"show": true,
|
||||
"padding": 5,
|
||||
"itemGap": 10,
|
||||
"itemWidth": 25,
|
||||
"itemHeight": 14,
|
||||
"backgroundColor": "transparent",
|
||||
"borderColor": "#ccc",
|
||||
"borderRadius": 0,
|
||||
"pageButtonItemGap": 5,
|
||||
"pageButtonPosition": "end",
|
||||
"pageFormatter": "{current}/{total}",
|
||||
"pageIconColor": "#2f4554",
|
||||
"pageIconInactiveColor": "#aaa",
|
||||
"pageIconSize": 15,
|
||||
"animationDurationUpdate": 800,
|
||||
"selector": false,
|
||||
"selectorPosition": "auto",
|
||||
"selectorItemGap": 7,
|
||||
"selectorButtonGap": 10
|
||||
}
|
||||
],
|
||||
"tooltip": {
|
||||
"show": true,
|
||||
"trigger": "item",
|
||||
"triggerOn": "mousemove|click",
|
||||
"axisPointer": {
|
||||
"type": "line"
|
||||
},
|
||||
"showContent": true,
|
||||
"alwaysShowContent": false,
|
||||
"showDelay": 0,
|
||||
"hideDelay": 100,
|
||||
"enterable": false,
|
||||
"confine": false,
|
||||
"appendToBody": false,
|
||||
"transitionDuration": 0.4,
|
||||
"textStyle": {
|
||||
"fontSize": 14
|
||||
},
|
||||
"borderWidth": 0,
|
||||
"padding": 5,
|
||||
"order": "seriesAsc"
|
||||
},
|
||||
"xAxis": [
|
||||
{
|
||||
"name": "\u65e5\u671f",
|
||||
"show": true,
|
||||
"scale": false,
|
||||
"nameLocation": "end",
|
||||
"nameGap": 15,
|
||||
"gridIndex": 0,
|
||||
"axisLabel": {
|
||||
"show": true,
|
||||
"rotate": -90,
|
||||
"margin": 8,
|
||||
"interval": 0,
|
||||
"fontSize": 10
|
||||
},
|
||||
"inverse": false,
|
||||
"offset": 0,
|
||||
"splitNumber": 5,
|
||||
"minInterval": 0,
|
||||
"splitLine": {
|
||||
"show": true,
|
||||
"lineStyle": {
|
||||
"show": true,
|
||||
"width": 1,
|
||||
"opacity": 1,
|
||||
"curveness": 0,
|
||||
"type": "solid"
|
||||
}
|
||||
},
|
||||
"data": [
|
||||
"2024-02-10",
|
||||
"2024-03-22",
|
||||
"2024-03-29",
|
||||
"2024-04-03",
|
||||
"2024-04-30",
|
||||
"2024-05-01",
|
||||
"2024-05-10",
|
||||
"2024-05-17",
|
||||
"2024-05-18",
|
||||
"2024-05-19",
|
||||
"2024-05-20",
|
||||
"2024-05-24",
|
||||
"2024-05-25",
|
||||
"2024-05-31",
|
||||
"2024-06-01",
|
||||
"2024-06-07",
|
||||
"2024-06-08"
|
||||
]
|
||||
}
|
||||
],
|
||||
"yAxis": [
|
||||
{
|
||||
"name": "\u7968\u623f(\u4e07)",
|
||||
"show": true,
|
||||
"scale": false,
|
||||
"nameLocation": "end",
|
||||
"nameGap": 15,
|
||||
"gridIndex": 0,
|
||||
"inverse": false,
|
||||
"offset": 0,
|
||||
"splitNumber": 5,
|
||||
"minInterval": 0,
|
||||
"splitLine": {
|
||||
"show": true,
|
||||
"lineStyle": {
|
||||
"show": true,
|
||||
"width": 1,
|
||||
"opacity": 1,
|
||||
"curveness": 0,
|
||||
"type": "solid"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"title": [
|
||||
{
|
||||
"show": true,
|
||||
"text": "\u8fd1\u65e5\u70ed\u64ad\u7535\u5f71\u6bcf\u65e5\u7968\u623f",
|
||||
"target": "blank",
|
||||
"subtarget": "blank",
|
||||
"left": "right",
|
||||
"padding": 5,
|
||||
"itemGap": 10,
|
||||
"textAlign": "auto",
|
||||
"textVerticalAlign": "auto",
|
||||
"triggerEvent": false
|
||||
}
|
||||
]
|
||||
};
|
||||
chart_ee0cf3b94bdd4a299381e315bfd81d59.setOption(option_ee0cf3b94bdd4a299381e315bfd81d59);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,204 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Awesome-pyecharts</title>
|
||||
<script type="text/javascript" src="https://assets.pyecharts.org/assets/v5/echarts.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body >
|
||||
<div id="b0161535fc9f4ed48ffb98bf37d62b29" class="chart-container" style="width:900px; height:500px; "></div>
|
||||
<script>
|
||||
var chart_b0161535fc9f4ed48ffb98bf37d62b29 = echarts.init(
|
||||
document.getElementById('b0161535fc9f4ed48ffb98bf37d62b29'), 'white', {renderer: 'canvas'});
|
||||
var option_b0161535fc9f4ed48ffb98bf37d62b29 = {
|
||||
"animation": true,
|
||||
"animationThreshold": 2000,
|
||||
"animationDuration": 1000,
|
||||
"animationEasing": "cubicOut",
|
||||
"animationDelay": 0,
|
||||
"animationDurationUpdate": 300,
|
||||
"animationEasingUpdate": "cubicOut",
|
||||
"animationDelayUpdate": 0,
|
||||
"aria": {
|
||||
"enabled": false
|
||||
},
|
||||
"color": [
|
||||
"#5470c6",
|
||||
"#91cc75",
|
||||
"#fac858",
|
||||
"#ee6666",
|
||||
"#73c0de",
|
||||
"#3ba272",
|
||||
"#fc8452",
|
||||
"#9a60b4",
|
||||
"#ea7ccc"
|
||||
],
|
||||
"series": [
|
||||
{
|
||||
"type": "pie",
|
||||
"colorBy": "data",
|
||||
"legendHoverLink": true,
|
||||
"selectedMode": false,
|
||||
"selectedOffset": 10,
|
||||
"clockwise": true,
|
||||
"startAngle": 90,
|
||||
"minAngle": 0,
|
||||
"minShowLabelAngle": 0,
|
||||
"avoidLabelOverlap": true,
|
||||
"stillShowZeroSum": true,
|
||||
"percentPrecision": 2,
|
||||
"showEmptyCircle": true,
|
||||
"emptyCircleStyle": {
|
||||
"color": "lightgray",
|
||||
"borderColor": "#000",
|
||||
"borderWidth": 0,
|
||||
"borderType": "solid",
|
||||
"borderDashOffset": 0,
|
||||
"borderCap": "butt",
|
||||
"borderJoin": "bevel",
|
||||
"borderMiterLimit": 10,
|
||||
"opacity": 1
|
||||
},
|
||||
"data": [
|
||||
{
|
||||
"name": "\u5267\u60c5",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"name": "\u5267\u60c5 ",
|
||||
"value": 10
|
||||
},
|
||||
{
|
||||
"name": "\u52a8\u4f5c ",
|
||||
"value": 5
|
||||
},
|
||||
{
|
||||
"name": "\u52a8\u753b ",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"name": "\u559c\u5267 ",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
"name": "\u60ac\u7591",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"name": "\u7231\u60c5 ",
|
||||
"value": 3
|
||||
},
|
||||
{
|
||||
"name": "\u72af\u7f6a ",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
"name": "\u7eaa\u5f55\u7247",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"name": "\u7eaa\u5f55\u7247 ",
|
||||
"value": 1
|
||||
}
|
||||
],
|
||||
"radius": [
|
||||
"40%",
|
||||
"75%"
|
||||
],
|
||||
"center": [
|
||||
"50%",
|
||||
"50%"
|
||||
],
|
||||
"label": {
|
||||
"show": true,
|
||||
"margin": 8
|
||||
},
|
||||
"labelLine": {
|
||||
"show": true,
|
||||
"showAbove": false,
|
||||
"length": 15,
|
||||
"length2": 15,
|
||||
"smooth": false,
|
||||
"minTurnAngle": 90,
|
||||
"maxSurfaceAngle": 90
|
||||
}
|
||||
}
|
||||
],
|
||||
"legend": [
|
||||
{
|
||||
"data": [
|
||||
"\u5267\u60c5",
|
||||
"\u5267\u60c5 ",
|
||||
"\u52a8\u4f5c ",
|
||||
"\u52a8\u753b ",
|
||||
"\u559c\u5267 ",
|
||||
"\u60ac\u7591",
|
||||
"\u7231\u60c5 ",
|
||||
"\u72af\u7f6a ",
|
||||
"\u7eaa\u5f55\u7247",
|
||||
"\u7eaa\u5f55\u7247 "
|
||||
],
|
||||
"selected": {},
|
||||
"show": true,
|
||||
"padding": 5,
|
||||
"itemGap": 10,
|
||||
"itemWidth": 25,
|
||||
"itemHeight": 14,
|
||||
"backgroundColor": "transparent",
|
||||
"borderColor": "#ccc",
|
||||
"borderRadius": 0,
|
||||
"pageButtonItemGap": 5,
|
||||
"pageButtonPosition": "end",
|
||||
"pageFormatter": "{current}/{total}",
|
||||
"pageIconColor": "#2f4554",
|
||||
"pageIconInactiveColor": "#aaa",
|
||||
"pageIconSize": 15,
|
||||
"animationDurationUpdate": 800,
|
||||
"selector": false,
|
||||
"selectorPosition": "auto",
|
||||
"selectorItemGap": 7,
|
||||
"selectorButtonGap": 10
|
||||
}
|
||||
],
|
||||
"tooltip": {
|
||||
"show": true,
|
||||
"trigger": "item",
|
||||
"triggerOn": "mousemove|click",
|
||||
"axisPointer": {
|
||||
"type": "line"
|
||||
},
|
||||
"showContent": true,
|
||||
"alwaysShowContent": false,
|
||||
"showDelay": 0,
|
||||
"hideDelay": 100,
|
||||
"enterable": false,
|
||||
"confine": false,
|
||||
"appendToBody": false,
|
||||
"transitionDuration": 0.4,
|
||||
"textStyle": {
|
||||
"fontSize": 14
|
||||
},
|
||||
"borderWidth": 0,
|
||||
"padding": 5,
|
||||
"order": "seriesAsc"
|
||||
},
|
||||
"title": [
|
||||
{
|
||||
"show": true,
|
||||
"text": "\u5404\u7c7b\u578b\u7535\u5f71\u5360\u6bd4",
|
||||
"target": "blank",
|
||||
"subtarget": "blank",
|
||||
"top": 20,
|
||||
"padding": 5,
|
||||
"itemGap": 10,
|
||||
"textAlign": "auto",
|
||||
"textVerticalAlign": "auto",
|
||||
"triggerEvent": false
|
||||
}
|
||||
]
|
||||
};
|
||||
chart_b0161535fc9f4ed48ffb98bf37d62b29.setOption(option_b0161535fc9f4ed48ffb98bf37d62b29);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,38 @@
|
||||
import jieba
|
||||
from pyecharts.charts import WordCloud
|
||||
from pyecharts import options as opts
|
||||
ciyun={}
|
||||
fp=open('./dataCleanFile/评论.txt','r',encoding='utf-8')
|
||||
strt=fp.read().replace("\n",'').strip()
|
||||
fp.close()
|
||||
# 使用停用词表对数据进行过滤
|
||||
f=open('./visualizationFile/停用词表.txt','r',encoding='utf-8')
|
||||
stop_str=f.read().split("\n")
|
||||
f.close()
|
||||
sl=jieba.cut(strt,cut_all=False,HMM=True)
|
||||
for i in sl:
|
||||
if ciyun.get(i,0)==0:
|
||||
ciyun[i]=1
|
||||
else:
|
||||
ciyun[i]+=1
|
||||
data=[]
|
||||
# 统计词出现次数
|
||||
for i in ciyun:
|
||||
if i in stop_str:
|
||||
continue
|
||||
else:
|
||||
data.append((i,ciyun[i]))
|
||||
print(data)
|
||||
# 创建词云图对象
|
||||
wordcloud = WordCloud()
|
||||
|
||||
# 添加数据
|
||||
wordcloud.add("", data, word_size_range=[20, 100])
|
||||
|
||||
# 设置全局选项
|
||||
wordcloud.set_global_opts(
|
||||
title_opts=opts.TitleOpts(title="评论词云图",pos_left="center"),
|
||||
)
|
||||
|
||||
# 渲染图表到文件
|
||||
wordcloud.render("./visualizationFile/wordcloud.html")
|
Loading…
Reference in new issue