marmelab/EventDrops

Error: Invalid value for <circle> attribute cx="NaN"

jeraymond opened this issue · 2 comments

Hello,

I'm trying to use EventDrops 1.0.1 without a Module Bundler. When the chart renders all the drops are stuck on the left side of the graph. The the console logs I see JavaScript error

Error: Invalid value for <circle> attribute cx="NaN"

It seems like there is something wrong calculating the x-axis value. Here is a repro of the issue. Any ideas?

It seems you have forgotten to specify the date function. Here is the fixed version.

var chart = eventDrops({
	range: {
	  start: new Date('03/01/2018 6:55:11 PM'),
    end: new Date('03/05/2018 6:55:11 PM')
  },
  drop: {
+    date: d => d.date,
  }
});

Thanks that fixed the issue.