Results 1 to 5 of 5

Thread: GXT : RadarChart in a form binded to a store

  1. #1
    Sencha User
    Join Date
    Dec 2007
    Location
    Aubagne, France
    Posts
    347

    Default GXT : RadarChart in a form binded to a store

    Hi,
    I made a form with 6 spinnerField.
    I have a RadarChart in my Form which represents the data od the 6 spinnerField.
    I'd like to update the chart when a spinnerField value is changed.

    For the moment I did an updateChart function like this :
    Code:
    void updateChart(){
    		ChartModel cm = new ChartModel("Profil", "font-size: 12px; text-align: left;");  
    		cm.setBackgroundColour("#f0f0f0");  
    		RadarAxis ra = new RadarAxis();  
    		ra.setMax(100);  
    		ra.setStroke(2);  
    		ra.setColour("#A1D4B5");  
    		ra.setGridColour("#C0DEBF");  
    		ra.setSpokeLabels("ATT", "TEC", "PUI", "DEF", "PHY", "VIT");  
    		cm.setRadarAxis(ra);  
    		AreaChart area = new AreaChart();  
    		area.setFillAlpha(0.3f);  
    		area.setColour("#ff9900");  
    		area.setFillColour("#ff6600");  
    		area.setLoop(true);  
    		System.out.println("updateChart");
    		System.out.println("ATT "+sfATT.getValue());
    		area.addValues(sfATT.getValue());  
    		area.addValues(sfTEC.getValue());  
    		area.addValues(sfPUI.getValue());  
    		area.addValues(sfDEF.getValue());  
    		area.addValues(sfPHY.getValue());  
    		area.addValues(sfVIT.getValue());
    		cm.addChartConfig(area);  
    		
    		chart.setChartModel(cm);
    		
    	}
    And I add for each spinnerField a listener to the Events.Change which calls the updateChart function.

    It works but I think it's not very elegant. In fact, the Events.Change for the spinnerField seems to be more the Blur event (the chart is updated when I "blur" from a spinnerField and if I use the spin arrows, the Change event is not fired.
    I'd like to bind the radarChart to the store which contains the record binded by the form.
    I saw I have to use something like the DataProvider but I'm not sure it can be use with radarChart.

    Any suggestions?

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    I dont think you want to update the chart everytime the spinnervalues changes.

    The chagne event fires onblur as on other fields too.

  3. #3
    Sencha User
    Join Date
    Dec 2007
    Location
    Aubagne, France
    Posts
    347

    Default

    I'm doubting it could be costful but it would be "real-time"-like and nice

    Ok for the change event, I keep it in mind.

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    set fireChangeEventonSetValue to true, spinning calls setvalue and so should update it asap. But i dont suggest to do it

  5. #5
    Sencha User
    Join Date
    Dec 2007
    Location
    Aubagne, France
    Posts
    347

    Default

    it works well!
    here is a screenshot of my form.
    Attached Images Attached Images

Similar Threads

  1. Replies: 4
    Last Post: 10 Mar 2010, 1:43 AM
  2. Avoid error loading a store binded with a destroyed grid.
    By plalx in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 26 Feb 2010, 9:02 AM
  3. [OPEN] [CLOSED] Form is validated immediately when binded
    By Jose Jeria in forum Ext GWT: Bugs (2.x)
    Replies: 4
    Last Post: 8 Sep 2009, 8:24 AM
  4. Advance form with more than one level that is binded
    By ran.davidovitz in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 7 May 2009, 11:28 PM
  5. reloeading DataStore that is binded to client side
    By groth in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 15 Oct 2008, 8:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •