CirclePorcentaje component displays a value as a percentage within a circular gauge chart. It features a gradient progress indicator and centered text showing the percentage and value.
Component location
Source:/src/modules/Charts/components/CirclePorcentaje.jsx:1
Props
Current value to display
Maximum value for percentage calculation
Primary color for the progress arc (supports hex colors)
How it works
The component calculates percentage as(value / maxValue) * 100 and displays it in a 270-degree circular gauge (starting at top, going clockwise).
Visual elements:
- Progress arc: Gradient from light green → custom color → dark green
- Track arc: Light gray background showing full range
- Center text: Large percentage display with small value/max below
- With data: Shows calculated percentage with gradient progress
- No data: Shows 0% with gray styling
Usage
Gradient configuration
The progress arc uses a three-stop linear gradient:Use cases
- Tank fill levels
- Battery charge indicators
- Completion percentages
- Capacity monitoring
- Goal progress tracking
Technical details
Arc configuration:- Start angle: 90° (top)
- End angle: -270° (full circle minus small gap)
- Radius: 90% of container
- Progress width: 24px
- Track width: 12px (half of progress)
- Percentage: 2 decimal places
- Center display:
{percentage}% - Bottom display:
{value} / {maxValue}
- Null/undefined values default to 0
- Non-numeric values treated as 0
- Shows “0%” when no valid data
Related components
- Gauge - Speedometer-style gauge with needle
- Liquid Fill - Animated liquid fill gauge
- Board Chart - Uses CirclePorcentaje for top charts

