i have a pie chart with following code below.
Now i am trying to change the field property of label inside the series config from controller by using setLabel method of series but it does not change the label and chart has no effect. Previous label still persists. Below is the code i use for changing series label.
Any help what i am missing to make this work ?
SetLabel method does not work on Pie chart series
Code:
{
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: 'bottom',
//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: 15,
lineCap: 'miter',
lineWidth: 2
}
}]
}
Now i am trying to change the field property of label inside the series config from controller by using setLabel method of series but it does not change the label and chart has no effect. Previous label still persists. Below is the code i use for changing series label.
Code:
var pieChart = me.getPieChartReport().down('#pieChart');
var series = pieChart.getSeries();
series[0].setLabel({
field: 'g1',
display: 'rotate',
font: '8px'
});
pieChart.redraw();
Any help what i am missing to make this work ?
SetLabel method does not work on Pie chart series
Aucun commentaire:
Enregistrer un commentaire