我有一个显示百分比的图表,所以我不想在valueAxis上超过100。由于某些原因,valueAxis.maximum对我不起作用。这是我的图表函数的副本。该图表最终在valueAxis中显示最大110。我在某处缺少物业吗?
这是jsFiddle的链接。任何帮助表示赞赏。
var chart = AmCharts.makeChart(chartDiv, {
"theme": "light",
"type": "serial",
"dataProvider": nflDailyData,
"graphs": [{
"balloonText": "[[value]]% for [[category]]",
"fillAlphas": 0.5,
"lineAlpha": 0.2,
"title": "Percent Accuracy",
"type": "column",
"valueField": "value",
"legendValueText": "",
"fillColorsField": "color"
}],
"titles": [
{
"text": "NFL Daily Past 7-Day Evaluation",
"size": 26,
"color": "#3333cc"
}
],
"startDuration": 1,
"depth3D": 20,
"angle": 30,
"rotate": false,
"categoryField": "category",
"valueAxis": {
"minimum": 0,
"maximum": 100,
"unit": "%",
"unitPosition": "right"
},
"categoryAxis": {
"gridPosition": "start",
"fillAlpha": 0.05,
"position": "left",
"labelRotation": 45
},
"export": {
"enabled": true
}
});
最佳答案
由于图表支持多个值轴,因此没有单个“ valueAxis”参数。它是一个对象数组,并且是复数形式:valueAxes
。因此,在图表配置中,如果只有一个值轴,则需要这样指定事件:
"valueAxes": [{
"minimum": 0,
"maximum": 100,
"unit": "%",
"unitPosition": "right"
}]
您现在拥有它的方式将被图表简单地忽略,因此不会考虑
maximum
。关于javascript - amCharts valueAxis最大值不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35075659/