I want to create an overlay div inside another div[The overlay div is generated dynamically inside a for loop]. But when I write position:absolute inside my overlay class, the inner div is getting created at same position.
My requirement is to show multiple "TOTAL USERS (NUMBER)" in the middle of the chart.
So I have written an overlay css class. Inside the overlay class I have given position:absolute
. As a result all the divs are getting created at same place over each other.
See at the above image the "TOTAL USER" part is overwritten at same place.
overlay class is:
.overlay{
position:absolute;
top:22px;
left:0px;
bottom:0px;
right:0px;
z-index: 2;
}
HTML vide code:
<div *ngFor="let chart of chartData[0].values" class="child">
<div class="chart-goal-name">{{goalName}}</div>
<div class="overlay">TOTAL USERS {{userCount}} </div>
<div class="chart-holder">
<nvd3 [options]="donutChartOptions"
[data]="chart"
class="top-1">
</nvd3>
</div>
</div>