forked from speced/respec
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
77 lines (68 loc) · 2.34 KB
/
main.js
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
$(document).ready(function() {
//sample chart 1
d3.json('data/fake_users1.json', function(data) {
var fake_baselines = [{value:160000000, label:'a baseline'}]
// chart_title({
// });
moz_chart({
title:"Fake Users",
description: "This is a simple line chart. You can remove the area portion by adding area: false to the arguments list.",
data: data,
width: 600,
height: 250,
right: 20,
baselines: fake_baselines,
target: '#fake_users1',
x_accessor: 'date',
y_accessor: 'value'
})
})
//sample chart 2
d3.json('data/fake_users2.json', function(data) {
// chart_title({
// target:"#fake_users2",
// title:"More Fake Users",
// description: "This line chart contains multiple lines. We're still working out the style details."
// });
moz_chart({
title:"More Fake Users",
description: "This line chart contains multiple lines. We're still working out the style details.",
data: data,
width: 600,
height: 250,
right: 20,
target: '#fake_users2',
x_accessor: 'date',
y_accessor: 'value'
})
})
//sample chart 3
d3.json('data/some_percentage.json', function(data) {
var markers = [{
'date': new Date('2014-02-01'),
'label': '1st Milestone'
}, {
'date': new Date('2014-03-15'),
'label': '2nd Milestone'
}, ]
// chart_title({
// target:"#percentage",
// title:"Some Percentages",
// description: "Here is an example with the area turned off, and using the percentage format instead."
// });
moz_chart({
title:"Some Percentages",
description: "Here is an example with the area turned off, and using the percentage format instead.",
data: data,
width: 600,
height: 250,
right: 20,
area: false,
markers: markers,
format: 'percentage',
target: 'div#percentage',
x_accessor: 'date',
y_accessor: 'value'
})
})
})