mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-23 11:42:20 +08:00
38 lines
1.5 KiB
HTML
38 lines
1.5 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="zh-CN">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>微信年度聊天报告</title>
|
||
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@latest/dist/echarts.min.js"></script>
|
||
|
<script type="text/javascript" src="https://assets.pyecharts.org/assets/v5/echarts-wordcloud.min.js"></script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<h1>{{my_nickname}}——{{ta_nickname}}</h1>
|
||
|
<div id="echarts-container" style="width: 600px; height: 400px;"></div>
|
||
|
<div id="echarts-wordcloud" style="width: 800px; height: 800px;"></div>
|
||
|
<script>
|
||
|
// 使用 AJAX 请求获取 Pyecharts 生成的图表配置项数据
|
||
|
fetch('/get_chart_options')
|
||
|
.then(response => response.json())
|
||
|
.then(chartOptions => {
|
||
|
// 在这里使用 ECharts 渲染图表
|
||
|
var myChart = echarts.init(document.getElementById('echarts-container'));
|
||
|
var option = chartOptions.chart_data;
|
||
|
myChart.setOption(JSON.parse(option));
|
||
|
});
|
||
|
</script>
|
||
|
<script>
|
||
|
// 使用 AJAX 请求获取 Pyecharts 生成的图表配置项数据
|
||
|
fetch('/wordcloud')
|
||
|
.then(response => response.json())
|
||
|
.then(chartOptions => {
|
||
|
// 在这里使用 ECharts 渲染图表
|
||
|
var myChart = echarts.init(document.getElementById('echarts-wordcloud'));
|
||
|
var option = chartOptions.chart_data;
|
||
|
myChart.setOption(JSON.parse(option));
|
||
|
});
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|