1. #21
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Vote Rating
    0
    skylinezpromise is on a distinguished road

      0  

    Default please

    Quote Originally Posted by t0ad999 View Post
    I was able to solve this by creating a new chart within the store and having it renderTo the object id I wanted the chart to draw into.

    example code to follow.
    could you please POST YOUR CODE?

    thanks!

  2. #22
    Sencha User
    Join Date
    Mar 2011
    Posts
    2
    Vote Rating
    0
    ayeah is on a distinguished road

      0  

    Default

    try this step by step:
    chart.surface.removeAll();
    chart.series.removeAll();
    chart.series.addAll(NewSeries);
    chart.redraw();
    chart.refresh();
    Last edited by ayeah; 9 Feb 2014 at 12:56 AM. Reason: style

  3. #23
    Sencha User
    Join Date
    Jan 2015
    Location
    India
    Posts
    1
    Vote Rating
    0
    NavinPratap is on a distinguished road

      0  

    Default Cartesian Chart with Line Series --- Blinking

    I am using Extjs 5.0.0 Cartesian Chart and series type line. Chart not showing properly. Chart series always blinking line.


    UI :
    xtype: 'cartesian',
    height: 300,
    id: 'MyLineChart',
    itemId: 'MyLineChart',
    store: 'GraphStore',
    axes: [
    {
    type: 'numeric',
    grid: true,
    position: 'left'
    },
    {
    type: 'time',
    fields: [
    'T'
    ],
    dateFormat: 'D',
    position: 'bottom'
    }
    ]

    Controller :--- Hit every Second

    var Image2 =Ext.ComponentQuery.query('#MyLineChart')[0];
    var flds = [];
    flds.push({name: 'T',type:'date',dateFormat: 'D'});
    flds.push({name:'tst'});
    var Image2array=[];
    Image2array = [{'T':'6Jan 16:24:06','tst': 10},{'T':'6Jan 16:24:06','tst': 10}]
    var serie = {
    type: 'line',
    xField: 'T',
    yField: 'tst',
    title: img1ar[chk],
    showInLegend: true,
    marker: {
    radius: 3
    },
    style: {
    lineWidth: 2,
    majorTickSize: 0,
    stroke: '#'+colorCode
    },
    smooth: 0
    };
    var series = [];
    series.push(serie);

    Image2.setSeries(series);
    var store = Ext.getStore('GraphStore');
    store.setFields(flds);
    store.loadData(Image2array);

  4. #24
    Sencha User
    Join Date
    Mar 2015
    Location
    Belgrade
    Posts
    2
    Vote Rating
    0
    dknezevic is on a distinguished road

      0  

    Default

    Thank you very much. I registered just to say thanks, i've been having this problem for some time now.

    This works with ExtJS 4.2.1.

    Quote Originally Posted by meditecsports View Post
    Hello.
    I have found this solution: at first we delete all old series :
    Code:
    var removeChart = function() {
    
            var series = this.chart.series.items,
                surface = this.chart.surface,
                length = series.length,
                len = surface.groups.keys.length,
                array = [],
                i = 0,
                j = 0,
                t = 0;
    
            for(; i < length; i++) {
                array = Ext.Array.merge(array, series[i].group.keys);
            }
            this.chart.series.clear();
            for(; j < array.length; j++) {
                surface.items.getByKey(array[j]).destroy();
            }
            for(; t < len; t++) {
                surface.groups.items[t].destroy();
            }
        },
    Then we simply add new series like :
    Code:
    chart.series.add({
                type: 'column',
                axis: 'left',
                gutter: 30,
                groupGutter: 3,
                title: ['1', '2', '3'],
                xField: ['count'],
                yField: ['name1', 'name2', 'name3']
            });
    I use this code when dynamically change chart series from type: 'line' to type: 'column'.