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 = "x;value*" +
5
"January;12000*" +
6
"February;15000*" +
7
"March;16000*" +
8
"April;14000*" +
9
"May;10000*";
10
11
// create an object with csv settings
12
csvSettings = {ignoreFirstRow: true, columnsSeparator: ";", rowsSeparator: "*"};
13
14
// create a data set
15
var dataSet = anychart.data.set(data, csvSettings);
16
17
// map the data
18
var mapping = dataSet.mapAs({x: 0, value: 1});
19
20
// create a chart
21
var chart = anychart.column();
22
23
// create a series and set the data
24
var series = chart.column(mapping);
25
26
// set the chart title
27
chart.title("Data Sets: CSV String");
28
29
// set the container id
30
chart.container("container");
31
32
// initiate drawing the chart
33
chart.draw();
34
});