1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 14:55:21 +03:00

get plot dimensions from css (not hardcoded)

This commit is contained in:
cTn 2014-04-13 14:49:29 +02:00
parent 3fea3fafb0
commit a0a2ff47a8
3 changed files with 6 additions and 6 deletions

View file

@ -158,8 +158,8 @@ function tab_initialize_receiver() {
var samples = 0; var samples = 0;
var margin = {top: 20, right: 20, bottom: 10, left: 40}; var margin = {top: 20, right: 20, bottom: 10, left: 40};
var width = 920 - margin.left - margin.right; var width = $('#RX_plot').width() - margin.left - margin.right;
var height = 200 - margin.top - margin.bottom; var height = $('#RX_plot').height() - margin.top - margin.bottom;
var svg = d3.select("svg"); var svg = d3.select("svg");

View file

@ -3,7 +3,7 @@
.tab-sensors .plot_control { .tab-sensors .plot_control {
float: right; float: right;
width: 178px; width: 168px;
border: 1px solid silver; border: 1px solid silver;
} }
@ -39,7 +39,7 @@
.tab-sensors svg { .tab-sensors svg {
float: right; float: right;
width: 720px; width: 730px;
height: 140px; height: 140px;
margin-bottom: 10px; margin-bottom: 10px;

View file

@ -38,8 +38,8 @@ function addSampleToData(data, sampleNumber, sensorData) {
function initGraphHelpers(selector, sampleNumber, heightDomain) { function initGraphHelpers(selector, sampleNumber, heightDomain) {
var margin = {top: 20, right: 20, bottom: 10, left: 40}; var margin = {top: 20, right: 20, bottom: 10, left: 40};
var width = 720 - margin.left - margin.right; var width = $(selector).width() - margin.left - margin.right;
var height = 140 - margin.top - margin.bottom; var height = $(selector).height() - margin.top - margin.bottom;
var helpers = {selector: selector, dynamicHeightDomain: !heightDomain}; var helpers = {selector: selector, dynamicHeightDomain: !heightDomain};