简体   繁体   中英

Extjs chart : set fields dynamically

Is it possible to setFields to a chart axes ?

I searched the docs for a setFields method but I found none.

I manage to setTitle to an axes but not the field. So I have a period variable that holds that field and that changes dynamically on every store update, I tried :

chart.axes.get('bottom').Fields = period;

It doesn't give any errors but doesn't work...

解决了:

chart.axes.get('bottom').fields = [period];

It would be helpful to get a running example.

Anyway.. ExtJS has a configuration based object creation. It means that when you see something like this:

 axes: [{
    type: 'Numeric',
    position: 'left',
    fields: ['data1', 'data2', 'data3', 'data4', 'data5'],
    ...

The fields attribute is actually a property of Ext.chart.axis.Numeric class

I would suggest to use the developer tool and inspect the object - you'll learn a lot from that. And use the API docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM