-
-
Save jzaefferer/5552abdf24227e5f7cb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var graph = new Rickshaw.Graph( { | |
element: document.querySelector("#boxes-stats"), | |
renderer: 'area', | |
stroke: true, | |
width: $("ul.content-listing").width() - 20, | |
height: 400, | |
max: yMax, | |
padding: { | |
top: 0.05, | |
bottom: 0.05 | |
}, | |
series: [{ | |
color: '#48c019', | |
data: dataBoxesFree, | |
name: 'free Process' | |
}, { | |
color: '#f98508', | |
data: dataBoxes, | |
name: 'Processes' | |
}] | |
}); | |
graph.render(); | |
//Update graph size on windows resize | |
$(window).off('resize.graph').on('resize.graph', function() { | |
graph.update({ | |
width: $("li.edit-billing").width(), | |
height: 400 | |
}); | |
var slider = new Rickshaw.Graph.RangeSlider({ | |
graph: graph, | |
element: $('#slider') | |
}); | |
}); | |
var hoverDetail = new Rickshaw.Graph.HoverDetail( { | |
graph: graph, | |
yFormatter: function(y) { | |
if (y > 1) { | |
return y + 1; | |
} else { | |
return y; | |
} | |
} | |
}); | |
var yAxis = new Rickshaw.Graph.Axis.Y({ | |
graph: graph, | |
tickFormat: function(y) { | |
if (y < 1 && y !== 0) { | |
y = ''; | |
} | |
return y; | |
} | |
}); | |
yAxis.render(); | |
var xAxis = new Rickshaw.Graph.Axis.Time({ | |
graph: graph | |
}); | |
xAxis.render(); | |
var slider = new Rickshaw.Graph.RangeSlider({ | |
graph: graph, | |
element: $('#slider') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment