PDA

View Full Version : Stacked Bar Chart with dynamic model



tina@user
1 Oct 2015, 4:58 AM
Hi,

I have to create a Stacked Bar Chart with variable no. of data.

a bit like:-
http://docs.sencha.com/extjs/4.1.3/extjs-build/examples/charts/StackedBar.html

But the stacked data in my case is not certain.ie, there can n no.of genres in a particular year and sometimes none at all.

How can i create a model where the no.of fields are variable??


The data will come from server including the no.of genres in a year.


Please Help!

slemmon
7 Oct 2015, 11:56 AM
You can pass a list of fields in the metadata of a JSON response (see the Response Metadata section of the class description here (http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.data.reader.Json)).

The fields config of the series is not settable at runtime. If the fields received in the metadata are different than what you have in the existing chart you'll need to destroy / create the chart with the fields from the response.