d3.js - D3 Area chart that tends to zero where values are missing -


i have data this:

document: [{"key":"01/01/2001","values":2},  {"key":"02/01/2001","values":1},  {"key":"31/01/2001","values":2}] 

i creating area chart .interpolate("linear") create following: idea being represent number of documents "created" throughout january.

enter image description here

however, kind of misleading output imply there values throughout january, when there aren't 2 @ start , 1 @ end.

my questions are:

  1. fundamentally wrong graph represent data, , should bar chart used instead?
  2. can d3 add evenly spaced "zero" values each day in january?
  3. is best can use .interpolate("cardinal") produce like:

enter image description here

thanks in advance!

i think answer other post gives usable answer, reposting here not dead-end visitors coming google , finding post first (as did).

d3 linechart - show 0 on y-axis without passing in points?


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -