Skip to content

Instantly share code, notes, and snippets.

@Rockncoder
Created May 28, 2012 22:47
Show Gist options
  • Select an option

  • Save Rockncoder/2821528 to your computer and use it in GitHub Desktop.

Select an option

Save Rockncoder/2821528 to your computer and use it in GitHub Desktop.
JQMCharts
RocknCoder.Pages.managePlotChart = function () {
var pageshow = function () {
updateChart();
$("#refreshPlotChart").click(function(){
updateChart();
$.mobile.silentScroll();
});
},
pagehide = function () {
$("#refreshPlotChart").unbind('click');
},
updateChart= function(){
var sliders = $($.mobile.activePage).find("input"),
vals = [];
_.each(sliders,function(element, index){
vals.push([index+1, parseInt(element.value, 10)]);
});
showChart(vals);
},
showChart = function(vals){
$.jqplot('plotChart',[vals]).replot({clear: true, resetAxes:true});
};
return {
pageshow: pageshow,
pagehide: pagehide
}
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment