Pie Chart woes

I'm currently trying to add a Pie chart into a reporting page.
The report is doing a record type query and simply pulling back 

Id
Items

The issue is my Items are an array

The DB table looks like 


1 Widget

2 Widget / Whatsit

3 Whatsit / Dohicky


i would like my pie to show a slice for each item, but at the moment I'm getting a slice per item (so 3 in total)
How can i split the data so i have a slice for widgets (2 items), a slice for whatsits (2 items)and one for dohicky (i item)

  Discussion posts and replies are publicly visible

Parents
  • My first instinct is that your underlying data model is incorrect. If the outcome you want to display a pie which has Widget (2), Whatsit (2) and Dohicky (1) then your database table should have two Widget rows, 2 Whatsit rows and 1 Dohicky row.

    If you have no control over the data model then you'll need to manipulate/coerce the data that is returned so that it meets your needs.

  • Hi Stewart,
    The above was an example. the se case is that in another part of the site, a user can select multiple items of many different types. 
    Effectively each row in the DB is an order for multiple items. The list of items per order are stored in an array and written out to the db in a single column.

    I am trying to show in reporting how many of each type is ordered. It would not be very efficient to have a table with a column for each item. (which may change as we add / decrease the items)

Reply
  • Hi Stewart,
    The above was an example. the se case is that in another part of the site, a user can select multiple items of many different types. 
    Effectively each row in the DB is an order for multiple items. The list of items per order are stored in an array and written out to the db in a single column.

    I am trying to show in reporting how many of each type is ordered. It would not be very efficient to have a table with a column for each item. (which may change as we add / decrease the items)

Children