I seem to be having a problem with the legend udating
When the data changes in the stor the pie chart updates but the legend does not.
But to surprise its getting updated once when we reset the pie chart, as am using Reset option in interactions.
I don’t know what the exact problem why legend is not updating first time itself.
when I use hard code values for the store then legend was getting updated at the first itself. For the dynamic values only the legend was not updating intially.
Please refer Some part of my code,
PieChart = new Ext.chart.Chart( {
cls: 'pie1',
theme: 'Demo',
store: store1
shadow: true,
animate: true,
legend: {
position: 'top'
// dock: false
},
interactions: [ {
type: 'reset',
confirm: true
}],
series:
[ {
type: 'pie',
renderer: function(sprite, storeItem, barAttr, m, store11) {
barAttr.fill = colors1[m % colors1.length];
return barAttr;
},
field: 'data1',
showInLegend: true,
highlight: false,
donut: 15,
listeners: {
'labelOverflow': function(label, item) {
item.useCallout = true;
}
},
callouts: {
renderer: function(callout, storeItem) {
callout.label.setAttributes( {
text: storeItem.get('Horizontal')
}, true);
},
filter: function() {
return false;
},
box: {
//no config here.
},
lines: {
'stroke-width': 2,
offsetFromViz: 10
},
label: {
font: 'italic 14px Arial'
},
styles: {
font: '14px Arial'
}
},
label: {
field: 'Horizontal',
display: 'rotate',
font: '5px Arial'
}
}]
Any ideas?
I got this solved by using the following code while data getting saved into the store