Giter Club home page Giter Club logo

d3-funnel-charts's Introduction

d3-funnel-charts

A funnel chart implementation using d3.js

Usage

To begin, you must instantiate a FunnelChart. The options you can pass to the FunnelChart are the following (the only required option is data):

data = an array containing arrays of categories and engagement in order from greatest expected funnel engagement to lowest.

width & height = width & height of chart (default is 400 and 600)

bottomPct = the percentage of the width the bottom base of the funnel trapezoid takes up. The top base always takes up the entire width, but the percentage of the total width that the bottom base takes up can be changed. (default = 1/3)

To actually draw the FunnelChart, call the draw method of the FunnelChart. The draw method takes in a selector for an element that the FunnelChart should be drawn in and a speed (default = 2.5). Make sure that you already have an element that corresponds to the selector you use because d3-funnel-charts doesn't create elements; it just uses an element you already have in your HTML as a container.

Example:

<div id="funnelContainer"></div>
<script src="d3.min.js"></script> // Make sure to include d3.js first
<script src="d3-funnel-charts.min.js"></script>
<script type="text/javascript">
    var data = [['Video Views', 1500], ['Comments', 300], ['Video Responses', 150]];
	var chart = new FunnelChart({
					data: data,
					width: 650, 
					height: 450, 
					bottomPct: 1/4
				});
	chart.draw('#funnelContainer', 2);
</script>

A demo of the above example can be found here

License

MIT

d3-funnel-charts's People

Contributors

akandels avatar smilli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

d3-funnel-charts's Issues

Not able to display D3 chart

Hi, I downloaded the example but when I launched the example, nothing was displayed. Am i missing something?

regards,

Create option for horizontal orientation

Hey, great job with this. Would love to have an option that would allow the funnel to be drawn horizontally. Easy enough feature? If you can't get to it I can try to submit a pull request in a few days.

Angular directive

I love this library! Would you consider writing an angularjs directive for this? I could help you out with it too if that works.

Thanks,
Sheetal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.