1. #1
    Sencha User
    Join Date
    Feb 2014
    Posts
    8
    Vote Rating
    0
    svennergr is on a distinguished road

      0  

    Default Unanswered: Chart is not refreshing

    Unanswered: Chart is not refreshing


    Hey guys,

    I've got following structure with a chart in connection with a store:

    Code:
    store=Ext.create("Ext.data.Store", {
                data : [
                    {height: "1",    age: "1"},
                    {height: "2",    age: "2"},
                    {height: "3",    age: "3"},
                ]
            });
    Code:
    chart = Ext.create("Ext.chart.CartesianChart", {
                            fullscreen: true,
                            store: store,
                            animate: false,
                            interactions: ['panzoom'],
                            listeners:{
                                painted: function(element, eOpts){
                                    console.log("painted");
                                },
                                updatedata: function( chart, newData, eOpts ){
                                    console.log("update");
                                },
                                beforerefresh: function( chart, eOpts ){
                                    console.log("beforerefresh");
                                }
                                ,
                                refresh: function( chart, eOpts ){
                                    console.log("refresh");
                                }
                            },
                            series: [
                                {
                                    type: 'line',
                                    xField: 'age',
                                    yField: 'height',
                                    style: {
                                        fill: 'rgba(0,40,170,0.3)',
                                        stroke: 'black'
                                    }
                                }
                            ],
                            axes: [
                                {
                                    type: 'numeric',
                                    position: 'left',
                                    title: 'height',
                                    grid: true,
                                    grid: {
                                        fill: '#efefef',
                                        odd: {
                                            fill: '#cdcdcd'
                                        },
                                        even: {
                                            lineWidth: 3
                                        }
                                    }
                                },
                                {
                                    type: 'category',
                                    position: 'bottom',
                                    title: 'age',
                                    grid: true,
                                    style: {
                                        estStepSize: 1
                                    }
                                }
                            ]
                        });
    When I try to add some data to the store, the chart does not refresh. It doesnt even fires events, which I indicated with the listeners.

    What do I have to do, to refresh the chart when adding data?

    My code for adding data:
    Code:
    store.add({height: "4",    age: "4"});
    or
    Code:
    store.addData({height: "4",    age: "4"});

  2. #2
    Sencha User
    Join Date
    Feb 2014
    Posts
    8
    Vote Rating
    0
    svennergr is on a distinguished road

      0  

    Default


    Btw.

    Chart.redraw() does Not work either

  3. #3
    Sencha User
    Join Date
    Sep 2013
    Posts
    14
    Answers
    1
    Vote Rating
    1
    Tieis is on a distinguished road

      0  

    Default


    I remember having more luck with Chart.performLayout(); I don't know the exact difference though without looking at the internal code

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