【发布时间】:2014-10-10 07:50:04
【问题描述】:
下面是我在 Sencha touch 应用程序中的饼图代码。我面临的问题是,每当显示图表的空间不足以容纳所有标签时,就会有标注线和标签,但是我希望这些标注线的长度更短,然后它们现在就可以了,因为它们不适合我的屏幕和标签被剪掉。
我找不到正确的配置属性。
EDIT - 图片中的两个图表代码相同,放在容器中的hbox布局中
{
xtype: 'polar',
itemId: 'pieChart',
background: 'white',
store: 'GraphsStore',
shadow: true,
innerPadding: 25,
//bind the chart to a store with the following structure
//interactions: ['rotate'],
colors: ["#115fa6", "#94ae0a", "#a61120", "#ff8809", "#ffd13e", "#a61187", "#24ad9a", "#7c7474", "#a66111"],
//configure the legend.
legend: {
position: 'top',
//width: 100
hidden: true
},
//describe the actual pie series.
series: [{
type: 'pie',
xField: 'g1',
renderer: function(sprite, config, rendererData, index) {
var changes = {},
store = rendererData.store,
curentRecord = store.getData().items[index];
var text = curentRecord.data.g1;
changes.text = text;
return changes;
},
label: {
field: 'name',
display: 'rotate',
font: '8px'
},
donut: 25,
style: {
miterLimit: 5,
lineCap: 'miter',
lineWidth: 1
}
}]
}
任何指针都会有所帮助! 谢谢。
【问题讨论】:
标签: charts sencha-touch-2 pie-chart