I want to create a bar chart to display the number of surveys that are completed, not started, and not available. The bars should also show the actual numbers below them, similar to this example
https://i.sstatic.net/8miIs.png
Currently, I have the following bar styling:
.bar {
height: 2em;
display: flex;
border: 3px solid darkgrey;
border-radius: 1px;
background-color: #484848;
background-image: linear-gradient(to top, #535353, #919191);
background-repeat: repeat-x;
}
.div1 {
height: 2em;
width: 50%;
background-color: #65ea4e;
background-image: linear-gradient(to top, #5abe43, #64ed4e);
background-repeat: repeat-x;
}
.div1:hover {
content: 'Completed';
}
.div2 {
height: 2em;
width: 20%;
background-color: red;
background-image: linear-gradient(to top, darkred, red);
background-repeat: repeat-x;
}
.div1:hover .tooltiptext {
visibility: visible;
}
.div2:hover .tooltiptext {
visibility: visible;
}
.tooltiptext {
position: relative;
display: inline-block;
visibility: hidden;
margin-top: 2em;
background-color: #484848;
color: white;
padding: 3px;
border-radius: 5px;
}
<div class="bar">
<div class="div1">5<span class="tooltiptext">Number of completed surveys</span></div>
<div class="div2">2<span class="tooltiptext">Number of surveys not completed</span></div>
</div>
How can I modify my bar to match the style of the bar shown in the provided image?