postDraw sample
This commit is contained in:
@@ -154,6 +154,8 @@
|
||||
|
||||
graph.smooth = true; // Can change on fly
|
||||
|
||||
graph.postDraw = postDraw;
|
||||
|
||||
let amount = Math.random() * graph.getLength() * 1.4;
|
||||
for (let v = 0; v < amount; v++) {
|
||||
graph.add( Math.random() * 100 );
|
||||
@@ -178,6 +180,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
function postDraw(graph) {
|
||||
graph.ctx.beginPath();
|
||||
|
||||
graph.ctx.moveTo(0, 100);
|
||||
graph.ctx.lineTo(10000, 100);
|
||||
|
||||
graph.ctx.stroke();
|
||||
}
|
||||
|
||||
function callbackData(data) {
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user