PDA

View Full Version : [OPEN] Chart sort order inconsistent with Grid sort order



mlang38
21 Oct 2013, 6:36 AM
Ext version tested:

Ext 4.2.1 rev 883

Browser versions tested against:


FF24 (firebug 1.12.4 installed)

Description:

When a Chart (bar serie / category axis tested) and a Grid Panel are bound to the same Store, they're sorted in reverse order

Steps to reproduce the problem:

Fiddle 135 (https://fiddle.sencha.com/fiddle/135)
Click on Grid's columns' headers to sort the store

The result that was expected:

the Grid and the Chart should be sort the same way

The result that occurs instead:

it is sorted the opposite way

Proposal:


Have a config param somewhere to switch chart/serie/axis sort order

Gary Schlosberg
21 Oct 2013, 8:51 AM
Thanks for the report! I can see why it displays currently, since graphs often start from where the axes meet, as the X axis does in your fiddle. I have therefore opened a feature request in our bug tracker. In the meantime, I suppose you can reverse the sort on your data to achieve the outcome you need.

mlang38
23 Oct 2013, 12:28 AM
In the meantime, I suppose you can reverse the sort on your data to achieve the outcome you need.

I'm not sure of what you mean. If I sort the Store differently, the outcome is still the same : the Grid and the Chart display data in the opposite sort order.

For example, if the Store is sorted with {property:'name',direction:'ASC'}, the Grid shows :

metric five 27
metric four 2
metric one 10
metric three 5
metric two 7

Whereas the Chart shows :

metric two 7
metric three 5
metric one 10
metric four 2
metric five 27

The only workaround I see by now is to use two different Stores and sync them in any manner (bind sec store to the load event of the first one), but I'm a noob so perhaps I don't see the whole picture :)