1. #1
    Sencha User
    Join Date
    Apr 2011
    Location
    Munich
    Posts
    7
    Vote Rating
    0
    Moes is on a distinguished road

      0  

    Default Charts: auto-scaling the negative axis AND filter performance

    Charts: auto-scaling the negative axis AND filter performance


    Good morning,

    I have another little problem concerning charts. The workflow is as follows:

    I get an array of JSON objects (12 properties) from a controller. Each object has a property called "productLine" with one value. According to the productLine value I have to filter the data in the store and create the chart for ONE productLine. Below the charts are buttons for each productLine (8) to switch the chart to another productLine. What I do is, that I attach a handler to each button that does the following:

    Code:
    productLineSwitch : function(pl){
       salesGrowthGlobalStore.clearFilter();
       salesGrowthGlobalStore.filter('productLine',pl);
    }
    The first thing is, that the filtering of the Objects takes around 2sec for 109 JSON objects. Is this a usual time? I mean, it's not that huge amount of data I need to filter. Do I do anything that pulls the performance down?

    The other thing is, that the axis for the negative values doesn't scale, if I filter the store. Let's say I switch from one productLine to another. The minumim value changes from -7.5 to -4.6 and I expect the y-axis should scale from -10 to -6, shouldn't it? The axis for the positive values scales correctly, it's only the negative values that don't. So, I wonder why.

    Has anyone any idea, either on the filter performance or the auto-scaling of the axis?

    Thank you very much!
    Andreas

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Location
    Munich
    Posts
    7
    Vote Rating
    0
    Moes is on a distinguished road

      0  

    Default


    Okay, I fixed the performance issue by building one global store, which holds every data, and one separat store for each chart, that is loaded with an array I create manually.

    Something like this:
    Code:
    var a = [];
    sourceStore.each(function(item,idx){					
            if (item.data.productLine == pl)
    	        a.push(item);
    	});
    	targetStore.loadData(a);
    });
    But still the problem with the axis.

    Andreas

Similar Threads

  1. Replies: 4
    Last Post: 30 Mar 2011, 7:51 AM
  2. Ext JS Charts: Second Y Axis Scale
    By AMACK in forum Ext 3.x: Help & Discussion
    Replies: 20
    Last Post: 20 Jan 2011, 6:07 AM
  3. Charts - StackedColumnChart negative values
    By catapult in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 19 Aug 2010, 3:15 AM
  4. Charts - changing axis origin.
    By shroom in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 23 Sep 2009, 1:54 AM
  5. Ext.Charts -> Axis-Label
    By tobiu in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 8 Jun 2009, 3:06 PM