答案 0 :(得分:0)
您需要将rotate
设置为true
,将类别轴“position
属性设置为"right"
,并将值轴”reversed
属性设置为{{ 1}}:
true
演示如下:
var chart = AmCharts.makeChart("chartdiv", {
// ...
"rotate": true,
"categoryAxis": {
"position": "right",
//...
},
"valueAxes": [{
"reversed": true,
// ...
}],
// ...
});
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
"rotate": true,
"categoryAxis": {
"position": "right"
},
"valueAxes": [{
"reversed": true
}],
"dataProvider": [{
"country": "USA",
"visits": 2025
}, {
"country": "China",
"visits": 1882
}, {
"country": "Japan",
"visits": 1809
}, {
"country": "Germany",
"visits": 1322
}, {
"country": "UK",
"visits": 1122
}, {
"country": "France",
"visits": 1114
}, {
"country": "India",
"visits": 984
}, {
"country": "Spain",
"visits": 711
}, {
"country": "Netherlands",
"visits": 665
}, {
"country": "Russia",
"visits": 580
}, {
"country": "South Korea",
"visits": 443
}, {
"country": "Canada",
"visits": 441
}, {
"country": "Brazil",
"visits": 395
}],
"graphs": [{
"fillAlphas": 0.9,
"lineAlpha": 0.2,
"type": "column",
"valueField": "visits"
}],
"categoryField": "country"
});
html,
body {
width: 100%;
height: 100%;
margin: 0px;
}
#chartdiv {
width: 100%;
height: 100%;
}