{"size": 2768, "ext": "js", "max_stars_repo_path": "demo/app/view/PieChart.js", "max_stars_repo_name": "kawanoshinobu/sencha-touch-flat-ui-theme", "max_stars_repo_stars_event_min_datetime": "2015-03-08T09:39:58.000Z", "max_stars_repo_stars_event_max_datetime": "2015-12-05T02:06:51.000Z", "max_issues_repo_path": "demo/app/view/PieChart.js", "max_issues_repo_name": "kawanoshinobu/sencha-touch-flat-ui-theme", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "demo/app/view/PieChart.js", "max_forks_repo_name": "kawanoshinobu/sencha-touch-flat-ui-theme", "max_forks_repo_forks_event_min_datetime": "2015-01-25T15:09:42.000Z", "max_forks_repo_forks_event_max_datetime": "2015-11-01T23:17:57.000Z"}
{"max_stars_count": 9, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 32.5647058824, "max_line_length": 107, "alphanum_fraction": 0.3244219653}
/**
 * Demonstrates how use Ext.chart.series.Pie
 */
    //<feature charts>
Ext.define('Kitchensink.view.PieChart', {
    extend: 'Ext.Panel',
    requires: ['Ext.chart.PolarChart', 'Ext.chart.series.Pie', 'Ext.chart.interactions.Rotate'],
    config: {
        cls: 'card1',
        layout: 'fit',
        style: 'background: white',
        items: [
            {
                xtype: 'toolbar',
                top: 0,
                right: 0,
                zIndex: 50,
                style: {
                    background: 'none'
                },
                items: [
                    {
                        xtype: 'spacer'
                    },
                    {
                        iconCls: 'refresh',
                        text: 'Refresh',
                        handler: function () {
                            Ext.getStore('Pie').generateData(9);
                        }
                    },
                    {
                        text: 'Reset',
                        handler: function () {
                            //ensure the query gets the chart for this kitchensink example
                            var chart = Ext.ComponentQuery.query('polar', this.getParent().getParent())[0];
                            
                            //reset the rotation
                            Ext.ComponentQuery.query('series', chart)[0].setRotation(0);
                            
                            //reset the legend
                            chart.resetLegendStore();
                        }
                    }
                ]
            },
            {
                xtype: 'polar',
                store: 'Pie',
                colors: Kitchensink.view.ColorPatterns.getBaseColors(),
                interactions: ['rotate', 'itemhighlight'],
                legend: {
                    docked: 'right',
                    verticalWidth: 100
                },
                innerPadding: 45,
                series: [
                    {
                        type: 'pie',
                        xField: 'g1',
                        labelField: 'name',
                        donut: 30,
                        highlightCfg: {
                            margin: 20
                        },
                        style: {
                            stroke: 'white',
                            miterLimit: 10,
                            lineCap: 'miter',
                            lineWidth: 2
                        }
                    }
                ],
                axes: [
                ]
            }
        ]
    },
    initialize: function () {
        this.callParent();
        Ext.getStore('Pie').generateData(9);
    }
});
//</feature>
