goh
goh

Reputation: 29511

extjs - how to define jsonstore for dynamic series in charts?

I want to add in series dynamically into my chart. For instance, I have a grid of unknown number of products. When clicked on the particular row, the sales statistics of that product is added to the chart. Therefore, there may be multiple lines on chart.

The question is, how do I define the fields of the jsonstore for the yfield of the series which I do not know beforehand?

Upvotes: 2

Views: 2974

Answers (2)

Antonio Valle
Antonio Valle

Reputation: 46

if you still looking for the answer, you can go to this link Dynamically generate axis and series in Extjs 4 I answered about it

Upvotes: 0

Benjamin
Benjamin

Reputation: 11

I stumbled across the same problem. I searched the official forum for a bit, and this seems to be the official way:

You define an new store with all the fields, and then you use the bindstore method:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.chart.Chart-method-bindStore

Don't forget to define the appropriate series (setSeries-method) and then reload to store to redraw the chart.

Upvotes: 1

Related Questions