开发者

Cannot show legend in Sencha Chart

开发者 https://www.devze.com 2023-04-11 10:09 出处:网络
I\'ve implemented a Chart that needs to be populated after its creation. Here is a snip of the object i created:

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'
    }
}]
0

精彩评论

暂无评论...
验证码 换一张
取 消