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
// set the data separator
42
chart.dataSeparator("+")
43
44
// configure labels of intersections
45
chart.intersections().labels().format("{%x}");
46
47
// disable the legend
48
chart.legend(false);
49
50
// set the chart title
51
chart.title("Venn Diagram: Data\nSetting Intersections (Strings)");
52
53
// set the container id
54
chart.container('container');
55
56
// initiate drawing the chart
57
chart.draw();
58
});