HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
// create bar chart
3
var chart = anychart.venn(getData());
4
5
//set chart stroke
6
chart.stroke('2 #fff');
7
8
//set labels settings
9
chart.labels(false);
10
11
//set font color for hover intersections labels
12
chart.intersections().hovered().fill('black 0.25');
13
14
//set legend settings
15
chart.legend()
16
.position('right')
17
.itemsLayout('vertical')
18
.itemsSpacing(3)
19
.padding({left: 35});
20
21
chart.container('container');
22
//initiate chart drawing
23
chart.draw();
24
25
function getData() {
26
return [
27
{
28
x: 'A',
29
name: 'Data Science',
30
value: 100,
31
stroke: 'none',
32
label: {
33
enabled: true,
34
fontColor: '#3b8ad8',
35
fontSize: 14
36
}
37
}, {
38
x: 'B',
39
name: 'Computer Science',
40
value: 25
41
}, {
42
x: 'C',
43
name: 'Math and Statistics',
44
value: 25
45
}, {
46
x: 'D',
47
name: 'Subject Matter Expertise',
48
value: 25
49
}, {
50
x: ['A', 'B'],
51
name: 'Computer Science',
52
value: 50
53
}, {
54
x: ['A', 'C'],
55
name: 'Math and Statistics',
56
value: 50
57
}, {
58
x: ['A', 'D'],
59
name: 'Subject Matter Expertise',
60
value: 50
61
}, {
62
x: ['B', 'C'],
63
name: 'Machine Learning',
64
value: 5
65
}, {
66
x: ['C', 'D'],
67
name: 'Traditional Research',
68
value: 5
69
}, {
70
x: ['D', 'B'],
71
name: 'Traditional Software',
72
value: 5
73
}, {
74
x: ['B', 'C', 'D'],
75
name: 'Unicorn',
76
value: 5
77
}
78
];
79
}
80
});