Added feature to add points while editing

This commit is contained in:
chrono 2013-11-30 18:03:04 +01:00
parent 6ad5938de1
commit 4547036d39
2 changed files with 7 additions and 0 deletions

View File

@ -117,7 +117,13 @@ function leaveEditMode() {
}
function addNewPoint() {
console.log(graph.profile.data);
graph.profile.data.push([parseInt(graph.profile.data[graph.profile.data.length-1][0])+15, 25]);
graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ], getOptions());
console.log(graph.profile.data);
}
function saveProfile()

View File

@ -64,6 +64,7 @@
<button class="btn btn-success" type="button" onclick="saveProfile();">Save</button>
<button id="btn_exit" type="button" class="btn btn-danger" onclick="leaveEditMode()" style="display:none"><span class="glyphicon glyphicon-remove"></span></button>
</span>
<button id="btn_newpoint" type="button" class="btn btn-default" onclick="addNewPoint()"><span class="glyphicon glyphicon-plus"></span></button>
</div>