Giter Club home page Giter Club logo

timegraph's Introduction

TimeGraph

A JS graph class for non-uniform time data

TimeGraph is used for data like the following:

var data = [
  {"name":"Series 1","created_at":"2015-03-30T06:06:48.363Z","data":[
    {"created_at":"2015-03-30T06:06:48.439Z","value":1500}
  ]},
  {"name":"Series 2","created_at":"2015-03-29T21:37:00.846Z","data":[
    {"created_at":"2015-03-30T03:57:04.024Z","value":73042},
    {"created_at":"2015-03-30T01:05:20.670Z","value":73042},
    {"created_at":"2015-03-29T21:42:39.941Z","value":73042},
    {"created_at":"2015-03-29T21:37:00.858Z","value":1500}
  ]},
  {"name":"Series 3","created_at":"2015-04-02T17:42:42.759Z","data":[
    {"created_at":"2015-04-02T17:42:42.812Z","value":1500}
  ]}
];

Suppose that we have an HTML div element with id graph_canvas, then we can render a graph with the following javascript commands:

var margin = { top: 10, bottom: 40, left: 65, right: 20 };
var width = 700;
var height = 400;
var graph = new TimeGraph(margin, width, height, '#graph_canvas');
graph.loadGraph(data);

Once a data set has been loaded it is also possible to reload another data set:

graph.reloadGraph(other_data);

Note that d3 and jquery.tipsy are required.

timegraph's People

Contributors

burz avatar

Stargazers

 avatar Marcos avatar

Watchers

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