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 a chart
4
var chart = anychart.quadrant();
5
6
// set the padding of the chart
7
chart.padding(35);
8
9
// configure quarters
10
chart.quarters(
11
{
12
rightTop: {
13
title: {
14
text: "Important but Not Urgent",
15
fontSize: "16",
16
fontWeight: "bold"
17
}
18
},
19
rightBottom: {
20
title: {
21
text: "Not Important and Not Urgent",
22
fontSize: "16",
23
fontWeight: "bold"
24
}
25
},
26
leftTop: {
27
title: {
28
text: "Important and Urgent",
29
fontSize: "16",
30
fontWeight: "bold"
31
}
32
},
33
leftBottom: {
34
title: {
35
text: "Urgent But Not Important",
36
fontSize: "16",
37
fontWeight: "bold"
38
}
39
},
40
}
41
);
42
43
// create a label on the left-top quarter
44
var labelLTop = chart.quarters().leftTop().label();
45
labelLTop.text("1");
46
labelLTop.fontColor("gray");
47
labelLTop.fontSize(16);
48
labelLTop.fontWeight("bold");
49
labelLTop.position("right-bottom");
50
labelLTop.offsetX(-20);
51
labelLTop.offsetY(-20);
52
53
// create a label on the right-top quarter
54
var labelRTop = chart.quarters().rightTop().label();
55
labelRTop.text("2");
56
labelRTop.fontColor("gray");
57
labelRTop.fontSize(16);
58
labelRTop.fontWeight("bold");
59
labelRTop.position("left-bottom");
60
labelRTop.offsetX(20);
61
labelRTop.offsetY(-20);
62
63
// create the first label on the left-bottom quarter
64
var labelLBottom1 = chart.quarters().leftBottom().label(0);
65
labelLBottom1.text("3");
66
labelLBottom1.fontColor("gray");
67
labelLBottom1.fontSize(16);
68
labelLBottom1.fontWeight("bold");
69
labelLBottom1.position("right-top");
70
labelLBottom1.offsetX(-20);
71
labelLBottom1.offsetY(20);
72
73
// create the second label on the left-bottom quarter
74
var labelLBottom2 = chart.quarters().leftBottom().label(1);
75
labelLBottom2.useHtml(true);
76
labelLBottom2.text("Important / Not Important →");
77
labelLBottom2.position("left-bottom");
78
labelLBottom2.offsetX(-20);
79
labelLBottom2.offsetY(-100);
80
labelLBottom2.rotation(-90);
81
82
// create the third label on the left-bottom quarter
83
var labelLBottom3 = chart.quarters().leftBottom().label(3);
84
labelLBottom3.useHtml(true);
85
labelLBottom3.text("Urgent / Not Urgent →");
86
labelLBottom3.position("left-bottom");
87
labelLBottom3.offsetX(80);
88
labelLBottom3.offsetY(20);
89
90
// create a label on the right-bottom quarter
91
var labelRBottom = chart.quarters().rightBottom().label();
92
93
labelRBottom.text("4");
94
labelRBottom.fontColor("gray");
95
labelRBottom.fontSize(16);
96
labelRBottom.fontWeight("bold");
97
labelRBottom.position("left-top");
98
labelRBottom.offsetX(20);
99
labelRBottom.offsetY(20);
100
101
// set the chart title
102
chart.title().useHtml(true);
103
chart.title("Quadrant Chart: Quarter Labels" + "<br>" +
104
"<a style=\"font-size: 12px;\">Procrastination Matrix</a>");
105
106
// set the container id
107
chart.container("container");
108
109
// initiate drawing the chart
110
chart.draw();
111
});