-
25 Jun 2012 2:19 AM #1
[4.1] scatter chart: zIndex is not taken in consideration during interaction
[4.1] scatter chart: zIndex is not taken in consideration during interaction
isItemInPoint overrided to deal with another issue.Code:var store = Ext.create('Ext.data.JsonStore', { fields: ['name', 'data1', 'data2', 'data3', 'data4', 'data5'], data: [ { 'name': 'metric one', 'data1':5, 'data2':5, 'data3':20, 'data4':8, 'data5':13 }, { 'name': 'metric two', 'data1':5, 'data2':4.5, 'data3':30, 'data4':10, 'data5':3 }, { 'name': 'metric three', 'data1':1, 'data2':1, 'data3':2, 'data4':12, 'data5':7 }, { 'name': 'metric four', 'data1':10, 'data2':10, 'data3':2, 'data4':12, 'data5':7 } ] }); Ext.create('Ext.chart.Chart', { renderTo: Ext.getBody(), width: 500, height: 350, animate: true, store: store, theme: 'Base:gradients', series: [{ type: 'scatter', xField: 'data1', yField: 'data2', highlight: true, renderer: function (sprite, record, attr, index, store) { return Ext.apply(attr, { radius: record.get('data3') }); }, isItemInPoint: function(x, y, item) { var point, tolerance = item.sprite.attr.radius, abs = Math.abs; function dist(point) { var dx = abs(point[0] - x), dy = abs(point[1] - y); return Math.sqrt(dx * dx + dy * dy); } point = item.point; return dist(point)<= tolerance; } }] });
So there are two large bubbles in the center of the chart.
And when I move mouse cursor above intersection of the bubbles than lower one is highlighted. The same is about listeners. So as for me it is because series.Series.getItemForPoint method looks for first item for given coordinates. And if there are several such items(with different zIndex or even with same zIndex) it will lead to abnormal reaction.
-
27 Jun 2012 7:00 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,085
- Vote Rating
- 453
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-6668
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote