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
{x: "A", value: 100},
6
{x: "B", value: 100},
7
{x: "C", value: 100},
8
{x: ["A", "B"], value: 20},
9
{x: ["A", "C"], value: 20},
10
{x: ["B", "C"], value: 20},
11
{x: ["A", "B", "C"], value: 20}
12
];
13
14
// create a chart and set the data
15
chart = anychart.venn(data);
16
17
// configure the visual settings of intersections
18
var intersections = chart.intersections();
19
intersections.normal().fill("green", 0.3);
20
intersections.hovered().fill("green", 0.1);
21
intersections.selected().fill("green", 0.5);
22
intersections.normal().hatchFill("percent50", "white");
23
intersections.hovered().hatchFill("percent50", "white");
24
intersections.selected().hatchFill("percent50", "white");
25
intersections.normal().stroke("white");
26
intersections.hovered().stroke("white", 2);
27
intersections.selected().stroke("white", 4);
28
29
// disable labels of intersections
30
intersections.labels(false);
31
32
// disable the legend
33
chart.legend(false);
34
35
// set the chart title
36
chart.title("Venn Diagram: Appearance (Intersections)");
37
38
// set the container id
39
chart.container('container');
40
41
// initiate drawing the chart
42
chart.draw();
43
});