Creating a basic gauge meter with min value 0
and max value 2
.
The current UI progress is as follows:
.sc-gauge { width:200px; height:200px; margin:200px auto; }
.sc-background { position:relative; height:100px; margin-bottom:10px; background-color:gray; border-radius:150px 150px 0 0; overflow:hidden; text-align:center; }
.sc-mask { position:absolute; top:20px; right:20px; left:20px; height:80px; background-color:#fff; border-radius:150px 150px 0 0 }
.sc-percentage { position:absolute; top:100px; left:-200%; width:400%; height:400%; margin-left:100px; background-color:#00aeef; }
.sc-percentage { transform:rotate(70deg); transform-origin:top center; }
.sc-min { float:left; }
.sc-max { float:right; }
.sc-avg {position: absolute; top: 75%;left: 50%;}
.sc-value { position:absolute; top:50%; left:0; width:100%; font-size:48px; font-weight:700 }
<div class="sc-gauge">
<div class="sc-background">
<div class="sc-percentage"></div>
<div class="sc-mask"></div>
<span class="sc-value">0.7 gb</span>
</div>
<span class="sc-min">0</span>
<span class="sc-avg">1</span>
<span class="sc-max">2</span>
</div>
Desired output should look like this:
https://i.sstatic.net/RLpKP.png
Pending UI updates include:
-> Positioning of 0
and 2
precisely at the start and end of the chart respectively.
-> Adding small lines in the left
, top
, and right
sides of the chart.
-> Placing the number 1
at the center top of the chart.
If unclear, please refer to the image attached for exact UI details.
My attempts to align numbers 0
and 2
as per the image:
.sc-percentage {
position: relative;
}
.sc-min {
position: absolute;
left: 0;
}
.sc-max {
position: absolute;
left: 0;
}
To add a line at the top of the chart and position number 1
:
.sc-avg {position: absolute; top: 75%;left: 50%;}
Unfortunately, these adjustments didn't yield the expected results..
Having difficulty with this CSS task... Seeking guidance to achieve the exact UI depicted in the provided image.