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
// xml data
4
var xml = '<?xml version="1.0" encoding="utf-8"?>' +
5
'<anychart xmlns="https://cdn.anychart.com/schemas/8.7.1/xml-schema.xsd">' +
6
// set chart type, title and chart container
7
'<chart type="column" container="container" title="XML Visual Settings">' +
8
// chart series
9
'<series_list>'+
10
// series settings
11
'<series fill="gold" stroke="gray" hover_stroke="darkred" hatch_fill="diagonal-brick">' +
12
// customize hatch fill on mouse over
13
'<hover_hatch_fill type="diagonal-brick" color="darkred"/>'+
14
// data set
15
'<data>' +
16
'<point x="P1" value="128.14"/>'+
17
'<point x="P2" value="112.61"/>'+
18
'<point x="P3" value="163.21"/>'+
19
'<point x="P4" value="229.98"/>'+
20
'<point x="P5" value="90.54"/>'+
21
'<point x="P6" value="104.19"/>'+
22
'<point x="P7" value="150.67"/>'+
23
'<point x="P8" value="120.43"/>'+
24
'<point x="P9" value="143.76"/>'+
25
'<point x="P10" value="191.34"/>'+
26
'<point x="P11" value="134.17"/>'+
27
'<point x="P12" value="145.72"/>'+
28
'<point x="P13" value="222.56"/>'+
29
'<point x="P14" value="187.12"/>'+
30
'<point x="P15" value="154.32"/>'+
31
'<point x="P16" value="133.08"/>'+
32
'</data>'+
33
'</series>'+
34
'</series_list>'+
35
'</chart>'+
36
'</anychart>';
37
38
// get XML data
39
var chart = anychart.fromXml(xml);
40
41
// draw chart
42
chart.draw();
43
});