2016-01-29 62 views
0

我有一個顯示百分比的圖表,所以我不想在valueAxis上超過100。出於某種原因,valueAxis.maximum不適合我。這是我的圖表功能的副本。圖表最終顯示值爲Axis的最大值爲110。我在某個地方錯過了一處房產嗎?amCharts valueAxis最大值不起作用

這是鏈接到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 
    } 
}); 

回答

1

由於圖表支持多個值軸,因此沒有單個「valueAxis」參數。它是一組對象,它有複數:valueAxes。因此,在你的圖表配置,你需要指定它是這樣,事件如果你只有一個值軸:

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

你現在可以簡單地通過圖表忽視的方式,因此maximum不被考慮。

+0

這樣做。謝謝!! –