GithubHelp home page GithubHelp logo

474a3's Introduction

474 a3 software design

Hello, Welcome.

This API provides you to build a pie chart more easily. All you need is your data which has one column for category and one column for corresponding numerical values. This software will create a pie chart with colored categories and their sizes will follow the values in numerical column.

When using, just follow the following format where d[0] equals categories and d[1] equals numerical values. Also please name your data as "data.csv"

      
	var chart = pieChart()
      .x(function(d) { return +d[0]; })
      .y(function(d) { return +d[1]; });

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

By doing this you will be able to create a simple pie chart. If you would like to change some features, you can use the following methods:

  • Changing x values(categorical): chart.x(categories)
  • Changing y values(numerical): chart.y(numbers)
  • Changing the width: chart.width(w)
  • Changing the height: chart.height(h)
  • Changing the margins: chart.margin(m)
  • Changing colors: chart.colors(c)

To give you an example of those methods, please see below.

      
	var chart = pieChart().height(650); // changes height to 650.
	

Width and height accept a single integer, x and y accept sets of categories or numbers, margin accepts an object with margins, and colors accept a list of colors.

If you have any other questions, please let me know. Thank you.

474a3's People

Contributors

sunho0301 avatar

Watchers

James Cloos avatar  avatar

Forkers

sm96

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.