Добавьте следующий код под windows resize
и добавить свои диаграммы к одному parent id
, так что все остальные будут вычисляться динамически, без какого-либо перерыва.
var containerWidth = $("#yourChartId").parent().width(); // gets immediate parent width
var containerheight = $("#yourChartId").parent().height();// gets immediate parent height
// Give the below to parent svg
var margin = {top: 15, right: 15, bottom: 20, left: 40},
width = containerWidth- margin.left - margin.right,
height = containerheight - margin.top - margin.bottom;
// Assign below widths and heights to respective children
var marginMap = {top: 5, right: 5, bottom: 10, left: 20}
widthMap = width/2 - marginMap.left - marginMap.right,
heightMap = height/2 - margin.top - margin.bottom;
var marginBargraphs = {top: 5, right: 5, bottom: 10, left: 20}
widthBargraphs = width/2 - marginBargraphs.left - marginBargraphs.right,
heightBargraphs = height/2 - marginBargraphs.top - marginBargraphs.bottom;
Ну вам нужно добавить свои элементы диаграммы к одному SVG, ширина и высота вам нужно вычислить динамически и от расчетной ширины и высоты дают ширину SVG и высоты до 3 внутренних диаграмм. – SiddP