$.plot
を現在表示されていないものに呼び出すと、Flotがうまく機能しません。あなたの最善の策はpageshow
イベントにあなたのページ2と3のグラフを移動することになるだろう:
$('#device2').bind('pageshow',function(){
$.plot($("#total-inches-graph"),
[{ color: "rgb(14, 91, 173)", label: 'Total Measurements', data: totalInchesArray }] ,
{ xaxis: { mode: "time", timeformat: "%a" ,minTickSize: [1, "day"] } });
});
$('#device3').bind('pageshow',function(){
$.plot($("#weight-graph"),
[{ color: "rgb(32, 140, 47)", label: 'Weight', data: weightArray }] ,
{ xaxis: { mode: "time", timeformat: "%a" ,minTickSize: [1, "day"] } });
});
私はここで働い例を作った:http://jsfiddle.net/ryleyb/yZuZb/