Sencha touch 无法在Sencha图表中显示图例

Sencha touch 无法在Sencha图表中显示图例,sencha-touch,sencha-charts,Sencha Touch,Sencha Charts,我已经实现了一个图表,它需要在创建后填充 以下是我创建的对象的剪贴画: MyApp.views.chartPanel = new Ext.chart.Panel({ id: 'chartPanel', title: 'Pie Chart', items: { cls: 'pie1', theme: 'Demo', store: null, s

我已经实现了一个图表,它需要在创建后填充

以下是我创建的对象的剪贴画:

       MyApp.views.chartPanel = new Ext.chart.Panel({
       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));

        }
调用pass函数并填充图表,但我看不到只有用户双击窗口并重置图表时才会显示的图例


如何正确显示图例?

在序列配置中添加以下内容:

series: [{
    type: 'pie',
    ....
    showInLegend: true,
    label: {
        field: 'name'
    }
}]