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 chart = anychart.column([
3
{x: 'Meat', value: 10},
4
{x: 'Fruit', value: 12},
5
{x: 'Nuts', value: 18},
6
{x: 'Milk', value: 5},
7
{x: 'Fish', value: 9}
8
]);
9
10
// Get X-axis.
11
var bottomXAxis = chart.xAxis();
12
bottomXAxis.ticks({stroke: '#2196F3'});
13
14
// Get X-axis by index.
15
var topXAxis = chart.xAxis(1);
16
topXAxis.orientation('top');
17
topXAxis.stroke('#2196F3');
18
topXAxis.title(true);
19
20
chart.title('Get and modify chart xAxis');
21
chart.container('container');
22
chart.draw();
23
});