Interactive widget for graphing time-series data - based on D3 and Rickshaw.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app/assets
lib
vendor/assets/javascripts
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
pgdatagraph.gemspec
screenshot.png

README.md

pgdatagraph

Screenshot of pgdatagraph

Interactive widget for graphing time-series data - based on D3 and Rickshaw.

Note that the repository is structured as a Ruby gem. If you don't use this as a library inside a Ruby project just copy the code from app/assets to your project directory.

Example Use

The following Javascript renders a datagraph into the #cpu_graph element

new PG.DataGraph("#cpu_graph.datagraph", "https://yourapp.com/data/cpu_graph");

The server should return a JSON time series on GET, structured like this and sorted chronologically:

callbackFunction({"Label 1":[[1383257416,0.95],[1383258014,0.96]], "Label 2":[[1383257416,8.77],[1383258014,0.0]]})

There is three GET parameters we send:

  • callback: Name of the callback function
  • start: Requested start timestamp (UNIX timestamp)
  • end: Requested end timestamp (UNIX timestamp)

Authors

License

Copyright (c) 2013-2014 pganalyze

pgdatagraph is licensed under the 3-clause BSD license, see LICENSE file for details.