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
// create a chart
3
var chart = anychart.marker();
4
5
// add series
6
chart.marker([[1,1],[1,1],[5,6],[10,1]]).name("FDH 1mg/day");
7
chart.marker([[2,3],[1,4],[7,6],[13,1]]).name("FDH 5mg/day");
8
chart.marker([[2,1],[1,2],[3,6],[8,1]]).name("Placebo");
9
10
// configure legend
11
var legend = chart.legend();
12
legend.enabled(true);
13
legend.background().enabled(true).stroke("1 black");
14
legend.padding(5);
15
16
// set position mode
17
legend.positionMode("outside");
18
// set position and alignement
19
legend.position("top");
20
legend.align("right");
21
legend.itemsLayout("verticalExpandable");
22
23
chart.title("Outside Legend Position");
24
chart.container("container");
25
chart.draw();
26
});