EventDrops icon indicating copy to clipboard operation
EventDrops copied to clipboard

Generate a chart from any type of data array

Open BernardoMB opened this issue 7 years ago • 1 comments

The .date function should be used like this:

var eventDropsChart = d3.chart.eventDrops()
    .date(function(d){ return d.date; });

d3.select('#chart_placeholder')
    .datum(data)
    .call(eventDropsChart);`

Instead of

var eventDropsChart = d3.chart.eventDrops();

d3.select('#chart_placeholder')
  .datum(data)
  .date(function(d){
      return d.date;
  }),
  .call(eventDropsChart);

BernardoMB avatar Sep 13 '16 20:09 BernardoMB

In latest version (1.0.0), we don't support configurable anymore. Instead, we need to pass a date property to a configuration object, something like:

const chart = eventDrops({
    drop: {
        date: d => new Date(d.date),
    },
});

Hence, the date function is now related to chart, and not to selection anymore. Does it fulfill your need?

jpetitcolas avatar Jan 30 '18 17:01 jpetitcolas