【发布时间】:2013-03-18 13:47:51
【问题描述】:
Hi
我正在使用 sencha touch 2.1.1 图表以笛卡尔图表格式显示投票结果。我将轴类型指定为“整数”。我给图表商店的输入值总是只有整数(比如 1,2,3...)。但是绘制的图形轴包含小数,但我的轴不需要小数。
如何解决这个问题。提前致谢。
Ext.define("KBurra1.view.PollChart",{
extend:"Ext.chart.CartesianChart",
requires:['Ext.data.JsonStore','Ext.chart.axis.Numeric','Ext.chart.axis.Category','Ext.chart.series.Bar'],
config:{
store:null,
//id:"poll_chart",
height:'200px',
flipXY: true,
axes: [{
type: 'numeric',
minimum:0,
//maximum:3,
//increment:1,
position: 'bottom',
title: 'Number of Votes',
grid: {
odd: {
opacity: 1,
fill: '#dddc',
stroke: '#bbb',
lineWidth: 1
},
},
}, {
type: 'category',
position: 'left',
grid: true,
label: {
rotate: {
degrees:330
},
}
}],
series: [{
//title : ['data1'],
type: 'bar',
xField: 'answer',
yField: ['votecount'],
style: {
fill:'#57a4f7',
minGapWidth:5,
},
stacked : false
}]
}
});
【问题讨论】:
-
我不明白你的意思,所以你想要 1,2,3,4 而不是 0.00、0.05、0.10、0.15?
-
你是对的。我需要 1、2、3、4 而不是 0.00、0.05、0.10、0.15。如果你知道帮我解决这个问题。
-
有时投票数是 2 或 3 的意思,如果我们将最大值设置为 20,则条形的长度在移动设备中非常小。
标签: sencha-touch-2 sencha-charts