tmaslen / jseasycharts

Automatically exported from code.google.com/p/jseasycharts
0 stars 0 forks source link

Multi tracked data doesn't seem to be right #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
if we have the same multi-tracked data from different data sources, then
the result is different.

See multi-tracked manual tests for vertical bar charts

Original issue reported on code.google.com by tom.mas...@bbc.co.uk on 8 Oct 2009 at 8:33

GoogleCodeExporter commented 9 years ago

Original comment by tom.mas...@bbc.co.uk on 13 Oct 2009 at 8:40

GoogleCodeExporter commented 9 years ago
It isn't the multi-tracked data that is the issue.  The issue is to do with how 
the
label data is collected from multi-tracked data sources (JSON and table).

Tracks of data are not displayed together grouped.  Grouping works based on 
order. 
So, all the first values of each track are grouped together, then all the second
values of each track are put together and so on.

Here is a table (A)...

JAN FEB MAR
 10  20  30
 40  50  60
 70  80  90

This is grouped and labeled like so...
JAN       FEB       MAR
10 40 70, 20 50 80, 30 60 90

However, this table (B)...

JAN 10  20  30
FEB 40  50  60
MAR 70  80  90

Is grouped and labelled like this...

JAN       FEB       MAR
10 20 30, 40 50 60, 70 80 90

When it comes to a JSON object like this:

{
    january: {
        "Tom": 10,
        "Jake": 20,
        "Michael": 30
    },
    february: {
        "Tom": 40,
        "Jake": 50,
        "Michael": 60
    },
    march: {
        "Tom": 70,
        "Jake": 80,
        "Michael": 90
    }
}

This data is outputted the same way as table (A), with the values 10, 40 and 70 
under
the label January.

But the way the data is structured, the month name values are appearing as row
headers, not column headers so in fact the data should be displayed like table 
(B),
with the values 10, 20 and 30.

This is because the with a multi-tracked JSON object, the labels are taken from 
the
first layer in the JSON object, this is incorrect.

At the moment I'm not going to fix this, because I think this could become very
complex.  I'm thinking about changing how tables are rendered as data sources 
so I
will probably come back to this problem once that has been done.

Original comment by tom.mas...@bbc.co.uk on 15 Oct 2009 at 7:56