1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    6
    Vote Rating
    0
    threethazz is on a distinguished road

      0  

    Default Unanswered: Issue with piechart

    Unanswered: Issue with piechart


    Hello,

    I'm having an Error on chrome (IE doesnt mind it though) while opening a panel with a pie chart in it. The error comes from the legend: section.

    Error: Invalid value for <rect> attribute height="NaN"
    Error: Invalid value for <rect> attribute y="NaN"
    Error: Invalid value for <rect> attribute height="NaN"


    I've searched over the net and modified the code dozens of times and nothing works...

    Even after I get this error messages, the pie works fine...

    Can anyone help me? Thank you!

    Code:
     var pieChart = new Ext.chart.Chart({
                animate: true,
                store: pieStore,
                shadow: true,
                legend: {
                    position: 'right'
                },
                insetPadding: 50,
                theme: 'Base:gradients',
                series: [{
                    type: 'pie',
                    field: 'num_repetition',
                    showInLegend: true,
                    tips: {
                        trackMouse: true,
                        width: 170,
                        height: 40,
                        renderer: function(storeItem) {
                            //calculate percentage.
                            this.setTitle(storeItem.get('log_type_name') + ': ' + Math.round(storeItem.get('num_repetition') / total * 100) + '%' +'<br>occurrences:  '+ storeItem.get('num_repetition'));
                            }
                    },              
                    highlight: {
                        segment: {
                            margin: 20
                        }
                    },
                    label: {
                        field: 'log_type_name',
                        contrast: true,
                        font: '12px Arial'
                        }
                 }]             
            });
    Code:
    var panel1 = Ext.create('widget.panel', {
                    width: 800,
                    height: 800,
                    title: 'Requests',
                    layout: 'fit',
                    items: [pieChart]     
            });
            
            panel1.render('render');
    threethazz
    Last edited by threethazz; 23 Nov 2011 at 5:58 AM. Reason: color

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,641
    Vote Rating
    434
    Answers
    3107
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    What does your response look like?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    6
    Vote Rating
    0
    threethazz is on a distinguished road

      0  

    Default


    I'm sorry, I forgot that part.

    The data is loaded correctly, and it is also correctly displayed. It's only those 3 errors showing up in the Chrome console.

    Code:
    if (!Ext.ClassManager.isCreated('AdminStatistics')){
                Ext.define('AdminStatistics',{
                extend: 'Ext.data.Model',
                fields: [
                    'log_type_id', 'log_type_name',  'company_id', 'num_repetition'
                    ]
                });
            }
    
     var  pieStore = Ext.create('Ext.data.Store', {
                model: 'AdminStatistics',
                autoLoad: false,
                proxy: {
                    // load using HTTP
                    type: 'ajax',
                    url: '/AdminStatistics/Statistics',
                    // the return will be XML, so lets set up a reader
                    reader: {
                        type: 'json',
                        root: 'list'
                    },
                    extraParams:{
                            company_id: ''
                        }
                }
            });

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    6
    Vote Rating
    0
    threethazz is on a distinguished road

      0  

    Default


    anyone?

Tags for this Thread