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 dataTable = anychart.data.table();
3
dataTable.addData(get_dji_daily_short_data());
4
5
var chart = anychart.stock();
6
7
var plot = chart.plot();
8
plot.area(dataTable.mapAs({value: 1})).name('First series');
9
plot.line(dataTable.mapAs({value: 2})).name('Second series');
10
11
var tooltip = chart.tooltip();
12
13
// Set union format.
14
tooltip.unionFormat(function () {
15
return 'Area series: ' + this.points[0].value + '\n' + 'Line series: '+ this.points[1].value;
16
});
17
18
chart.title('Set the union format using the function');
19
chart.container('container');
20
chart.draw();
21
});