Cannot show legend in Sencha Chart
I've implemented a Chart that needs to be populated after its creation.
Here is a snip of the object i created:
MyApp.views.chartPanel = new Ext.chart.Pa开发者_如何学编程nel({
id: 'chartPanel',
title: 'Pie Chart',
items: {
cls: 'pie1',
theme: 'Demo',
store: null,
shadow: false,
animate: false,
insetPadding: 20,
legend: {
position: 'top'
},
.....
pass: function(id) {
MyApp.views.chartPanel.items.items[0].bindStore(getData(id));
}
The pass function is invoked and chart is populated but i cannot see the legend that is shown only if the users double-click on the window and resets the chart.
How can i correctly show the legend?
Add the following in your series config:
series: [{
type: 'pie',
....
showInLegend: true,
label: {
field: 'name'
}
}]
精彩评论