line chart with gap ?

261 views
Skip to first unread message

dms

unread,
May 22, 2013, 9:23:44 PM5/22/13
to d3...@googlegroups.com
I have a web service that retrieves me data to draw a line chart; Basically, it retrieves me position and value.
The "problem" here is that I do have gaps between my positions (i.e. I have a lot of positions where the value is 0). For those positions without a value <= 0 assigned, I just don't send to d3 for performance  issues (I am working with huge amount of data and multiple charts).

Given that, how should I deal with gaps on line charts ? (I don't want my line chart to create an inexistent  line/conection between my line chart/data.

Any help ? insight ?

Thank you for your time.

Chris Viau

unread,
May 22, 2013, 11:30:51 PM5/22/13
to d3...@googlegroups.com
Here is an example of line/area chart with gaps: http://bl.ocks.org/mbostock/3035090
Chris


--
You received this message because you are subscribed to the Google Groups "d3-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

dms

unread,
May 23, 2013, 12:45:05 PM5/23/13
to d3...@googlegroups.com
Thank you Chris !

Sometime ago I'd seen this example, but trying to find it again yesterday wasn't easy !
Thank you very much for your time.

I do appreciate.

Cheers.,

dms

unread,
May 23, 2013, 12:47:04 PM5/23/13
to d3...@googlegroups.com
That's the line that does all the trick:

.defined(function(d) { return d.y != null; })

but, are there a way of NOT sending positions with null values, so I avoid sending tons of null data to my visualization ?

On Wednesday, May 22, 2013 8:30:51 PM UTC-7, Chris Viau wrote:
Reply all
Reply to author
Forward
0 new messages