From 3187596eddb884e36c6de3cf973e5d1533e628a1 Mon Sep 17 00:00:00 2001 From: David Hutchcroft <David.Hutchcroft@cern.ch> Date: Wed, 27 May 2020 18:03:42 +0100 Subject: [PATCH] Added axis labels to loop plots --- .../static/js/Chart-displayLoop.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/raspberry-backend/static/js/Chart-displayLoop.js b/raspberry-backend/static/js/Chart-displayLoop.js index 2aefccca..f093d15e 100644 --- a/raspberry-backend/static/js/Chart-displayLoop.js +++ b/raspberry-backend/static/js/Chart-displayLoop.js @@ -122,7 +122,7 @@ $(document).ready(function() { chart_PV = new Chart(ctx_PV, { type: 'scatter', data: {datasets: [{data: [], - label: "Pressure (x) [mbar]: Volume (y) [ml]", + label: "Pressure - Volume", borderColor: "rgb(51,99,255)", pointBackgroundColor : "rgb(51,99,255)", fill: false, @@ -131,18 +131,20 @@ $(document).ready(function() { options: {elements: { point: { radius: 5}}, legend: { display: true, labels: {fontSize: 24 } }, scales: {xAxes: [{display: true, - ticks: {min: 0, max: 35, + scaleLabel: { display: true, labelString: 'Pressure [mbar]', fontSize: 24}, + ticks: {min: 0, max: 35, stepSize: 5, fontSize: 25 }}], - yAxes: [{display: true, - ticks: {min: 0, max: 800, - stepSize: 100, fontSize:25 }}]}} + yAxes: [{display: true, + scaleLabel: { display: true, labelString: 'Volume [ml]', fontSize: 24}, + ticks: {min: 0, max: 800, + stepSize: 100, fontSize:25 }}]}} }); var ctx_VF = document.getElementById('flow_volume_chart'); chart_VF = new Chart(ctx_VF, { type: 'scatter', data: {datasets: [{data: [], - label: "Volume (x) [ml]: Flow (y) [ml/min]", + label: "Volume - Flow", borderColor: "rgb(51,99,255)", pointBackgroundColor : "rgb(51,99,255)", fill: false, @@ -150,9 +152,11 @@ $(document).ready(function() { ,options: {elements: { point: { radius: 5}}, legend: { display: true, labels: {fontSize: 24 } }, scales: {xAxes: [{display: true, + scaleLabel: { display: true, labelString: 'Volume [ml]', fontSize: 24}, ticks: {min: 0, max: 800, stepSize: 100, fontSize: 25 }}], yAxes: [{display: true, + scaleLabel: { display: true, labelString: 'Flow [ml/min]', fontSize: 24}, ticks: {min: -300, max: 300, stepSize: 100, fontSize: 25 }}]}} }); @@ -161,7 +165,7 @@ $(document).ready(function() { chart_PF = new Chart(ctx_PF, { type: 'scatter', data: {datasets: [{data: [], - label: "Pressure (x) [mbar]: Flow (y) [ml/min]", + label: "Pressure - Flow", borderColor: "rgb(51,99,255)", pointBackgroundColor : "rgb(51,99,255)", fill: false, @@ -169,9 +173,11 @@ $(document).ready(function() { ,options: {elements: { point: { radius: 5, fill: true}}, legend: { display: true, labels: {fontSize: 24 } }, scales: {xAxes: [{display: true, + scaleLabel: { display: true, labelString: 'Pressure [mbar]', fontSize: 24}, ticks: {min: 0, max: 35 , stepSize: 5 , fontSize: 25 }}], yAxes: [{display: true, + scaleLabel: { display: true, labelString: 'Flow [ml/min]', fontSize: 24}, ticks: {min: -300, max: 300, stepSize: 100, fontSize: 25 }}]}} }); -- GitLab