Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jul 2011
    Location
    Holland
    Posts
    95
    Answers
    2
    Vote Rating
    0
    mrduck is an unknown quantity at this point

      0  

    Default Answered: Chart won't show correctly if there's just one record

    Answered: Chart won't show correctly if there's just one record


    Good day,

    I'm using several Charts in my Sencha Touch 1.1 application. There's a strange problem.

    When the store contains one record, the chart doesn't show correctly. I.e., the title's won't show up. When I add a second record, even an empty one, it just works how it supposed to work. For now changed the backend. It counts all the output and adds a second empty record when it's necessary. But it looks stupid on the screen.

    Here's my code:
    Code:
    app.views.DashboardOverviewView = Ext.extend(Ext.Panel, {
            scroll: 'vertical',
            height: 500,
            layout: {
                type: 'vbox',
                align: 'stretch'
            },
    
    
            defaults: {
                flex: 1,
                layout: {
                    type: 'hbox',
                    align: 'stretch'
                },
                defaults: {
                    xtype: 'chart',
                    flex: 1,
                    insetPadding: 25,
                    labelFont: '17px Arial'
                }
            },
            items: [{
                items: [{
                    id: 'overviewChart',
                    store: bbs.stores.overviewStore,
                    shadow: true,
                    legend: false,
                    interactions: [{
                        type: 'iteminfo',
                        gesture: 'tap',
                        panel: {
                            height: 350,
                            width: 335,
                            modal: false,
                            dockedItems: [{
                                dock: 'top',
                                xtype: 'toolbar',
                                title: 'Waarneming'
                            }]
                        },
                        listeners: {
                            'click': function () {},
                            'show': function (interaction, item, panel) {
    
    
                                // The field "empty" means that this field is ALWAYS empty for the specified item. So we show "N/A" or (nvt) instead of a zero
                                var record = item.storeItem;                            
                                var line200 = (record.get('200_empty') === true ? 'N.v.t.' : record.get('200_valueAbsolute') + ' ('+ record.get('200_norm')+')' );
                                var line201 = (record.get('201_empty') === true ? 'N.v.t.' : record.get('201_valueAbsolute') + ' ('+ record.get('201_norm')+')' );
                                var line202 = (record.get('202_empty') === true ? 'N.v.t.' : record.get('202_valueAbsolute') + ' ('+ record.get('202_norm')+')' );
                                var lineDeceased = (record.get('deceased_empty') === true ? 'N.v.t.' : record.get('deceased_valueAbsolute') );
                                var line10000 = (record.get('10000_empty') === true ? 'N.v.t.' : record.get('10000_valueAbsolute') + ' ('+ record.get('10000_norm')+')' );
                                var line10021 = (record.get('10021_empty') === true ? 'N.v.t.' : record.get('10021_valueAbsolute') + ' ('+ record.get('10021_norm')+')' );
                                var line10041 = (record.get('10041_empty') === true ? 'N.v.t.' : record.get('10041_valueAbsolute') + ' ('+ record.get('10041_norm')+')' );
    
    
                                panel.update(
                                    '<b>Title ' + record.get('name') + '</b>' +
                                        '<ul>' +
                                        '<li>Item 1: ' + line200 +
                                        '<li>Item 2: ' + line201 +
                                        '<li>Item 3: ' + line202 +
                                        '<li>Item 4: ' + lineTest +
                                        '<li>Item 5: ' + line10000 +
                                        '<li>Item 6: ' + line10021 +
                                        '<li>Item 7: ' + line10041 +    
                                        '</ul>'
                                );
                            }
                        }
                    }],
    
    
                    axes: [{
                        type: 'Numeric',
                        position: 'left',
                        fields: ['200_valueRelative', '201_valueRelative', '202_valueRelative', 'deceased_valueRelative', '10000_valueRelative', '10021_valueRelative', '10041_valueRelative'],
                        title: 'Relatieve',
                        grid: true,
                        minimum: -15,
                        maximum: 15,
                        majorTickSteps: 4
                    }, {
                        type: 'Category',
                        position: 'bottom',
                        fields: ['name']
                    }],
                    series: [{
                        type: 'column',
                        yField: ['200_valueRelative', '201_valueRelative', '202_valueRelative', 'deceased_valueRelative', '10000_valueRelative', '10021_valueRelative', '10041_valueRelative'],
                        xField: 'name',
                        title: ['current', 'average'],
                        axis: 'left',
                        highlight: true
                    }]
                }]
            }]
    });
    This is the mode:
    Code:
    Ext.regModel('OverviewModel', {    fields: [
            { name: 'id', type: 'int' },
            { name: 'name', type: 'string' },        
            { name: 'date', type: 'string' },
    
    
    
    
            { name: '10041_name', type: 'string' },
            { name: '10041_norm', type: 'int' },
            { name: '10041_valueAbsolute', type: 'int' },
            { name: '10041_valueRelative', type: 'int' },
            { name: '10041_empty', type: 'bool' },
            
    <snip>
            { name: '200_name', type: 'string' },
            { name: '200_norm', type: 'int' },
            { name: '200_valueAbsolute', type: 'int' },
            { name: '200_valueRelative', type: 'int' },
            { name: '200_empty', type: 'bool' },
            
        ]
    });
    It doesn't make any sense to me. I'm wondering if someone is able to help me out here. Thanks.

  2. take a look at this link. there is bug when there is one record

    http://www.sencha.com/forum/showthre...s-getCount()-1

  3. #2
    Sencha User
    Join Date
    Dec 2011
    Location
    Hyderabad, India
    Posts
    117
    Answers
    6
    Vote Rating
    5
    Naga is on a distinguished road

      0  

    Default


    take a look at this link. there is bug when there is one record

    http://www.sencha.com/forum/showthre...s-getCount()-1

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar