Emmanuelle Raffenne created ZEPPELIN-87:
-------------------------------------------
Summary: Data order altered in bar chart
Key: ZEPPELIN-87
URL: https://issues.apache.org/jira/browse/ZEPPELIN-87
Project: Zeppelin
Issue Type: Bug
Components: GUI
Affects Versions: 0.5.0
Reporter: Emmanuelle Raffenne
This has been described in https://github.com/NFLabs/zeppelin/issues/334
The order is altered after calling pivot() on the data
(zeppelin-web/app/scripts/controllers/paragraph.js). This is due to the JSON
structure of the pivot-ed data ({schema: ...., rows: }) where values are used
as field names of the rows object.
According to EMACScript standard, an object is an unordered collection of
key-value pairs and the mechanics and order of enumerating the properties is
not specified. Actually, it looks like numeric field names are placed first but
anyhow, the order is not guaranteed.
We have implemented a fix that changes the structure of the object returned by
the pivot() function, where the "rows" property now contains an array instead
of an object.The pivotDataToD3ChartFormat() function has been adapted
accordingly.
See changes at
https://github.com/apache/incubator-zeppelin/compare/master...keedio:feature/x-axis-orderby
We can generate a PR if you agree with the fix.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)