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 data
4
var data = [
5
{x: "January", open:511.53, high:514.98, low:505.79, close:506.40},
6
{x: "February", open:507.84, high:513.30, low:507.23, close:512.88},
7
{x: "March", open:512.36, high:515.40, low:510.58, close:511.40},
8
{x: "April", open:513.10, high:516.50, low:511.47, close:515.25},
9
{x: "May", open:515.02, high:528.00, low:514.62, close:525.15}
10
];
11
12
// create a chart
13
var chart = anychart.vertical();
14
15
// create a japanese candlestick series and set the data
16
var series = chart.candlestick(data);
17
18
// set the chart title
19
chart.title("Vertical Japanese Candlestick Chart");
20
21
// set the container id
22
chart.container("container");
23
24
// initiate drawing the chart
25
chart.draw();
26
});