<div id="container"></div>
html, body, #container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
anychart.onDocumentReady(function () {
// create a line chart
var chart = anychart.line([
{x: 0, value: 6},
{x: 1, value: 10},
{x: 2, value: 18},
{x: 3, value: 11},
{x: 4, value: 9}
]);
// configure the scales
chart.yScale({minimum: 0});
chart.xScale("linear");
// set annotations
// access the annotations() object
chart.annotations([
// create and configure an ellipse
{
type: "ellipse",
xAnchor: 1.9,
valueAnchor: 17,
secondXAnchor: 2.1,
secondValueAnchor: 19,
fill: "#4CAF50 0.5",
stroke: "3 #FF9800"
},
// create and configure a triangle
type: "triangle",
xAnchor: 2.9,
valueAnchor: 10.5,
secondXAnchor: 3.1,
secondValueAnchor: 10.5,
thirdXAnchor: 3,
thirdValueAnchor: 12,
fill: "#80deea 0.5",
stroke: "3 #FFD54F"
chart.container("container");
chart.draw();
});