morris-demo.js
3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
$(function() {
Morris.Line({
element: 'morris-one-line-chart',
data: [
{ year: '2008', value: 5 },
{ year: '2009', value: 10 },
{ year: '2010', value: 8 },
{ year: '2011', value: 22 },
{ year: '2012', value: 8 },
{ year: '2014', value: 10 },
{ year: '2015', value: 5 }
],
xkey: 'year',
ykeys: ['value'],
resize: true,
lineWidth:4,
labels: ['Value'],
lineColors: ['#1ab394'],
pointSize:5,
});
Morris.Area({
element: 'morris-area-chart',
data: [{
period: '2010 Q1',
iphone: 2666,
ipad: null,
itouch: 2647
}, {
period: '2010 Q2',
iphone: 2778,
ipad: 2294,
itouch: 2441
}, {
period: '2010 Q3',
iphone: 4912,
ipad: 1969,
itouch: 2501
}, {
period: '2010 Q4',
iphone: 3767,
ipad: 3597,
itouch: 5689
}, {
period: '2011 Q1',
iphone: 6810,
ipad: 1914,
itouch: 2293
}, {
period: '2011 Q2',
iphone: 5670,
ipad: 4293,
itouch: 1881
}, {
period: '2011 Q3',
iphone: 4820,
ipad: 3795,
itouch: 1588
}, {
period: '2011 Q4',
iphone: 15073,
ipad: 5967,
itouch: 5175
}, {
period: '2012 Q1',
iphone: 10687,
ipad: 4460,
itouch: 2028
}, {
period: '2012 Q2',
iphone: 8432,
ipad: 5713,
itouch: 1791
}],
xkey: 'period',
ykeys: ['iphone', 'ipad', 'itouch'],
labels: ['iPhone', 'iPad', 'iPod Touch'],
pointSize: 2,
hideHover: 'auto',
resize: true,
lineColors: ['#87d6c6', '#54cdb4','#1ab394'],
lineWidth:2,
pointSize:1,
});
Morris.Donut({
element: 'morris-donut-chart',
data: [{
label: "A系列",
value: 12
}, {
label: "B系列",
value: 30
}, {
label: "C系列",
value: 20
}],
resize: true,
colors: ['#87d6c6', '#54cdb4','#1ab394'],
});
Morris.Bar({
element: 'morris-bar-chart',
data: [{
y: '2006',
a: 60,
b: 50
}, {
y: '2007',
a: 75,
b: 65
}, {
y: '2008',
a: 50,
b: 40
}, {
y: '2009',
a: 75,
b: 65
}, {
y: '2010',
a: 50,
b: 40
}, {
y: '2011',
a: 75,
b: 65
}, {
y: '2012',
a: 100,
b: 90
}],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['A系列', 'B系列'],
hideHover: 'auto',
resize: true,
barColors: ['#1ab394', '#cacaca'],
});
Morris.Line({
element: 'morris-line-chart',
data: [{
y: '2006',
a: 100,
b: 90
}, {
y: '2007',
a: 75,
b: 65
}, {
y: '2008',
a: 50,
b: 40
}, {
y: '2009',
a: 75,
b: 65
}, {
y: '2010',
a: 50,
b: 40
}, {
y: '2011',
a: 75,
b: 65
}, {
y: '2012',
a: 100,
b: 90
}],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['A系列', 'B系列'],
hideHover: 'auto',
resize: true,
lineColors: ['#54cdb4','#1ab394'],
});
});