X-Axis, skip missing data (dates)

May 8, 2012 at 12:53 PM

Hi,

Like many others here, I'm kinda new with D3. As a personnal project, I'm trying to build myself a stock charting / portfolio management software. For the "charting" part of it, I've decided to use D3 (based on the great work of Felice Pollano and his blog -> http://www.felicepollano.com/CategoryView.aspx?category=Charting).

 

It's working great but I have one small problem: Since stock markets are closed on weekends and holidays, those days are not in the data retrieved (witch is ok), but they are still displayed on the X-axis, which creates gaps in the chart.

 

Example: I have four dates in my data -> may 3, may 4, may 7, may 8

On the chart's x-axis you will have -> may 3, may 4, may 5, may 6, may 7, may 8

So since on may 5 and 6 I have no data, there's a blank diplayed.

 

So the question: is there a way to display only dates on the X-Axis where I actually have data for? Or at least a hint of where I should check in the source code.

 

Thanks, Guillaume.

Oct 30, 2012 at 1:48 PM

Hey Gui, I'm developing a very similar application, and was wondering if you managed to figure this out? If so, it would be highly appreciated if you could post the solution here! Likewise, if I come up with an answer in the coming days, I will post it. Thanks!

Nov 8, 2012 at 1:48 PM

Hey Gui. I came up with a solution that might help you. I posted my answer here :

http://stackoverflow.com/questions/12937164/dynamic-data-display-scattered-datetime-axis

Dec 18, 2012 at 7:14 PM

Hey pol315, since i still cannot comment @ stackoverflow i ask here:

How is the Method GetResourceFromPool(); implemented ?