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 stage = anychart.graphics.create("container");
3
4
// Create a chart from a data array.
5
var lineChart = anychart.line([1.1, 1.4, 1.2, 1.6]);
6
lineChart.bounds(0, 15, "50%", "100%");
7
lineChart.container(stage);
8
lineChart.draw();
9
10
// Get chart data as CSV using data export mode. Data export modes can be "raw", "grouped" and "specific".
11
var csvData = lineChart.toCsv(anychart.enums.ChartDataExportMode.SPECIFIC, {
12
"rowsSeparator": "\n",
13
"columnsSeparator": ",",
14
"ignoreFirstRow": true
15
});
16
17
// Restore the chart from the data obtained.
18
var columnChart = anychart.column(csvData);
19
columnChart.bounds("50%", 15, "50%", "100%");
20
columnChart.container(stage);
21
columnChart.draw();
22
23
var customTitle = anychart.standalones.title();
24
customTitle.text("Set data export mode.");
25
customTitle.container(stage);
26
customTitle.draw();
27
});