-
30 Apr 2012 5:26 PM #1
4.0.7 & 4.1 - Ext.chart.series.Bar renderer returns incorrect record when stacked
4.0.7 & 4.1 - Ext.chart.series.Bar renderer returns incorrect record when stacked
Looking at the code, drawSeries is looping through the items in the chart, and calling:
When using a stacked barchart, where 2 items are displayed per record, leaves 4 items in the chart and only 2 in the store.Code:me.renderer(sprite, store.getAt(i), barAttr, i, store)
Example:
Temporary fix:Code:var myStore = Ext.create('Ext.data.Store', { fields: ['name', 'a', 'b'], data : [ {'name': 'First', 'a':10, 'b':20}, {'name': 'Second', 'a':15, 'b':15} ] }); var chart = Ext.create('Ext.chart.Chart', { animate: true, style: 'background:#fff', shadow: true, width:193, height:200, renderTo: Ext.getBody(), store: myStore, axes: [{ type: 'Numeric', position: 'bottom', fields: ['a', 'b'] }, { type: 'Category', position: 'left', fields: ['name'] }], series: [{ type: 'bar', axis: 'bottom', xField: 'name', yField: ['a', 'b'], stacked: true, renderer: function(sprite, record, attr, index, store) { console.log(index); console.log(record); return Ext.apply(attr, {}); } }] });
andCode:rendererAttributes = me.renderer(sprite, items[i].storeItem, barAttr, i, store);
Code:rendererAttributes = me.renderer(sprite, items[i].storeItem, Ext.apply(barAttr, { hidden: false }), i, store);
-
1 May 2012 7:44 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
Thanks for the report.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
You found a bug! We've classified it as
EXTJSIV-6103
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote