Skip to content

Instantly share code, notes, and snippets.

@markmarkoh
Created January 12, 2010 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markmarkoh/274800 to your computer and use it in GitHub Desktop.
Save markmarkoh/274800 to your computer and use it in GitHub Desktop.
:javascript
$(document).ready(function () {
var d = #{@activity_data};
var options = {
xaxis: { mode: "time"},
selection: { mode: "x"}
};
var plot = $.plot($("#activity_placeholder"), [d], options);
$("#activity_placeholder").bind("plotselected", function (event, ranges) {
plot = $.plot($("#activity_placeholder"), [d],
$.extend(true, {}, options, {
xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
}));
});
});
#upload
%h2 Uploaded File Breakdown:
#pie= @upload_types
#activity
%h2 Application Activity Per Day:
#activity_placeholder{:style => 'width:700px;height:300px;'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment