sencha touch 2 - ST2.1 vs ST2.2 chart sprite style renderer -
with st2.1, had scatter graph renderer function changing sprite rotation , color based on values in store. working well. upgraded st2.2.0 , i'm having trouble rebuilding same function.
code st2.1 - working.
series: [ { type: 'scatter', xfield: 'local_date_time', yfield: 'wind_spd_kt', marker: { ... }, style: { renderer: function (target, sprite, index, storeitem) { var sweather = ext.getstore('sun'); if (index < sweather.getcount() ){ target.rotationrads = storeitem.data.sun_dir; if (storeitem.data.sun_spd_kt < 10) { target.fill = '#ff0000'; //red //console.log ( index + ' : <10 :' + storeitem.data.sun_spd_kt ) } else { target.fill = '#00ee00'; } //green } } },
code in st2.2.0 tried:
style: { renderer: function (sprite, config, rendererdata, index) { sprite.rotationrads = rendererdata.store.data.all[index].raw.sun_dir sprite.attr.fillstyle = '#ff0000' } }
has used "renderer" in st2.2.0?
i made solution problem. try following ?
renderer: function (sprite, config, rendererdata, index) { if (index % 2 == 0) { return { strokestyle: 'red' }; } }
Comments
Post a Comment