Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-learning-report
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-learning-report
提交
e0cb42ec
提交
e0cb42ec
编写于
11月 14, 2019
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新组件
上级
10c1c0ac
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
178 行增加
和
0 行删除
+178
-0
chart-column-vertical.vue
components/bussiness/charts/chart-column-vertical.vue
+178
-0
未找到文件。
components/bussiness/charts/chart-column-vertical.vue
0 → 100644
浏览文件 @
e0cb42ec
<!-- 饼图 -->
<
template
>
<section
class=
"chart-pie"
>
<div
:id=
"id"
:style=
"
{width: '100%', height: '320px'}">
</div>
</section>
</
template
>
<
script
>
import
{
format
}
from
"path"
;
let
vm
=
null
;
export
default
{
props
:
{
id
:
{
type
:
String
,
default
:
"chartlineId"
},
colors
:
{
type
:
Array
,
default
:
()
=>
[
"#FFB01B"
,
"#39AF9A"
,
"#5D7092"
,
"#FF9A4B"
,
"#abb7bb"
,
"#76d2d2"
]
},
},
data
()
{
return
{};
},
mounted
()
{
vm
=
this
;
this
.
drawColumn
();
},
methods
:
{
// 画
drawColumn
()
{
// 基于准备好的dom,初始化echarts实例
let
chartColumn
=
this
.
$echarts
.
init
(
document
.
getElementById
(
this
.
id
));
// 绘制图表
let
options
=
{
color
:
vm
.
colors
,
tooltip
:
{
trigger
:
"axis"
,
axisPointer
:
{
// 坐标轴指示器,坐标轴触发有效
type
:
"shadow"
// 默认为直线,可选为:'line' | 'shadow'
}
},
legend
:
{
top
:
20
,
data
:
[
"获优秀人数"
,
"获及格人数"
,
"未获证人数"
],
textStyle
:
{
fontSize
:
12
,
// fontWeight: "bolder",
color
:
"#676869"
}
},
grid
:
{
left
:
"3%"
,
right
:
"6%"
,
bottom
:
"6%"
,
containLabel
:
true
},
lineStyle
:
{
color
:
"#676869"
},
yAxis
:
{
axisTick
:
false
,
type
:
"value"
,
axisLabel
:
{
formatter
:
"{value}"
,
textStyle
:
{
color
:
"#676869"
}
},
axisLine
:
{
lineStyle
:
{
color
:
"#efefef"
,
width
:
1
}
}
},
xAxis
:
{
axisTick
:
false
,
type
:
"category"
,
data
:
[
"其他"
,
"中专以下"
,
"大专"
,
"本科"
,
"硕士"
,
"博士"
],
textStyle
:
{
fontSize
:
12
,
color
:
"#676869"
},
axisLabel
:
{
formatter
:
"{value}"
,
textStyle
:
{
color
:
"#676869"
}
},
axisLine
:
{
lineStyle
:
{
color
:
"#efefef"
,
width
:
1
}
}
},
series
:
[
{
name
:
"获优秀人数"
,
data
:
[
120
,
200
,
150
,
80
,
70
,
110
,
130
],
type
:
"bar"
,
barWidth
:
20
//柱图宽度
},
{
name
:
"获及格人数"
,
data
:
[
120
,
200
,
150
,
80
,
70
,
110
,
130
],
type
:
"bar"
,
barWidth
:
20
//柱图宽度
}
]
// series: [
// {
// name: "获优秀人数",
// type: "bar",
// stack: "总量",
// barWidth: 16, //柱图宽度
// label: {
// normal: {
// show: false,
// position: "insideRight"
// }
// },
// data: [320, 302, 301, 334, 390, 330, 320]
// },
// {
// name: "获及格人数",
// type: "bar",
// stack: "总量",
// barWidth: 16, //柱图宽度
// label: {
// normal: {
// show: false,
// position: "insideRight"
// }
// },
// data: [120, 132, 101, 134, 90, 230, 210]
// },
// {
// name: "未获证人数",
// type: "bar",
// stack: "总量",
// barWidth: 16, //柱图宽度
// label: {
// normal: {
// show: false,
// position: "insideRight"
// }
// },
// data: [220, 182, 191, 234, 290, 330, 310]
// }
// ]
};
chartColumn
.
setOption
(
options
);
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.chart-pie
{
position
:
relative
;
top
:
-6px
;
// height: 280px;
margin
:
15px
;
background
:
rgba
(
255
,
255
,
255
,
1
);
box-shadow
:
0px
10px
30px
0px
rgba
(
0
,
0
,
0
,
0
.04
);
border-radius
:
6px
;
border
:
1px
solid
rgba
(
231
,
232
,
233
,
1
);
}
</
style
>
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录