Charts with many levels of categorization

30 views
Skip to first unread message

oumerisha

unread,
May 25, 2015, 10:27:00 PM5/25/15
to d3...@googlegroups.com
Hi guys,

Just started using D3, and very excited about it after seeing all the wonderful data visualizations that it can do. 

But I am a bit stuck on this data that I am working on at the moment. 

The file I am working on is structured into something like this (in excel):


where you have the years, divided by quarters, and there are several telecom operators, and for each operator there are several parameters to compare such as the number of subscribers (which can be further divided into 2G, 3G, 4G subscribers, etc...). Now I want to plot different charts addressing the different parameters.

So I started with a simple way of processing this, to tackle one thing at a time, so  I copied only the subscription part into another table, which looks something like


I have attached the csv file for this. (just_subscriptions.csv)

And I have several plots that I want to make, for example:


(where the different colors correspond to the different operators, etc...)

And later on I want to add interactions like selecting year ranges, showing yearly summaries rather than quarters, comparing quarter to quarter, showing only a selection of the data (E.g. only totals, or just 2G and 3G subscribers, etc)... but I want to start with the simplest one that I have depicted in the picture above.

to simplify things to get me started, I started dealing with a file like this:

http://imgur.com/YfrFeB4 (also attached the file, subscriptions_totals_only.csv)

and want to end up like a graph like this:


but I am a bit lost on how to structure the data etc. All the D3 examples that i have come across so far dealt with simpler data (only one header, no sub categorizations,at the header or row level, etc). So can anyone guide me a bit on how to get started with this? Do I have to split the data into several flat tables to get started or is it straightforward to handle a table like mine in D3? Any similar examples to get inspired will be really appreciated

Thanks in advance!
O.









just_subscription.csv
subscription_totals_only.csv

oumerisha

unread,
May 26, 2015, 2:37:33 AM5/26/15
to d3...@googlegroups.com
After some experimenting, it seems I would rather have the table in this format (see file attached).

This way, I think it will be easier to get it captured by d3.csv properly.

Now I have to learn how to categorize on two fields at once (the year and quarter together).
sample_operator_data_flat.csv

Curran

unread,
May 27, 2015, 9:07:18 PM5/27/15
to d3...@googlegroups.com
Hello,

Perhaps D3.nest is what you need in order to get this working. You can generate one big table like you have (that is something like a star schema fact table), then use D3.nest to split it up after it is loaded. Here are some D3.nest examples, and here's a nice article on grouping data. Nest can be used in conjunction with stack layout. Here's an example that uses nest and stack together - Stacked Area via Nest.

Best regards,
Curran
Reply all
Reply to author
Forward
0 new messages