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 Scale Inversion">' +
8
// x axes setting
9
'<x_axes>'+
10
// adjust default x axis
11
'<axis orientation="top" title="false"/>'+
12
'</x_axes>'+
13
// y axes settings
14
'<y_axes>' +
15
// adjust default y axis
16
'<axis orientation="right" title="false"/>'+
17
'</y_axes>'+
18
// y scale setting
19
'<y_scale inverted="true"/>'+
20
// series settings
21
'<series_list>'+
22
'<series>' +
23
// data set
24
'<data>' +
25
'<point x="P1" value="128.14"/>'+
26
'<point x="P2" value="112.61"/>'+
27
'<point x="P3" value="163.21"/>'+
28
'<point x="P4" value="229.98"/>'+
29
'<point x="P5" value="90.54"/>'+
30
'</data>'+
31
'</series>'+
32
'</series_list>'+
33
'</chart>'+
34
'</anychart>';
35
36
// get XML data
37
var chart = anychart.fromXml(xml);
38
39
// draw chart
40
chart.draw();
41
});