File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ <script >
2
+ import Component from ' class-component'
3
+ import { Scatter } from ' vue-chartjs'
4
+
5
+ @Component
6
+ export default class ScatterDemo extends Scatter {
7
+ chartData = {
8
+ datasets: [{
9
+ label: ' Alibaba' ,
10
+ fill: false ,
11
+ borderColor: ' #f87979' ,
12
+ backgroundColor: ' #f87979' ,
13
+ data: [{
14
+ x: - 2 ,
15
+ y: - 4
16
+ }, {
17
+ x: - 1 ,
18
+ y: - 1
19
+ }, {
20
+ x: 0 ,
21
+ y: 0
22
+ }, {
23
+ x: 1 ,
24
+ y: 3
25
+ }, {
26
+ x: 2 ,
27
+ y: 4
28
+ }]
29
+ },
30
+ {
31
+ label: ' Google' ,
32
+ fill: false ,
33
+ borderColor: ' #7acbf9' ,
34
+ backgroundColor: ' #7acbf9' ,
35
+ data: [{
36
+ x: - 2 ,
37
+ y: - 4
38
+ }, {
39
+ x: - 1 ,
40
+ y: - 3
41
+ }, {
42
+ x: 0 ,
43
+ y: 1
44
+ }, {
45
+ x: 1 ,
46
+ y: 1
47
+ }, {
48
+ x: 2 ,
49
+ y: 6
50
+ }]
51
+ }]
52
+ }
53
+ mounted () {
54
+ this .renderChart (this .chartData )
55
+ }
56
+ }
57
+ </script >
Original file line number Diff line number Diff line change 56
56
</el-row >
57
57
</el-card >
58
58
</el-col >
59
+ <el-col :span =" 10" >
60
+ <el-card >
61
+ <div slot =" header" class =" clearfix" >
62
+ <span >Scatter Chart</span >
63
+ </div >
64
+ <el-row >
65
+ <scatter-demo :width =" 3" :height =" 2" ></scatter-demo >
66
+ </el-row >
67
+ </el-card >
59
68
</el-col >
60
69
</el-row >
61
70
</div >
@@ -68,6 +77,7 @@ import Component from 'class-component'
68
77
import BarDemo from ' ~components/charts/BarDemo'
69
78
import PieDemo from ' ~components/charts/PieDemo'
70
79
import LineDemo from ' ~components/charts/LineDemo'
80
+ import ScatterDemo from ' ~components/charts/ScatterDemo'
71
81
import DoughnutDemo from ' ~components/charts/DoughnutDemo'
72
82
import ReactiveDemo from ' ~components/charts/ReactiveDemo'
73
83
@@ -76,6 +86,7 @@ import ReactiveDemo from '~components/charts/ReactiveDemo'
76
86
BarDemo,
77
87
PieDemo,
78
88
LineDemo,
89
+ ScatterDemo,
79
90
DoughnutDemo,
80
91
ReactiveDemo
81
92
}
You can’t perform that action at this time.
0 commit comments