我在图表1.1中使用Sencha Touch 2.1来显示一些数据。Sencha图表饼图标签旋转
我有一个饼图如下图所示:
我想要的标签留他们现在在哪里,但我希望他们能水平(不旋转)。
extend: 'Ext.chart.PolarChart',
requires: [
'Ext.chart.axis.Numeric',
'Ext.chart.axis.Category',
'Ext.chart.series.Pie',
'Charting.store.charts.perStore',
'Ext.chart.interactions.Rotate'
],
config: {
colors: ["#6295C7", "#CCCCC", "#FFFFF"],
store: 'chrtProduct',
// centered:true,
// innerPadding:20,
series: [{
type: 'pie',
labelField: 'verdeling',
label:{
/*display:'middle',
orientation:'horizontal',*/
field:'patVerdeling',
font: '1em Trade Gothic LT Std Bold',
contrast:true,
disableCallout:true
},
xField: 'patVerdeling'
//,rotation:90
}]
//,interactions: ['rotate']
以下代码在取消注释时似乎没有做任何事情。
display:'middle',
orientation:'horizontal',
我不确定你可以... ['Label'](http://docs.sencha.com/touch/2-1/#!/api/Ext.chart.label.Label)有'rotationRads'配置选项,但默认为零(它来自['sprite.Text'](http://docs.sencha.com/touch/2-1/#!/api/Ext.draw .sprite.Text)对象),并且在旋转时最有可能由饼图在内部进行更改。这就是为什么当图表旋转时能够重新旋转标签的原因。祝你好运。 – jakerella
对于显示属性显示为[此处]的ExtJS饼图,这非常简单(http://docs.sencha.com/ext-js/4-1/#!/api/Ext.chart.series.Pie -cfg标签)。我用过它。 Sencha Touch pie系列没有这样的配置,我也没有在源代码中看到它。你必须重写sencha touch pie系列上的标签生成功能。 [在这里某处](http://docs.sencha.com/touch/2-1/source/Pie.html#Ext-chart-series-Pie),我现在没有时间去解决它,但通常我会为赏金跳跃。这绝对是可以的。 – Geronimo