Skip to content

Commit

Permalink
updates to #58
Browse files Browse the repository at this point in the history
* updated dashboards.js documentation
* updated coffee file to make sure the demo can display the multi render graph
* compiled coffeescript with latest version
  • Loading branch information
Yoav committed Feb 7, 2014
1 parent 2fe4357 commit 8b7a580
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 74 deletions.
27 changes: 25 additions & 2 deletions dashboards.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ var dashboards =
"alias": "proc mem prod",
"targets": ["aliasByNode(derivative(servers.system.cpu.user),4)", // targets array can include strings,
// functions or dictionaries
{target: 'alias(derivative(servers.system.cpu.system,"system utilization")',
alias: 'system utilization', // if you use a graphite alias, specify it here
// an example of a target object
{target: 'alias(derivative(servers.system.cpu.system,"system utilization")',
alias: 'system utilization', // this alias *must* match the graphite alias.
color: '#f00'}], // you can also specify a target color this way
// (note that these values are ignored on the demo)
// annotator can also be a dictionary of target and description.
Expand All @@ -136,6 +137,28 @@ var dashboards =
"max": 150, // you can specify max value for the y-axis
"min": 20, // and also min
},
{
"alias": "System Load (Multi Renderer)",
// an example of a multi renderer. When renderer is set to multi
// each target can have its own renderer. E.g. to mix between a line and bar charts.
"renderer": 'multi',
"target": "aliasByNode(derivative(servers.system.cpu.*),4)", // target can use any graphite-supported wildcards
"targets": [
{'target': 'aliasByNode(servers.server06.system.load.load,1)',
'color': '#A99', 'renderer': 'bar', 'alias': 'server06'},
{'target':
'alias(movingAverage(servers.server06.system.load.load,"-5min"),' +
'"Moving Average of 5 segments")', 'color': '#F00',
'alias': 'Moving Average of 5 segments',
'renderer': 'line'}
],
"interpolation": "linear",
"description": "multi renderer (line and bars on the same chart)",
"annotator": {'target' : 'events.deployment',
'description' : 'deploy'},
"max": 150,
"colspan": 3
},
]
},
{ "name": "Setup",
Expand Down
140 changes: 75 additions & 65 deletions js/giraffe.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 14 additions & 7 deletions js/src/giraffe.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -389,31 +389,38 @@ Rickshaw.Graph.Demo = Rickshaw.Class.create(Rickshaw.Graph.JSONP.Graphite,
{
color: palette.color(),
data: @seriesData[0],
name: 'Moscow'
name: 'Moscow',
renderer: 'line'
}, {
color: palette.color(),
data: @seriesData[1],
name: 'Shanghai'
name: 'Shanghai',
renderer: 'line'
}, {
color: palette.color(),
data: @seriesData[2],
name: 'Amsterdam'
name: 'Amsterdam',
renderer: 'bar'
}, {
color: palette.color(),
data: @seriesData[3],
name: 'Paris'
name: 'Paris',
renderer: 'line'
}, {
color: palette.color(),
data: @seriesData[4],
name: 'Tokyo'
name: 'Tokyo',
renderer: 'line'
}, {
color: palette.color(),
data: @seriesData[5],
name: 'London'
name: 'London',
renderer: 'line'
}, {
color: palette.color(),
data: @seriesData[6],
name: 'New York'
name: 'New York',
renderer: 'line'
}
].map((s) =>
s.stroke = @args.stroke_fn(d3.rgb(s.color)) if @args.stroke_fn?
Expand Down

0 comments on commit 8b7a580

Please sign in to comment.