From 2b282ace5cad0927ce617f384474e867dc5cefe2 Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Fri, 29 Sep 2017 20:28:38 +0800 Subject: [PATCH] DASH: updateSparklines(width, height) <- set params w/ call --- python_suite/dashboard/static/js/script.js | 6 +++--- python_suite/dashboard/views/pv_overview_bootstrap.jinja2 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python_suite/dashboard/static/js/script.js b/python_suite/dashboard/static/js/script.js index 0f11ea4..32758f4 100644 --- a/python_suite/dashboard/static/js/script.js +++ b/python_suite/dashboard/static/js/script.js @@ -3,7 +3,7 @@ alert("whats up"); console.log("what's up?"); */ -function updateSparklines() { +function updateSparklines(width, height) { var sparklineItems = document.getElementsByClassName("sparkline"); [].forEach.call(sparklineItems, function (el) { var el_id = el.id; @@ -11,8 +11,8 @@ function updateSparklines() { var pvName = pvName.replace(/-/g, ':'); var sparklineChart = sparkline() - .width(155) - .height(50) + .width(width) + .height(height) .gradientColors(['green', 'orange', 'red']) // OK, WARNING, ALARM .dataSource('/api/history/' + pvName) .dataSourceType('JSON') diff --git a/python_suite/dashboard/views/pv_overview_bootstrap.jinja2 b/python_suite/dashboard/views/pv_overview_bootstrap.jinja2 index 82018a7..4dccb87 100644 --- a/python_suite/dashboard/views/pv_overview_bootstrap.jinja2 +++ b/python_suite/dashboard/views/pv_overview_bootstrap.jinja2 @@ -66,7 +66,7 @@ $(function() { /* on page load */ // create sparklines - updateSparklines(); + updateSparklines(300, 60); // Tooltips (requires Bootstrap >3) $('.js-tooltip').tooltip(); -- 2.43.0