From 95296b31bf787a0130380b1db6cd8d6e62d59a7d Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 19 Aug 2019 16:31:11 +0100 Subject: Change height of graph in annotation view --- app/static/js/makeChart.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/static/js/makeChart.js b/app/static/js/makeChart.js index 5d759bf..b6e3de2 100644 --- a/app/static/js/makeChart.js +++ b/app/static/js/makeChart.js @@ -50,13 +50,23 @@ function noZoom() { d3.event.preventDefault(); } -function baseChart(selector, data, clickFunction, annotations, annotationFunction) { +function baseChart( + selector, + data, + clickFunction, + annotations, + annotationFunction, + divWidth, + divHeight +) { + if (divWidth === null || typeof divWidth === 'undefined') + divWidth = 1000; + if (divHeight === null || typeof divHeight === 'undefined') + divHeight = 480; + // preprocess the data data = preprocessData(data); - var divWidth = 1000; - var divHeight = 480; - var svg = d3.select(selector) .on("touchstart", noZoom) .on("touchmove", noZoom) @@ -220,7 +230,7 @@ function viewAnnotations(selector, data, annotations) { .attr("x2", xScale(ann.index)) .attr("class", "ann-line"); } - baseChart(selector, data, function() {}, annotations, handleAnnotation); + baseChart(selector, data, function() {}, annotations, handleAnnotation, null, 300); } function adminViewAnnotations(selector, data, annotations) { -- cgit v1.2.3