2011-10-06 28 views
0

我已经实施了一个需要在其创建后填充的图表。无法在Sencha图表中显示图例

这里为i创建的对象的剪断:

 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)); 

     } 

的通函数被调用,并且被填充图表,但我不能看到所显示的图例仅当用户在窗口上双击和重置图表。

我该如何正确显示图例?

回答

0

添加您的系列配置如下:

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