Page 1 of 1

How to change circle values in dashboard

Posted: 06 Jan 2021, 22:41
by fensefernando
Hello!

How to change the fill color according to the value of the circle?

Code: Select all

<div class="p-col-12 p-lg-3 p-md-6">
                    <div class="status-title" style="color:#f6a821">Mobile</div>
                    <div class="circle2">
                        <i class="pi pi-mobile"></i>
                        <span>50</span>
                    </div>
                </div>

Re: How to change circle values in dashboard

Posted: 08 Jan 2021, 13:56
by merve7
Hi,
You can try the below code?

Code: Select all

circleValue = 50;

Code: Select all

<div class="p-col-12 p-lg-3 p-md-6">
    <div class="status-title" style="color:#f6a821">Mobile</div>
    <div class="circle2" [ngStyle]="{ borderTopColor: circleValue === 50 ? 'red' : 'yellow'}">
        <i class="pi pi-mobile"></i>
        <span>{{circleValue}}</span>
    </div>
</div>
Image

Re: How to change circle values in dashboard

Posted: 06 Feb 2021, 22:49
by fensefernando
Thanks for your reply

What I am looking for is that the color is painted according to the value

If I put a value of 30 advance up to 30% of the color

Re: How to change circle values in dashboard

Posted: 15 Feb 2021, 14:35
by merve7
Hi,
You can use our new Knob component. (https://primefaces.org/primeng/showcase/#/knob)