get plot dimensions from css (not hardcoded)

pull/3/head
cTn 11 years ago
parent 3fea3fafb0
commit a0a2ff47a8

@ -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…
Cancel
Save