Extjs4,Chart轴数字显示多个相同的数字?

时间:2012-11-22 03:31:45

标签: extjs4

enter image description here

在左侧,有重复的号码,我不知道为什么? 如何才能让每个号码只显示一个? 0,1,2和仅。

并在栏上显示网格,如何将其置于图表后面?

代码

axes: [{
    type: 'Numeric',
    position: 'left',
    fields: ['inCnt'],
    label: {
        renderer: Ext.util.Format.numberRenderer('0,0')
    },
    title: 'In Transaction Qty',
    grid: true,
    minimum: 0
}, {
    type: 'Category',
    position: 'bottom',
    fields: ['month'],
    title: 'Current 12 Month'
}],

series: [{
    type: 'column',
    axis: 'left',
    highlight: true,
    tips: {
        trackMouse: true,
        width: 130,
        height: 40,
        renderer: function (storeItem, item) {
            this.setTitle(storeItem.get('inCnt') + ' transaction(s) in '+storeItem.get('month'));
        }
    },
    label: {
        display: 'insideEnd',
        'text-anchor': 'middle',
        field: 'inCnt',
        renderer: Ext.util.Format.numberRenderer('0'),
        orientation: 'vertical',
        color: '#333'
    },
    xField: 'month',
    yField: 'inCnt'
}]

JSON数据

[
    { "month" : "Nov", "inCnt" : 0 },
    { "month" : "Oct", "inCnt" : 2 },
    { "month" : "Sep", "inCnt" : 0 },
    { "month" : "Aug", "inCnt" : 0 },
    { "month" : "Jul", "inCnt" : 0 },
    { "month" : "Jun", "inCnt" : 3 },
    { "month" : "May", "inCnt" : 0 },
    { "month" : "Apr", "inCnt" : 0 },
    { "month" : "Mar", "inCnt" : 0 },
    { "month" : "Feb", "inCnt" : 0 },
    { "month" : "Jan", "inCnt" : 0 },
    { "month" : "Dec", "inCnt" : 0 }
]

1 个答案:

答案 0 :(得分:1)

因为您在轴上使用了一个截断小数点的渲染器,所以

1.8
1.6
1.4
1.2

变为

1
1
1
1