diff --git a/public/assets/js/picoreflow.js b/public/assets/js/picoreflow.js
index 9d8c3e5..4c3cd05 100644
--- a/public/assets/js/picoreflow.js
+++ b/public/assets/js/picoreflow.js
@@ -67,11 +67,11 @@ function updateProfileTable()
{
var html = "";
- for(var i=0; i';
- html += '
';
+ html += '';
+ html += '
';
}
$('#profile_table').html(html);
@@ -110,6 +110,7 @@ function enterNewMode()
$('#form_profile_name').attr('placeholder', 'Please enter a name');
graph.profile.points.show = true;
graph.profile.draggable = true;
+ graph.profile.data = [];
graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ], getOptions());
updateProfileTable();
}
@@ -143,7 +144,15 @@ function leaveEditMode()
function newPoint()
{
- graph.profile.data.push([parseInt(graph.profile.data[graph.profile.data.length-1][0])+15, Math.floor((Math.random()*230)+25)]);
+ if(graph.profile.data.length > 0)
+ {
+ var pointx = parseInt(graph.profile.data[graph.profile.data.length-1][0])+15;
+ }
+ else
+ {
+ var pointx = 0;
+ }
+ graph.profile.data.push([pointx, Math.floor((Math.random()*230)+25)]);
graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ], getOptions());
updateProfileTable();
}