diff --git a/src/js/charts/base.js b/src/js/charts/base.js index c82a8358a3458e7575f52847e720d02be3c0aa29..16c72ae10682eed3a35eeba57e06d52b7d749260 100644 --- a/src/js/charts/base.js +++ b/src/js/charts/base.js @@ -69,9 +69,19 @@ export class BaseChartWidget { const x = translateX ? translateX : 100; const y = translateY ? translateY : 50; + + const bg_translate = this.title ? [5, 35] : [0, 0]; + const bg = this.svg.append("rect") + .attr("width", this.title ? divWidth - 10 : divWidth) + .attr("height", this.title ? divHeight - 40 : divHeight) + .attr("fill", "white") + .attr("rx", 3) + .attr("ry", 3) + .attr("transform", `translate(${bg_translate[0]},${bg_translate[1]})`); this.g = this.svg.append("g").attr("transform", `translate(${x},${y})`); this.svg.attr("height", divHeight).attr("width", divWidth); + this.svg.attr("style", "background-color: #f5f5f5"); const width = this.svg.attr("width") - this.marginRight; const height = this.svg.attr("height") - this.marginBottom;