-
18 Aug 2011 3:10 AM #1
Unanswered: How to dynamically assign a store to a Ext.chart.Panel?
Unanswered: How to dynamically assign a store to a Ext.chart.Panel?
Hello
i want to show a chart based on parameter passed from another panel; how can i bind dynamically a store instead of assigning it during the declaration of the Ext.chart.Panel, how can i do it programmatically?
Thanks in advance and greetings
c.
-
18 Aug 2011 9:26 AM #2
Hi - If you have a handle to the Ext.chart.Panel instance (say in a chartPanel variable), then you can access the chart and bind the store like this:
I hope this helps,Code:var chart = chartPanel.items.get(0); chart.bindStore(newStore);
-
18 Aug 2011 9:31 AM #3
-
26 Sep 2011 5:51 AM #4
Let's say this is my datastore
How can I use this?Code:teststore = new Ext.data.Store({ model: 'testdata', data : [ {soort: 'Niezen', waarde: 4, waarde1: 8, gem: 6}, {soort: 'Hoesten', waarde: 6, waarde1: 4, gem: 5}, {soort: 'Longaandoening', waarde: 7, waarde1: 9, gem: 8}, {soort: 'Kreupel', waarde: 5, waarde1: 2, gem: 3.5}, {soort: 'Vlekken', waarde: 5, waarde1: 9, gem: 7}, ] }); var chart = chartPanel.items.get(0); chart.bindStore(testdata);
Lets say I want the values of "waarde1" ..
-
10 Oct 2011 3:35 PM #5
or...
or...
Ext.regModel('MyModel', {
fields: [{ name: 'FieldA' },
{ name: 'FieldB' },
{ name: 'FieldC' },
{ name: 'FieldD'}]
});
this.store = new Ext.data.JsonStore({
scope: this,
model: 'MyModel',
sorters: [
{
property: 'FieldA',
direction: 'ASC'
}
],
proxy: {
type: 'ajax',
actionMethods: 'POST',
url: app_relative_url + 'StoreUrl',
reader: {
type: 'json',
root: 'List'
}
},
listeners: {
load: { fn: this.initializeData, scope: this },
beforeload: { fn: this.beforeloadData, scope: this }
}
});
this.graphic = new Ext.chart.Panel({
items: [{
xtype: 'chart',
cls: 'barcombo1',
theme: 'Demo',
store: this.store,
...
-
20 Mar 2012 11:28 AM #6
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote