我试图将数字 y 轴显示为整数......没有运气,总是显示小数。
如果你找到了一种方法来回复我,请回复我。您可以在这里找到代码以便于测试:http: //jsfiddle.net/adriansky/4uY7H/
var store1 = Ext.create('Ext.data.Store', {
fields: ['name', {name: 'people', type: 'integer' }],
data:[
{"name":"jan", "people":13},
{"name":"feb", "people":12},
{"name":"mar", "people":12},
{"name":"apr", "people":13},
{"name":"may", "people":12},
{"name":"june", "people":13}
]
});
var chart = Ext.create('Ext.chart.Chart', {
renderTo: Ext.getBody(),
width: '80%',
height: '80%',
store: store1,
axes: [{
type: 'Numeric',
position: 'left',
fields: ['people'],
}, {
type: 'Category',
position: 'bottom',
fields: ['name'],
}],
series: [{
type: 'line',
axis: 'left',
xField: 'name',
yField: 'people',
}]
});