Answer the question
In order to leave comments, you need to log in
Why is svg not rubber?
In angular, I added the D3 library and drew the axes of the graph. at the same time, I set values for the svg viewport and the width of the parent container: STACKBLITZ DEMO
The problem is that svg does not adjust to the width of the browser window (or parent container). Please help me to solve it. Moreover, the same code works without problems outside the context of the angular: JSFIDDLE
tpl:
<div class="cost-square-wrap">
<svg id="costSquareGraph" viewbox="0 0 1200 250"></svg>
</div>
.cost-square-wrap {
width: 100%;
}
svg {
width: 100%;
min-height: 250px;
}
Answer the question
In order to leave comments, you need to log in
Angular requires the correct capitalization of the property name.
"viewbox"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question