Giter Site home page Giter Site logo

bamboochart's Introduction

d3 Bamboo Chart Documentation (bamChart.js)

##Overview bamChart.js is a reusable charting function that constructs a bamboo chart from properly formatted data.

##Data the Chart Supports A bamboo chart displays data from a data matrix with categories for the columns and rows. The row categories are stored in the first column which is identified by a column name like 'Category'. This column's name must be set using the CategoryKey function. Lastly, the first row of data must contain aggregate data like the column's mean. The aggregate data is used to construct the trunks of each bamboo 'tree' while the remaining rows are used to construct the 'branches'. Example data is below

alt tag

##Usage

	var chart = bamChart()
		.title('ChartTitle')
		.xAxisLabel('AxisLabel')
		.CategoryID('CategoryColumnID');

	d3.csv('dataset', function(data) {
	    d3.select("#targetdiv")
	        .datum(data)
	        .call(chart);
		});

##Functions # bamChart(Key).CategoryKey

Sets the key for the column that contains the label for each row of the dataset and returns that bamChart instance. Used to extract the labels for the y Axis and process data.

# bamChart(Int).height

Sets the height of the chart and returns that bamChart instance.

# bamChart(Int).width

Sets the width of the chart and returns that bamChart instance.

# bamChart(Int).lmargin

Sets the left margin of the chart to accomodate the length of the labels on the y Axis and returns that bamChart instance

# bamChart(String).title

Sets the Chart Title and returns that bamChart instance.

# bamChart(String).xAxisLabel

Sets the label for the x Axis and returns that bamChart instance

# bamChart(Int).ticks

Divides the x axis into given number of sections with labeled marks at each division and returns that bamChart instance.

# bamChart(Color).clickColor

Sets the color that a tree will turn when it is clicked and returns that bamChart instance.

d3 implementation inspired by and sample data acquired from http://www.excelcharts.com/blog/bamboo-charts-people-at-risk-of-poverty-or-social-exclusion/ Code that moves html elements to the front or back taken from http://bl.ocks.org/eesur/4e0a69d57d3bfc8a82c2

bamboochart's People

Contributors

jjang8661 avatar xochixochi avatar

Watchers

 avatar

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.