Skip to content

Commit fea69ba

Browse files
authored
Add files via upload
1 parent fde566f commit fea69ba

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

Schart2.vue

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<template>
2+
<div class="hello">
3+
<schart :canvasId="canvasId" :type="type" :width="width"
4+
:height="height" :data="data" :options="options"></schart>
5+
</div>
6+
</template>
7+
8+
<script>
9+
import Schart from 'vue-schart';
10+
export default {
11+
data() {
12+
return {
13+
canvasId: 'myCanvas',
14+
type: 'line',
15+
width: 400,
16+
height: 400,
17+
data: [
18+
{name: '2014', value: 1342},
19+
{name: '2015', value: 2123},
20+
{name: '2016', value: 1654},
21+
{name: '2017', value: 1795},
22+
],
23+
options: {
24+
padding: 37, // canvas 内边距
25+
bgColor: '#fff', // 默认背景颜色
26+
title: 'Hello vue-schart',// 图表标题
27+
titleColor: '#000000', // 图表标题颜色
28+
titlePosition: 'top' , // 图表标题位置: top / bottom
29+
yEqual: 5, // y轴分成5等分
30+
fillColor: '#1E9FFF', // 默认填充颜色
31+
contentColor: '#eeeeee', // 内容横线颜色
32+
axisColor: '#666666', // 坐标轴颜色
33+
34+
}
35+
}
36+
},
37+
components:{
38+
Schart
39+
}
40+
}
41+
</script>
42+
43+
<!-- Add "scoped" attribute to limit CSS to this component only -->
44+
<style>
45+
</style>

0 commit comments

Comments
 (0)