Skip to content

Commit

Permalink
Removed usage example as it exists on the gh-pages page
Browse files Browse the repository at this point in the history
  • Loading branch information
slowe committed Apr 17, 2012
1 parent 5361dd9 commit 6b72331
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions README.md
@@ -1,7 +1,8 @@
Graph
=====

There are many good Javascript/HTML5 graphing libraries already in existence e.g. [Flot](https://github.com/flot/flot), [D3](http://mbostock.github.com/d3/) and [Ico](https://github.com/alexyoung/ico). However they don't make the simple xy data graphs, often used in scientific environments, without extra plugins. I decided to write my own, small, graphing library that could deal with large amounts of data as well as logarithmic axes and page resizing. This was created as part of my work at Las Cumbres Observatory Global Telescope (LCOGT). [View demos](http://slowe.github.com/graph/).
There are many good Javascript/HTML5 graphing libraries already in existence e.g. [Flot](https://github.com/flot/flot), [D3](http://mbostock.github.com/d3/) and [Ico](https://github.com/alexyoung/ico). However they don't make the simple xy data graphs, often used in scientific environments, without extra plugins. I decided to write my own, small, graphing library that could deal with large amounts of data as well as logarithmic axes and page resizing. This was created as part of my work at Las Cumbres Observatory Global Telescope (LCOGT). [View demos and usage](http://slowe.github.com/graph/).


Dependencies
------------
Expand All @@ -11,6 +12,7 @@ For this library to work it has two dependencies:
* [jquery.js](http://jquery.com/) -- your site may already use this excellent library;
* [excanvas.js](http://code.google.com/p/explorercanvas/) -- this is used to allow canvas support on Internet Explorer (41.6 kB). If only it wasn't needed.


Features
--------
* Draws x/y graphs
Expand All @@ -27,39 +29,11 @@ Features
* The graph inherits the font size/family from its parent elemet in the DOM (i.e. you can set it in the CSS)
* Can zoom in (click/drag) and zoom out (click)


Limitations
-----------
Some features (e.g. fullscreen) are experimental and will only work in the latest versions of modern browsers.

Usage
-----
You need to include the appropriate Javascript files:

<!--[if lt IE 9]><script src="excanvas.js"></script><![endif]-->
<script src="jquery.js"></script>
<script src="jquery.graph.js"></script>

Following those you'll need:

$(document).ready(function(){
var dataset = [];
dataset.push({
data: [{x:0,y:0.1},{x:1,y:0.2},{x:2,y:0.1},{x:3,y:0.25}],
color: '#FFBBDD',
points: { show: true },
lines: { show: true ,lineWidth: 2 },
clickable: false,
hoverable: false
});
options = {
xaxis:{ label:'Time (HJD)' },
yaxis: { label: 'Delta (mag)' },
grid: { hoverable: true, clickable: true }
};
// Attach to the DOM element with the ID 'lightcurve'
graph = $.graph('lightcurve', dataset, options);
});


Author
------
Expand Down

0 comments on commit 6b72331

Please sign in to comment.