GithubHelp home page GithubHelp logo

ramhemasri / raphael-gantt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from erikthered/raphael-gantt

0.0 2.0 0.0 157 KB

Draw gantt charts with Raphaël and Moment.js

License: MIT License

JavaScript 100.00%

raphael-gantt's Introduction

raphael-gantt

Draw gantt charts with Raphaël and Moment.js

Introduction

HEADS UP! This is still under heavy development so the code isn't super great right now and will likely change drastically in the future.

My intent with this project is to provide an easy way to create gantt charts backed by intuitively structured JSON data. I'm using Raphaël to draw the chart itself and Moment.js to simplify all the date related activties.

More information coming soon!

Usage

To start, pass the id of the element you want the chart to be drawn inside

var chart = new GanttChart("chart");

Next, pass the data you want to render via the load data function

var payload = [{
    name: "Project Name", startDate: "2012-06-28", endDate: "2012-07-10",
    phases : [
      {name : "Phase 1", startDate: "2012-06-28", endDate: "2012-07-04", 
        tasks : [
          {name : "Task 1", startDate: "2012-06-28", endDate: "2012-07-01"},
          {name : "Task 2", startDate: "2012-06-29", endDate: "2012-07-04"}
        ]
      },
      {name : "Phase 2", startDate: "2012-07-05", endDate: "2012-07-10",
        tasks : [
          {name : "Task 3", startDate: "2012-07-05", endDate: "2012-07-08"},
          {name : "Task 4", startDate: "2012-07-09", endDate: "2012-07-10"}
        ]
      }
    ]
  }];
  chart.loadData(payload);

Finally, call the draw method

chart.draw();

Dependencies

  • Raphaël
  • Moment.js

Example

Here's a screenshot of what you'll end up with:

Gantt chart example

raphael-gantt's People

Contributors

erikthered avatar

Watchers

James Cloos avatar Ram Hemasri 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.