marmelab/EventDrops

configuration error "Uncaught TypeError: Cannot read property 'eventDrops' of undefined"

mozhdehhmd opened this issue · 2 comments

I dont want use any module bundler so I have such code:

 <!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <link href="https://unpkg.com/event-drops/dist/style.css" rel="stylesheet" />
</head>
<body>
    <div id="chart_placeholder"></div>
    <script src="https://unpkg.com/d3"></script>
    <script src="https://unpkg.com/event-drops@1.0.1/dist/index.js"></script>
    <script type="text/javascript">
    var data = [{ name: "http requests", data: [new Date('2017/09/15 13:24:54'), new Date('2017/09/15 
13:25:03'), new Date('2017/09/15 13:25:05')] },
  { name: "SQL queries", data: [new Date('2017/09/15 13:24:57'), new Date('2017/09/15 13:25:04'), new 
Date('2017/09/15 13:25:04')] },
  { name: "cache invalidations", data: [new Date('2017/09/15 13:25:12')] }];

    var eventDropsChart = d3.chart.eventDrops();

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

    </script>
</body>
</html>

but I encounter this error -> Uncaught TypeError: Cannot read property 'eventDrops' of undefined
would you please help me whats wrong with my code?

We indeed need to update documentation. d3.chart.eventDrops is now eventDrops. But, I didn't succeed in making your example work. I'm getting into it. :)

You can find a working sample on https://jsfiddle.net/6rqxusw5/9/. I'm fixing the README. :)