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
3
//create data
4
var data = [
5
{
6
x: "A",
7
name: "Set A",
8
value: 100
9
},
10
{
11
x: "B",
12
name: "Set B",
13
value: 100
14
},
15
{
16
x: "C",
17
name: "Set C",
18
value: 100
19
},
20
{
21
x: ["A", "B"],
22
value: 20
23
},
24
{
25
x: ["A", "C"],
26
value: 20
27
},
28
{
29
x: ["B", "C"],
30
value: 20
31
},
32
{
33
x: ["A", "B", "C"],
34
value: 20
35
}
36
];
37
38
// create a chart and set the data
39
chart = anychart.venn(data);
40
41
// configure labels of intersections
42
chart.intersections().labels().format("{%x}");
43
44
// disable the legend
45
chart.legend(false);
46
47
// set the chart title
48
chart.title("Venn Diagram: Data\nSetting Intersections (Arrays)");
49
50
// set the container id
51
chart.container('container');
52
53
// initiate drawing the chart
54
chart.draw();
55
});