1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    3
    Vote Rating
    0
    Cody Anderson is on a distinguished road

      0  

    Default Unanswered: Chart' won't update when database is changed

    Unanswered: Chart' won't update when database is changed


    So I have 4 charts that pull data from a database, for three of them if I change something in the database it will update the charts if I refresh the page however one of the charts and I cant figure out why requires me to reset the server before it updates the data. I dont know where this error is coming from so I am posting the code related to the chart that isn't working. I have compared this code with the other charts and can't see any visible differences. If there is something else that could cause the problem I appreciate any suggestions
    Thanks.

    This is my Store code
    Code:
    Ext.define('Agile_GoLink.store.MinMaxAvg', {    extend: 'Ext.data.Store',
        
        constructor: function(cfg) {
            var me = this;
            
            cfg = cfg || {};
            me.callParent([Ext.apply({    
            	autoLoad: true,
                storeId: 'MinMaxAvg',
                sortRoot: 'dayValue',
                proxy: {
                    type: 'ajax',
                    url: 'minmaxavg.jsp',
                    reader: {
                        type: 'json',
                        root: 'results'
                    }
                },
                fields: [
                    {
                        name: 'dayValue',
                        sortType: 'asUCString',
                        type: 'Category',
                        dateFormat: ('n-j-Y')
                    },
                    {
                        name: 'minValue',
                        type: 'int'
                    },
                    {
                        name: 'maxValue',
                        type: 'int',
                    },
                    {
                        name: 'avgValue',
                        type: 'int'
                    }
                ],
                listeners: {
                    load: {
                        fn: me.onLoad,
                        scope: me
                    }
                }
            }, cfg)]);
        },
        
    
    
        	
        onLoad: function(store, records, successful, operation, options) {
            if (!successful) {
                if (store) {
                    var proxy = store.getProxy();
                    if (proxy) {
                        var reader = proxy.getReader();
                        if (reader && reader.rawData && reader.rawData.message) {
                            Ext.Msg.alert("Error", reader.rawData.message);
                            return;
                        }
                    }
                }
    
    
                Ext.Msg.alert("Error", "Could not get the Mix Max Average data");
            }
    
    
        }
    
    
    });
    here is the view code
    Code:
    Ext.define('Agile_GoLink.view.ProcesTime', {    extend: 'Ext.panel.Panel',
        alias: 'widget.ProcesTime',
      
        height: 260,
        width: 330,
        layout: {
            type: 'fit'
        },
        title: 'DTR Processing Time Past 30 Days',
    
    
        initComponent: function() {
            var me = this;
            
            Ext.applyIf(me, {
                items: [
                    {
                        xtype: 'chart',
                        height: 274,
                        id: 'chtProcTime',
                        width: 349,
                        stateful: false,
                        shadow: false,
                        animate: true,
                        insetPadding: 20,
                        store: 'MinMaxAvg',
                        theme: 'Purple', 
                        
                        axes: [
                            {
                                type: 'Category',
                                fields: [
                                    'dayValue'
                                ],
                                label: {
                                	renderer : Ext.util.Format.dateRenderer('n/j/Y'),
                                },
                                position: 'left',
                                title: 'Date',
                                dateFormat: 'n/j/Y'
                            },
                            {
                                type: 'Numeric',
                                fields: [
                                    'minValue',
                                    'avgValue',
                                    'maxValue'
                                ],
                                majorTickSteps: 1,
                                position: 'bottom',
                                title: 'Min Max Avg Proc Time (min)',
                                adjustMaximumByMajorUnit: true,
                                decimals: 1,
                                minimum: 0
                            }
                        ],
                        series: [
                            {
                                type: 'bar',
                                highlight: false,
                                label: {
                                    display: 'outside',
                                    field: 'maxValue',
                                    color: '#333',
                                    'text-anchor': 'middle'
                                },
                                axis: 'bottom',
                                xField: 'dayValue',
                                yField: [
                                    'minValue',
                                    'avgValue',
                                    'maxValue'
                                ],
                                stacked: false
                            }
                        ],
                        legend: {
                            position: 'float',
                            	x:-19,
                            	y:160
                        }
                        
                    }
                    
                ]
            
            });
            
    
    
            me.callParent(arguments);
        }
    
    
    });

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,770
    Answers
    355
    Vote Rating
    165
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    Can you load data manually?
    *see the Reload Data in this example.

    If so, then I suspect the issue is not in the Ext chart, but may instead be on how the server is delivering the data down to the store used by the chart.

Thread Participants: 1

Tags for this Thread

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