I have a data set in quarters. here is the array:
var dataGDP = [
{date: "Q1-2008", GDPreal: "2.8"},
{date: "Q2-2008", GDPreal: "0.6"},
{date: "Q3-2008", GDPreal: "-2.1"},
{date: "Q4-2008", GDPreal: "-4.3"},
{date: "Q1-2009", GDPreal: "-6.8"},
{date: "Q2-2009", GDPreal: "-6.3"},
{date: "Q3-2009", GDPreal: "-5"}
];
How can I get these dates on my X axis, like 1st quarter of 2008, 2nd quarter of 2008, 3rd quarter of 2008? my X axis uses a time-based scale. I'm not sure there is a way to parse these dates as they now use d3.time.format. However, I can parse them if I use the months instead of 01/2008, 04/2008 ... using: parseDate = d3.time.format ("% m /% Y"). Parse;
Should I write my dates in the array as months and then write a function to convert months to quarters? or is there a way to store Q1..ect in an array, as it is now, and parse the dates?