]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
DASH: updateSparklines(width, height) <- set params w/ call
authorPhilipp Klaus <philipp.klaus@gmail.com>
Fri, 29 Sep 2017 12:28:38 +0000 (20:28 +0800)
committerPhilipp Klaus <philipp.klaus@gmail.com>
Fri, 29 Sep 2017 12:28:38 +0000 (20:28 +0800)
python_suite/dashboard/static/js/script.js
python_suite/dashboard/views/pv_overview_bootstrap.jinja2

index 0f11ea46e2937bbf9e99a39edf59bb29bdbe8600..32758f4ac66b66147fd9094637c70ccc83bd85f2 100644 (file)
@@ -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')
index 82018a74ff266761c87a18259f8afd19aed2f917..4dccb8746a8ccb1e5b8167a45dedad13cd7cb305 100644 (file)
@@ -66,7 +66,7 @@ $(function() {
   /* on page load */
 
   // create sparklines
-  updateSparklines();
+  updateSparklines(300, 60);
 
   // Tooltips (requires Bootstrap >3)
   $('.js-tooltip').tooltip();