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: "2000", value: 1100, size: 3},
6
{x: "2001", value: 880, size: 4},
7
{x: "2002", value: 1100, size: 4},
8
{x: "2003", value: 1300, size: 5,
9
normal: {
10
fill: "#b30059 0.3",
11
stroke: "#b30059"
12
},
13
hovered: {
14
fill: "#b30059 0.1",
15
stroke: "2 #b30059"
16
},
17
selected: {
18
fill: "#b30059 0.5",
19
stroke: "4 #b30059"
20
}
21
},
22
{x: "2004", value: 921, size: 4.5},
23
{x: "2005", value: 1000, size: 3},
24
{x: "2006", value: 1400, size: 4}
25
];
26
27
// create a chart
28
var chart = anychart.cartesian();
29
30
// set the interactivity mode
31
chart.interactivity().hoverMode("by-x");
32
33
// create a bubble series and set the data
34
series = chart.bubble(data);
35
36
// set the chart title
37
chart.title("Bubble Chart: Appearance (Individual Points)");
38
39
// enable the legend
40
chart.legend(true);
41
42
// set the titles of the axes
43
chart.xAxis().title("Year");
44
chart.yAxis().title("Sales, $");
45
46
// set the container id
47
chart.container("container");
48
49
// initiate drawing the chart
50
chart.draw();
51
});