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 bullet chart
4
var chart = anychart.bullet([
5
{value: 225},
6
{value: 290, // set marker position
7
type: "ellipse", // set ellipse as marker type
8
fill: "gold", // set gold inner color
9
stroke: "2 blue", // set border width 2px and border color
10
gap: 0.3 // set marker size
11
}
12
]);
13
14
// Set chart ranges
15
chart.range().from(0).to(100);
16
chart.range(1).from(100).to(150);
17
chart.range(2).from(150).to(200);
18
chart.range(3).from(200).to(250);
19
chart.range(4).from(250).to(300);
20
21
// Set chart size and position settings
22
chart.bounds(0, 0, "100%", 125);
23
24
// Set title
25
chart.title().text("Markers");
26
27
// Set chart container
28
chart.container("container");
29
30
// Initiate chart drawing
31
chart.draw();
32
});