mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
get plot dimensions from css (not hardcoded)
This commit is contained in:
parent
3fea3fafb0
commit
a0a2ff47a8
3 changed files with 6 additions and 6 deletions
|
@ -158,8 +158,8 @@ function tab_initialize_receiver() {
|
|||
var samples = 0;
|
||||
|
||||
var margin = {top: 20, right: 20, bottom: 10, left: 40};
|
||||
var width = 920 - margin.left - margin.right;
|
||||
var height = 200 - margin.top - margin.bottom;
|
||||
var width = $('#RX_plot').width() - margin.left - margin.right;
|
||||
var height = $('#RX_plot').height() - margin.top - margin.bottom;
|
||||
|
||||
var svg = d3.select("svg");
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
.tab-sensors .plot_control {
|
||||
float: right;
|
||||
|
||||
width: 178px;
|
||||
width: 168px;
|
||||
|
||||
border: 1px solid silver;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
|||
.tab-sensors svg {
|
||||
float: right;
|
||||
|
||||
width: 720px;
|
||||
width: 730px;
|
||||
height: 140px;
|
||||
|
||||
margin-bottom: 10px;
|
||||
|
|
|
@ -38,8 +38,8 @@ function addSampleToData(data, sampleNumber, sensorData) {
|
|||
|
||||
function initGraphHelpers(selector, sampleNumber, heightDomain) {
|
||||
var margin = {top: 20, right: 20, bottom: 10, left: 40};
|
||||
var width = 720 - margin.left - margin.right;
|
||||
var height = 140 - margin.top - margin.bottom;
|
||||
var width = $(selector).width() - margin.left - margin.right;
|
||||
var height = $(selector).height() - margin.top - margin.bottom;
|
||||
|
||||
var helpers = {selector: selector, dynamicHeightDomain: !heightDomain};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue