PDA

View Full Version : Possible to change chart yField on the fly



MegaDave1
25 Jun 2009, 10:33 AM
I have a linechart based on a store like this.

{period: 1, sales1: 100, sales2: 50},
{period: 2, sales1: 200, sales2: 25},
{period: 3, sales1: 300, sales2: 10}

What I'd like to do is change the yField from sales1 to sales2 on a click event. Is this possible? Do I have to use a different store for each set of data?

I tried but it had no effect on the chart.

avgon
26 Apr 2010, 5:30 AM
i have some problem...
any solution?

wickedsheep
23 Jun 2010, 2:50 AM
Bump.

Is it possible?

wickedsheep
23 Jun 2010, 2:55 AM
Nevermind, found the solution.



var c = Ext.getCmp( 'your_chart_id' );
c.setYField( 'field_name' );

// WARNING: setYField is an undocumented function, so be careful.