Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
可视化 csdn 数据
提交
0279615c
可
可视化 csdn 数据
项目概览
yma16
/
可视化 csdn 数据
该项目与 Fork 源项目分叉
Fork自
inscode / VueJS
通知
17
Star
15
Fork
10
代码
文件
提交
分支
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看板
提交
0279615c
编写于
1月 02, 2024
作者:
Q
qq_38870145
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tue Jan 2 04:35:00 CST 2024 inscode
上级
8b96eb61
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
2213 addition
and
5 deletion
+2213
-5
public/article/2023.json
public/article/2023.json
+962
-0
src/assets/main.css
src/assets/main.css
+2
-2
src/components/visual/article/index.vue
src/components/visual/article/index.vue
+169
-0
src/components/visual/data/data.js
src/components/visual/data/data.js
+962
-0
src/components/visual/hub/data.js
src/components/visual/hub/data.js
+8
-0
src/components/visual/hub/index.vue
src/components/visual/hub/index.vue
+93
-0
src/components/visual/index.vue
src/components/visual/index.vue
+17
-3
未找到文件。
public/article/2023.json
0 → 100644
浏览文件 @
0279615c
此差异已折叠。
点击以展开。
src/assets/main.css
浏览文件 @
0279615c
...
@@ -9,8 +9,8 @@ body {
...
@@ -9,8 +9,8 @@ body {
background-image
:
linear-gradient
(
to
bottom
,
background-image
:
linear-gradient
(
to
bottom
,
rgba
(
0
,
0
,
0
,
0.6
),
rgba
(
0
,
0
,
0
,
0.6
),
rgba
(
0
,
0
,
0
,
0.8
)),
url("./img/previewFix.jpg")
;
rgba
(
0
,
0
,
0
,
0.8
)),
url("./img/previewFix.jpg")
;
background-size
:
cover
;
background-size
:
100%
100%
;
background-repeat
:
no-repeat
;
/* background-repeat: no-repeat; */
color
:
#fff
;
color
:
#fff
;
}
}
.ant-radio-wrapper
{
.ant-radio-wrapper
{
...
...
src/components/visual/article/index.vue
0 → 100644
浏览文件 @
0279615c
<
template
>
<div
id=
"barChartId"
style=
"width:100vw;height:300px;margin: 0 auto"
></div>
</
template
>
<
script
setup
>
import
*
as
echarts
from
'
echarts
'
;
import
{
defineProps
,
reactive
,
watch
,
nextTick
,
onUnmounted
}
from
'
vue
'
;
const
props
=
defineProps
({
tableData
:
[]
})
const
state
=
reactive
({
exportLoading
:
false
,
dataSource
:
[],
echartInstance
:
undefined
})
watch
(()
=>
props
.
tableData
,
(
val
)
=>
{
state
.
dataSource
=
val
nextTick
(()
=>
{
renderEchartBar
()
})
},
{
deep
:
true
,
immediate
:
true
})
function
renderEchartBar
()
{
// 基于准备好的dom,初始化echarts实例
const
domInstance
=
document
.
getElementById
(
'
barChartId
'
)
if
(
domInstance
){
domInstance
.
removeAttribute
(
'
_echarts_instance_
'
)
}
else
{
return
}
const
myChart
=
echarts
.
init
(
domInstance
);
const
option
=
{
title
:
{
text
:
'
csdn 质量分柱状图 点击跳转到对应的文章
'
,
textStyle
:{
color
:
'
#ffffff
'
}
},
toolbox
:
{
show
:
true
,
feature
:
{
saveAsImage
:
{}
}
},
dataZoom
:
[
{
id
:
'
dataZoomX
'
,
type
:
'
slider
'
,
xAxisIndex
:
[
0
],
filterMode
:
'
filter
'
}
],
tooltip
:
{
trigger
:
'
axis
'
,
axisPointer
:
{
type
:
'
shadow
'
}
},
legend
:
{
},
xAxis
:
{
type
:
'
category
'
,
data
:
state
.
dataSource
.
map
(
item
=>
item
.
postTime
),
axisLabel
:{
color
:
'
#ffffff
'
}
},
yAxis
:
{
type
:
'
value
'
,
axisLabel
:{
color
:
'
#ffffff
'
}
},
grid
:
{
x
:
60
,
x2
:
100
},
tooltip
:
{
formatter
:
function
(
params
)
{
let
findItem
=
state
.
dataSource
.
find
(
item
=>
{
return
item
.
postTime
==
params
.
name
})
if
(
!
findItem
)
{
return
''
}
return
`<span style='color:blue'>-<span> 博客标题:
${
findItem
.
title
}
<br>
<span style='color:green'>-<span> 博客质量:
${
params
.
value
}
<br>
<span style='color:red'>-<span> 博客建议:
${
findItem
.
message
}
<br>
<span style='color:blue'>-<span> 博客地址:
${
findItem
.
url
}
<br>
<span style='color:blue'>-<span> 发文时间:
${
params
.
name
}
<br>
`
},
},
series
:
[
{
data
:
state
.
dataSource
.
map
(
item
=>
item
.
score
),
type
:
'
bar
'
,
showBackground
:
true
,
backgroundStyle
:
{
color
:
'
rgba(180, 180, 180, 0.2)
'
},
label
:
{
//柱体上显示数值
show
:
true
,
//开启显示
position
:
'
center
'
,
//在上方显示
textStyle
:
{
//数值样式
fontSize
:
'
2px
'
,
color
:
'
blue
'
}
},
markPoint
:
{
data
:
[
{
type
:
'
max
'
,
name
:
'
最高分
'
},
{
type
:
'
min
'
,
name
:
'
最低分
'
}
]
},
markLine
:
{
itemStyle
:
{
normal
:
{
lineStyle
:
{
type
:
'
dotted
'
,
},
label
:
{
show
:
true
,
position
:
'
middle
'
,
color
:
'
red
'
,
lineHeight
:
35
,
backgroundColor
:
'
rgba(255,255,255.7)
'
,
formatter
:
(
params
)
=>
{
return
params
.
name
+
"
:
"
+
params
.
value
}
}
}
},
data
:
[
{
type
:
'
average
'
,
name
:
'
平均分
'
}]
}
}
]
};
// 使用刚指定的配置项和数据显示图表。
myChart
.
setOption
(
option
,
true
);
// 监听
state
.
echartInstance
=
myChart
;
myChart
.
on
(
'
click
'
,
function
(
params
)
{
const
findItem
=
state
.
dataSource
.
find
(
item
=>
{
return
item
.
postTime
==
params
.
name
})
if
(
params
.
name
)
{
window
.
open
(
findItem
.
url
,
'
_blank
'
)
}
});
window
.
onresize
=
myChart
.
resize
;
}
onUnmounted
(()
=>
{
window
.
onresize
=
null
})
</
script
>
\ No newline at end of file
src/components/visual/data/data.js
0 → 100644
浏览文件 @
0279615c
此差异已折叠。
点击以展开。
src/components/visual/hub/data.js
0 → 100644
浏览文件 @
0279615c
export
const
pieData
=
[
{
value
:
270
,
name
:
'
csdn博客
'
},
{
value
:
131
,
name
:
'
掘金博客
'
},
{
value
:
60
,
name
:
'
阿里云开发者社区
'
},
{
value
:
30
,
name
:
'
华为云开发者社区
'
},
{
value
:
10
,
name
:
'
腾讯云开发者社区
'
},
{
value
:
10
,
name
:
'
51cto博客
'
},
]
\ No newline at end of file
src/components/visual/hub/index.vue
0 → 100644
浏览文件 @
0279615c
<
template
>
<div
id=
"pieChartId"
style=
"width:800px;height:300px;margin: 0 auto"
></div>
</
template
>
<
script
setup
>
import
*
as
echarts
from
'
echarts
'
;
import
{
defineProps
,
reactive
,
watch
,
nextTick
,
onUnmounted
,
onMounted
}
from
'
vue
'
;
import
{
pieData
}
from
'
./data.js
'
const
state
=
reactive
({
exportLoading
:
false
,
echartInstance
:
undefined
,
hubData
:[],
})
function
renderEchartLine
()
{
// 基于准备好的dom,初始化echarts实例
const
domInstance
=
document
.
getElementById
(
'
pieChartId
'
)
if
(
domInstance
){
domInstance
.
removeAttribute
(
'
_echarts_instance_
'
)
}
else
{
return
}
const
myChart
=
echarts
.
init
(
domInstance
);
const
seriesItem
=
{
name
:
'
Access From
'
,
type
:
'
pie
'
,
radius
:
'
50%
'
,
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
=
[...
pieData
]
renderEchartLine
()
}
onMounted
(()
=>
{
getHubConfig
()
})
</
script
>
\ No newline at end of file
src/components/visual/index.vue
浏览文件 @
0279615c
<
script
setup
>
<
script
setup
>
import
{
reactive
}
from
'
vue
'
import
{
reactive
,
onMounted
}
from
'
vue
'
import
CommitLine
from
'
./commit/index.vue
'
import
CommitLine
from
'
./commit/index.vue
'
import
ArticleBar
from
'
./article/index.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
>
<div>
<div
style=
"padding:20px;"
>
<div>
<div>
{{
state
.
title
}}
{{
state
.
title
}}
<div>
<div>
<CommitLine
/>
<CommitLine
/>
<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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录