-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart.js
More file actions
89 lines (79 loc) · 1.66 KB
/
chart.js
File metadata and controls
89 lines (79 loc) · 1.66 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
anychart.onDocumentReady(function () {
var data = getData();
// create venn diagram
chart = anychart.venn(data);
// set chart stroke
chart.stroke('2 #fff');
// set labels settings
chart.labels().format('{%Name}');
// set font color for hover intersections labels
chart.intersections().hovered().fill('black 0.25');
// set intersections labels settings
chart.intersections().labels()
.fontWeight('bold')
.format('{%Name}');
// set legend settings
chart.legend()
.position('right')
.itemsLayout('vertical')
.padding({left: 35});
// set tooltip settings
chart.tooltip().titleFormat('{%Name}');
// set container id for the chart
chart.container('container');
// initiate chart drawing
chart.draw();
});
function getData() {
return [{
x: 'A',
name: 'Data Science',
value: 100,
stroke: 'none',
label: {
fontColor: '#3b8ad8',
fontSize: 14
}
}, {
x: 'B',
name: 'Computer Science',
value: 25
}, {
x: 'C',
name: 'Math and Statistics',
value: 25
}, {
x: 'D',
name: 'Subject Matter Expertise',
value: 25
}, {
x: ['A', 'B'],
name: 'Computer Science',
value: 50
}, {
x: ['A', 'C'],
name: 'Math and Statistics',
value: 50
}, {
x: ['A', 'D'],
name: 'Subject Matter Expertise',
value: 50
},
{
x: ['B', 'C'],
name: 'Machine\nLearning',
value: 5
}, {
x: ['C', 'D'],
name: 'Traditional\nResearch',
value: 5
}, {
x: ['D', 'B'],
name: 'Traditional\nSoftware',
value: 5
}, {
x: ['B', 'C', 'D'],
name: 'Unicorn',
value: 5
}];
}