Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text in the middle of the circle #207

Open
robssonpeter opened this issue Dec 15, 2020 · 5 comments
Open

Text in the middle of the circle #207

robssonpeter opened this issue Dec 15, 2020 · 5 comments

Comments

@robssonpeter
Copy link

robssonpeter commented Dec 15, 2020

How do I write the percentage of progress in the middle of the circle?

@artik
Copy link

artik commented Apr 26, 2021

Play with css:

                    .circle {
                        position: relative;

                        strong {
                            position: absolute;
                            transform: translate(-50%,-50%);
                            top: 50%;
                            left: 50%;
                        }
                    }

@Silloky
Copy link

Silloky commented Aug 24, 2023

@artik that is not valid css...

@Silloky
Copy link

Silloky commented Aug 24, 2023

@robssonpeter I had the same question; I looked around on the preview page and found this link : http://kottenator.github.io/jquery-circle-progress/examples.js

It details how each of the examples on the page work.

According to example 2 :

$('.second.circle').circleProgress({
    value: 0.6
}).on('circle-animation-progress', function(event, progress) {
    $(this).find('strong').html(Math.round(100 * progress) + '<i>%</i>');
});

This shows that the plugin doesn't natively set the inner text, but does create a text field for you to go and put whatever you want in there.
The plugin fires an event on the canvas' parent, which can be used to trigger, in your case, a text change in the middle.

Hope this helps

@Silloky
Copy link

Silloky commented Aug 24, 2023

Oh, didn't realise this issue was so old...

@vitoff34
Copy link

vitoff34 commented Oct 7, 2023

@robssonpeter I had the same question; I looked around on the preview page and found this link : http://kottenator.github.io/jquery-circle-progress/examples.js

It details how each of the examples on the page work.

According to example 2 :

$('.second.circle').circleProgress({
    value: 0.6
}).on('circle-animation-progress', function(event, progress) {
    $(this).find('strong').html(Math.round(100 * progress) + '<i>%</i>');
});

This shows that the plugin doesn't natively set the inner text, but does create a text field for you to go and put whatever you want in there. The plugin fires an event on the canvas' parent, which can be used to trigger, in your case, a text change in the middle.

Hope this helps

This does not seem to put text in the middle of it. Any fix? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants