charts - Color of column in columnchart based on values from store in extJS 3.4 -
i have jsonstore
var rankingstore = new ext.data.jsonstore({ url: './get-ranking-stats.php', root: 'item', fields: ['name', 'click', 'foto','pdf', 'gid', 'type'], baseparams: {end: gettoday(), start: getoneweekbefore(), typ: 'all'}, autoload: true })
and column chart based on it:
var statis2 = new ext.panel({ title: 'ranking', width: '60%', height: 500, items: { xtype: 'columnchart', store: rankingstore, xfield: 'name', id: 'mainchart2', yfield: 'click', extrastyle: { xaxis: { labelrotation: -90 } }, series: [{ type: 'column', displayname: 'click counter', yfield: 'click', style: { mode: 'stretch', color:0x99bbe8 } }] } });
all coulms have same colour. want heve different colours based on 'type' value jsonstore. how create rule that?
user before render event of chart after u add own custom color in chart.
beforerender: function(chart, record, index, series){ if(record.data.type=="somthing"){ // add own custom css } },
Comments
Post a Comment