Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
雪碧有白泡泡
可视化 csdn 数据
提交
b25b7d37
可
可视化 csdn 数据
项目概览
雪碧有白泡泡
/
可视化 csdn 数据
与 Fork 源项目一致
Fork自
yma16 / 可视化 csdn 数据
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
可
可视化 csdn 数据
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b25b7d37
编写于
1月 07, 2024
作者:
Q
qq_38870145
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sun Jan 7 23:24:00 CST 2024 inscode
上级
f95ebe76
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
100 addition
and
16 deletion
+100
-16
src/components/visualHtml/html/data.js
src/components/visualHtml/html/data.js
+0
-0
src/components/visualHtml/html/index.vue
src/components/visualHtml/html/index.vue
+98
-0
src/components/visualHtml/index.vue
src/components/visualHtml/index.vue
+2
-16
未找到文件。
src/components/visualHtml/html/data.js
0 → 100644
浏览文件 @
b25b7d37
src/components/visualHtml/html/index.vue
0 → 100644
浏览文件 @
b25b7d37
<
template
>
<div
id=
"treeChartId"
style=
"width:100%;height:300px;margin: 0 auto"
></div>
</
template
>
<
script
setup
>
import
*
as
echarts
from
'
echarts
'
;
import
{
defineProps
,
reactive
,
watch
,
nextTick
,
onUnmounted
,
onMounted
}
from
'
vue
'
;
import
{
treeData
}
from
'
./data.js
'
const
state
=
reactive
({
exportLoading
:
false
,
echartInstance
:
undefined
,
hubData
:[],
})
function
renderEchartLine
()
{
// 基于准备好的dom,初始化echarts实例
const
domInstance
=
document
.
getElementById
(
'
treeChartId
'
)
if
(
domInstance
){
domInstance
.
removeAttribute
(
'
_echarts_instance_
'
)
}
else
{
return
}
const
myChart
=
echarts
.
init
(
domInstance
);
const
seriesItem
=
{
name
:
'
Access From
'
,
type
:
'
pie
'
,
// radius: [20, 50],
center
:
[
'
50%
'
,
'
50%
'
],
// roseType: 'area',
// itemStyle: {
// borderRadius: 1
// },
data
:
state
.
hubData
,
label
:{
color
:
'
#ffffff
'
},
emphasis
:
{
itemStyle
:
{
shadowBlur
:
10
,
shadowOffsetX
:
0
,
shadowColor
:
'
rgba(0, 0, 0, 0.5)
'
}
}
}
const
seriesData
=
[
seriesItem
]
const
option
=
{
title
:
{
text
:
'
社区文章数量占比
'
,
textStyle
:{
color
:
'
#ffffff
'
}
},
toolbox
:
{
show
:
true
,
feature
:
{
saveAsImage
:
{}
}
},
tooltip
:
{
trigger
:
'
axis
'
,
},
xAxis
:
{
axisLabel
:{
color
:
'
#ffffff
'
}
},
yAxis
:
{
axisLabel
:{
color
:
'
#ffffff
'
}
},
grid
:
{
x
:
60
,
x2
:
100
},
series
:
seriesData
};
// 使用刚指定的配置项和数据显示图表。
myChart
.
setOption
(
option
,
true
);
// 监听
state
.
echartInstance
=
myChart
;
window
.
onresize
=
myChart
.
resize
;
}
onUnmounted
(()
=>
{
window
.
onresize
=
null
})
const
getHubConfig
=
()
=>
{
state
.
hubData
=
[...
treeData
]
renderEchartLine
()
}
onMounted
(()
=>
{
getHubConfig
()
})
</
script
>
\ No newline at end of file
src/components/visualHtml/index.vue
浏览文件 @
b25b7d37
<
script
setup
>
<
script
setup
>
import
{
reactive
,
onMounted
}
from
'
vue
'
import
{
reactive
,
onMounted
}
from
'
vue
'
import
CommitLine
from
'
./commit/index.vue
'
import
VisualHtml
from
'
./html/index.vue
'
import
ArticleBar
from
'
./article/index.vue
'
import
Author
from
'
../Author.vue
'
import
Author
from
'
../Author.vue
'
import
HubPie
from
'
./hub/index.vue
'
import
{
articleData
}
from
'
./data/data.js
'
const
state
=
reactive
({
const
state
=
reactive
({
title
:
''
,
title
:
''
,
articleData
:[]
})
const
getRenderBarData
=
()
=>
{
state
.
articleData
=
[...
articleData
]
state
.
articleData
.
sort
((
a
,
b
)
=>
new
Date
(
a
.
postTime
)
-
new
Date
(
b
.
postTime
))
}
onMounted
(()
=>
{
getRenderBarData
()
})
})
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -24,9 +12,7 @@
...
@@ -24,9 +12,7 @@
<div>
<div>
{{
state
.
title
}}
{{
state
.
title
}}
<div>
<div>
<CommitLine
/>
<VisualHtml
/>
<ArticleBar
:tableData=
"state.articleData"
/>
<HubPie
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录