HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
// The data used in this sample can be obtained from the CDN
3
// https://cdn.anychart.com/samples/venn-charts/data-science/data.json
4
anychart.data.loadJsonFile(
5
'https://cdn.anychart.com/samples/venn-charts/data-science/data.json',
6
function (data) {
7
// create venn diagram
8
var chart = anychart.venn(data);
9
10
// set chart stroke
11
chart.stroke('2 #fff');
12
13
// set labels settings
14
chart.labels().format('{%Name}');
15
16
// set font color for hover intersections labels
17
chart.intersections().hovered().fill('black 0.25');
18
19
// set intersections labels settings
20
chart.intersections().labels().fontWeight('bold').format('{%Name}');
21
22
// set legend settings
23
chart
24
.legend()
25
.position('right')
26
.itemsLayout('vertical')
27
.padding({ left: 35 });
28
29
// set tooltip settings
30
chart.tooltip().titleFormat('{%Name}');
31
32
// set container id for the chart
33
chart.container('container');
34
// initiate chart drawing
35
chart.draw();
36
}
37
);
38
});