Hello, thanks for the fantastic module!

I have data in the following format:

Title Value Date
Apples 1 2010-07-07T00:00:00
Apples 2 2010-07-08T00:00:00
Apples 4 2010-07-09T00:00:00
Apples 3 2010-07-10T00:00:00
Oranges 3 2010-07-07T00:00:00
Oranges 7 2010-07-08T00:00:00
Oranges 5 2010-07-09T00:00:00
Oranges 6 2010-07-10T00:00:00

At the moment GVS plots all this data as a single unbroken line (whether using the "line" or "annotated time line" type). I wish to be able to plot this as two (or more) lines - one for each different "title" (or other field).

Please let me know if you need further info.

Comments

btomic’s picture

Hi
The problem is that your data not prepared well. You have to reorganize data like

Date Apples Oranges
2010-07-07 1 3
2010-07-08 2 7
2010-07-09 4 5
2010-07-10 3 6

More information about preparing data-sets you can find on. After that select Date field in Date drop-box and apples and oranges in value boxes.
http://code.google.com/apis/visualization/documentation/gallery.html

I hope my answer will help

danieldd’s picture

Thanks.

I realise that the module does not currently work with data in this format. But for various reasons I am unable to structure the data as you suggest in my database (like much transactional data, it is not really possible to structure it differently).

The feature request was to ask whether the module could include functionality to transform this data from the format I mention above into the format you describe, such that it can be charted. Adding this functionality myself is probably beyond my ability.

Hope you can help, and thanks again.

btomic’s picture

Generally, at the moment, it is quite difficult to reorganize data (using view2) but they have done large improvements in views3 (still in development). There is possibility to override default views2 query with custom one, but this is too complex. In that kind of situation I, personally, use database SQL stored procedure which generate pivot table for charts from raw tables. I think, that tool for elegant manipulate with data in Drupal doesn't exist.

btomic’s picture

Status: Active » Closed (fixed)
patcon’s picture

Check out the Views Hacks module -- it has a submodule for flipping axes :)

danieldd’s picture

Thanks - appreciate the pointer! We implemented a custom solution for this particular view in the end, but the need to flip views is a recurring one for me, so will definitely check this out.