# HG changeset patch # User Mads Kiilerich # Date 2015-01-21 17:35:11 # Node ID dba66b0768f4880d300f2f5c95d38caa503c745d # Parent 18f932dc900151b6015349e3cf43d2b90a78e04b graph: don't hardcode chg_ prefix ... and just assume canvas and table are aligned diff --git a/kallithea/public/js/graph.js b/kallithea/public/js/graph.js --- a/kallithea/public/js/graph.js +++ b/kallithea/public/js/graph.js @@ -22,10 +22,12 @@ var colors = [ [ 0.0, 0.0, 0.0 ] ]; -function BranchRenderer(canvas_id, content_id) { - +function BranchRenderer(canvas_id, content_id, row_id_prefix) { + // canvas_id is canvas to render into + // content_id's height is applied to canvas + // row_id_prefix is prefix that is applied to get row id's this.canvas = document.getElementById(canvas_id); - var t = document.getElementById(content_id); + var content = document.getElementById(content_id); if (!document.createElement("canvas").getContext) this.canvas = window.G_vmlCanvasManager.initElement(this.canvas); @@ -62,10 +64,9 @@ function BranchRenderer(canvas_id, conte this.render = function(data,canvasWidth) { var idx = 1; - var rela = this.canvas; this.canvas.setAttribute('width',canvasWidth); - this.canvas.setAttribute('height',t.clientHeight); + this.canvas.setAttribute('height',content.clientHeight); var lineCount = 1; for (var i=0;i - + + %endif +