Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prestontimmons/graphitejs
A jQuery plugin for displaying graphite graphs
https://github.com/prestontimmons/graphitejs
Last synced: 2 months ago
JSON representation
A jQuery plugin for displaying graphite graphs
- Host: GitHub
- URL: https://github.com/prestontimmons/graphitejs
- Owner: prestontimmons
- License: bsd-2-clause
- Created: 2011-10-28T02:09:39.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2014-10-20T22:24:25.000Z (about 10 years ago)
- Last Synced: 2024-08-04T04:03:39.756Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 626 KB
- Stars: 172
- Watchers: 10
- Forks: 33
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - graphitejs - A jQuery plugin for displaying graphite graphs (JavaScript)
README
## graphite.js
Plugin to easily make graphs and update them on the fly using
[Graphite's Render Url API](http://graphite.readthedocs.org/en/latest/render_api.html).## How it works
One. Adding a graph to a page:
```html
``````js
$("#graph").graphite({
from: "-24hours",
target: [
"server.web1.load",
],
});
```Two. Setting custom options:
```html
``````js
$("#graph").graphite({
from: "-24hours",
colorList: "red,green",
target: [
"alias(summarize(stats.site1.auth.login.error,'30min'),'Login Errors')",
"alias(summarize(stats.site1.auth.login.user,'30min'),'Login Success')"
],
title: "Login errors vs Success"
});
```Three. Setting global defaults:
```js
$.fn.graphite.defaults.width = "450"
$.fn.graphite.defaults.height = "300"
```Four. Updating existing graph:
```js
$.fn.graphite.update($("#graph"), {from: "-3days", lineWidth: "2"});
```Five. Setting a custom api url--the default is "/render/":
```js
$.fn.graphite.defaults.url = "http://myserver/render/"
```or
```js
$("#graph").graphite({
url: "http://myserver/render/"
});
```## $(img).graphite(options)
You should probably specify a target. All other settings are optional. All
settings will be passed through to the graphite api.