-
Notifications
You must be signed in to change notification settings - Fork 132
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
Dashboard style progress bar #49
Comments
There isn't right now. It seems reasonable to add a prop to configure the proportion of the diameter the path/trail takes up, and combine that with path/trail rotation to achieve this. I'll take a look at doing that at some point, but not sure exactly when. Thanks for the suggestion! |
I added support for this here: I'm not submitting a PR at the moment as If you have a suggestion for getting that to work, let me know, I'll update and add unit tests and PR. |
@jeremywho that looks neat - sorry I haven't had time to dig in yet. |
any update on this? |
Not yet. I'd like to take a pass at it soon, though. |
This is now possible in v1.2.0 with the To do this: You'd write: <CircularProgressbar
percentage={66}
text={`${66}%`}
circleRatio={0.75} /* Make the circle only 0.75 of the full diameter */
styles={{
trail: {
strokeLinecap: 'butt',
transform: 'rotate(-135deg)',
transformOrigin: 'center center',
},
path: {
strokeLinecap: 'butt',
transform: 'rotate(-135deg)',
transformOrigin: 'center center',
},
}}
/> Right now it's slightly cumbersome because you have to adjust |
The syntax is now somewhat nicer in v2.0.0 with buildStyles, e.g.: const value = 66;
<CircularProgressbar
value={value}
text={`${value}%`}
circleRatio={0.75}
styles={buildStyles({
rotation: 1 / 2 + 1 / 8,
strokeLinecap: "butt",
trailColor: "#eee"
})}
/> |
Follow-up question: how would one adjust the height of the SVG based on this <CircularProgressbar
value={fill}
circleRatio={0.5}
styles={buildStyles({
rotation: 3 / 4,
strokeLinecap: 'butt',
trailColor: COLOR.PURPLE,
textColor: COLOR.WHITE,
})}
/> I've tried |
@garrett-gottlieb you can add a parent div on top of the |
@HoussemDjeghri this doesnt work since the progress bar resizes to fit the div, did any one find another solution? |
Is there any way to customize the display of the progress bar to display like a "dashboard" progress indicator, similar to the dashboard progress bar from ant design https://ant.design/components/progress/
The text was updated successfully, but these errors were encountered: