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: 4, value: 42},
6
{x: 13, value: 59},
7
{x: 25, value: 68},
8
{x: 25, value: 63},
9
{x: 44, value: 54},
10
{x: 55, value: 58},
11
{x: 56, value: 46},
12
{x: 60, value: 54},
13
{x: 72, value: 73, image: "https://pbs.twimg.com/profile_images/1389594666287476744/jbdbQ5Oh_400x400.jpg"}
14
];
15
16
// create a chart
17
var chart = anychart.quadrant(data);
18
var series = chart.getSeries(0);
19
20
// customize series appearance in the normal state
21
series.normal()
22
.size(15)
23
.fill(function(){return {
24
src: this.getData("image") ? this.getData("image") : "https://www.anychart.com/_design/img/static/AnyChart-circle.png",
25
mode: "fit"
26
}});
27
28
// customize series appearance in the hovered state
29
series.hovered()
30
.size(20)
31
.fill(function(){return {
32
src: this.getData("image") ? this.getData("image") : "https://www.anychart.com/_design/img/static/AnyChart-circle.png",
33
mode: "fit"
34
}});
35
36
// customize series appearance in the selected state
37
series.selected()
38
.size(25)
39
.fill(function(){return {
40
src: this.getData("image") ? this.getData("image") : "https://www.anychart.com/_design/img/static/AnyChart-circle.png",
41
mode: "fit"
42
}});
43
44
// set the chart title
45
chart.title("Quadrant Chart with Images as Markers");
46
47
// set the container id
48
chart.container("container");
49
50
// initiate drawing the chart
51
chart.draw();
52
53
});