Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yubinCloud
fairy-wiki
提交
a2d7c247
F
fairy-wiki
项目概览
yubinCloud
/
fairy-wiki
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fairy-wiki
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a2d7c247
编写于
4月 30, 2021
作者:
yubinCloud
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
11-8 集成 ECharts,并增加一个使用示例
上级
f9325aa3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
1 deletion
+57
-1
src/main/java/io/github/yubincloud/fairywiki/service/EbookSnapshotService.java
...ub/yubincloud/fairywiki/service/EbookSnapshotService.java
+0
-1
web/package.json
web/package.json
+1
-0
web/src/components/the-welcome.vue
web/src/components/the-welcome.vue
+56
-0
未找到文件。
src/main/java/io/github/yubincloud/fairywiki/service/EbookSnapshotService.java
浏览文件 @
a2d7c247
...
...
@@ -5,7 +5,6 @@ import io.github.yubincloud.fairywiki.mapper.EbookSnapshotMapperCustom;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
...
...
web/package.json
浏览文件 @
a2d7c247
...
...
@@ -13,6 +13,7 @@
"@ant-design/icons-vue"
:
"^6.0.1"
,
"ant-design-vue"
:
"^2.0.0-rc.3"
,
"axios"
:
"^0.21.0"
,
"echarts"
:
"^5.1.1"
,
"vue"
:
"^3.0.0"
,
"vue-router"
:
"^4.0.0-0"
,
"vuex"
:
"^4.0.0-0"
,
...
...
web/src/components/the-welcome.vue
浏览文件 @
a2d7c247
...
...
@@ -87,12 +87,48 @@
</a-card>
</a-col>
</a-row>
<br>
<a-row>
<a-col
:span=
"24"
>
<div
id=
"chart"
style=
"width: 100%;height:300px;"
></div>
</a-col>
</a-row>
</div>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
onMounted
}
from
'
vue
'
import
axios
from
'
axios
'
;
import
*
as
echarts
from
'
echarts/core
'
;
import
{
BarChart
,
// 系列类型的定义后缀都为 SeriesOption
BarSeriesOption
,
LineChart
,
LineSeriesOption
}
from
'
echarts/charts
'
;
import
{
TitleComponent
,
// 组件类型的定义后缀都为 ComponentOption
TitleComponentOption
,
GridComponent
,
GridComponentOption
,
TooltipComponent
}
from
'
echarts/components
'
;
import
{
CanvasRenderer
}
from
'
echarts/renderers
'
;
// 通过 ComposeOption 来组合出一个只有必须组件和图表的 Option 类型
type
ECOption
=
echarts
.
ComposeOption
<
BarSeriesOption
|
LineSeriesOption
|
TitleComponentOption
|
GridComponentOption
>
;
// 注册必须的组件
echarts
.
use
(
[
TitleComponent
,
TooltipComponent
,
GridComponent
,
BarChart
,
CanvasRenderer
]
);
export
default
defineComponent
({
name
:
'
the-welcome
'
,
...
...
@@ -122,8 +158,28 @@ export default defineComponent({
});
};
const
testEcharts
=
()
=>
{
const
chart
=
echarts
.
init
(
document
.
getElementById
(
'
chart
'
)
as
HTMLCanvasElement
);
chart
.
setOption
({
title
:
{
text
:
'
ECharts 入门示例
'
},
tooltip
:
{},
xAxis
:
{
data
:
[
'
衬衫
'
,
'
羊毛衫
'
,
'
雪纺衫
'
,
'
裤子
'
,
'
高跟鞋
'
,
'
袜子
'
]
},
yAxis
:
{},
series
:
[{
name
:
'
销量
'
,
type
:
'
bar
'
,
data
:
[
5
,
20
,
36
,
10
,
10
,
20
]
}]
});
}
onMounted
(()
=>
{
getStatistic
();
testEcharts
();
});
return
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录