简体   繁体   English

amCharts valueAxis最大值不起作用

[英]amCharts valueAxis maximum not working

I have a chart that shows percentages, so I don't want to go past 100 on the valueAxis. 我有一个显示百分比的图表,所以我不想在valueAxis上超过100。 For some reason, valueAxis.maximum isn't working for me. 出于某种原因,valueAxis.maximum对我不起作用。 Here's a copy of my chart function. 这是我的图表功能的副本。 The chart ends up showing with 110 maximum in the valueAxis. 该图表最终在valueAxis中显示最大值110。 Am I missing a property somewhere? 我在某个地方错过了一处房产吗?

Here's a link to a jsFiddle . 这是jsFiddle的链接。 Any help is appreciated. 任何帮助表示赞赏。

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
     }
});

Since the chart supports multiple value axes, there's no single "valueAxis" parameter. 由于图表支持多个值轴,因此没有单个“valueAxis”参数。 It's an array of objects, and it's in plural: valueAxes . 它是一个对象数组,它是复数形式的: valueAxes So in your chart configuration, you need to specify it as such, event if you have just one value axis: 因此,在图表配置中,如果只有一个值轴,则需要将其指定为事件:

"valueAxes": [{
  "minimum": 0,
  "maximum": 100,
  "unit": "%",
  "unitPosition": "right"
}]

The way you have it now is simply ignored by the chart, hence maximum not being taken into account. 您现在拥有它的方式只是被图表忽略,因此maximum不予考虑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM