如何解决由于数据点之间的巨大差异,Amcharts 列不可见
我正在使用 Amcharts 创建柱形图,由于数据点之间的巨大差异,一些条形图不可见。
举一个带有演示数据集的例子,你可以看看。
var chart = AmCharts.makeChart("chartdiv",{
"type": "serial","dataProvider": [{
"country": "USA","visits": 20222
},{
"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": 10
},{
"country": "Netherlands","visits": 665
},{
"country": "Russia","visits": 580
},{
"country": "South Korea","visits": 0.4
},{
"country": "Canada","visits": 11
},{
"country": "Brazil","visits": 10
}],"valueAxes": [{
"gridColor": "#FFFFFF","gridAlpha": 0.2,"dashLength": 0
}],"gridAboveGraphs": true,"startDuration": 1,"graphs": [{
"balloonText": "[[category]]: <b>[[value]]</b>","fillAlphas": 0.8,"lineAlpha": 0.2,"type": "column","valueField": "visits","labelPosition": "inside","labelRotation": 90,"showAllValueLabels": true
}],"chartCursor": {
"categoryBalloonEnabled": false,"cursorAlpha": 0,"zoomable": false
},"categoryField": "country","categoryAxis": {
"gridPosition": "start","gridAlpha": 0,"tickPosition": "start","tickLength": 20
}
});
#chartdiv {
width: 300px;
height: 400px;
}
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<div id="chartdiv"></div>
如上述数据集
-
美国的最大值为 20222
-
韩国的最小值为 0.4
由于这种异常,有一些列不可见但存在,如何使其可见?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。