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
var data_1 = [["1", "82"], ["1", "90"], ["1", "78"], ["1", "86"], ["1", "86"], ["1", "88"], ["1", "86"], ["2", "87"], ["2", "90"], ["2", "87"], ["2", "90"], ["2", "67"], ["2", "90"], ["2", "77"], ["3", "82"], ["3", "96"], ["3", "82"], ["3", "80"], ["3", "93"], ["3", "67"], ["3", "87"], ["4", "66"], ["4", "91"], ["4", "71"], ["4", "77"], ["4", "77"], ["4", "80"], ["4", "83"], ["5", "76"], ["5", "82"], ["5", "62"], ["5", "78"], ["5", "84"], ["5", "78"], ["5", "76"]],
3
chart = anychart.scatter();
4
5
var series1 = chart.bubble(data_1);
6
7
chart.maxBubbleSize(20);
8
chart.minBubbleSize(1);
9
10
series1.tooltip()
11
.hAlign('start')
12
.format(function () {
13
return 'Value: ' + this.value;
14
});
15
16
chart.getSeriesAt(0).name("Score");
17
18
chart.xScale().minimum(0).ticks().interval(1);
19
chart.xAxis(0).drawFirstLabel(false).drawLastLabel(false);
20
21
xLabels = chart.xAxis().labels();
22
xLabels.format(function (x) {
23
var xLabel;
24
xLabel = x.value;
25
return xLabel;
26
});
27
xLabels.fontSize(10);
28
xLabels.width(60);
29
xLabels.height(25);
30
xLabels.textOverflow("...");
31
xLabels.hAlign("center");
32
33
chart.xGrid(true);
34
chart.yGrid(true);
35
chart.xMinorGrid(true);
36
chart.yMinorGrid(true);
37
38
chart.yScale().minimum(40);
39
chart.yScale().maximum(100);
40
chart.container('container');
41
chart.draw();
42
});
43