TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/CspmIT/mas-agua-front/llms.txt
Use this file to discover all available pages before exploring further.
DoughnutChart component renders pie or doughnut charts using Apache ECharts. It displays categorical data with automatic percentage calculations and interactive tooltips.
Basic Usage
Props
Array of data objects for chart segments. Each object should have:
value(number) - The numeric value for the segmentname(string) - The label for the segmentitemStyle(object, optional) - Custom styling withcolorproperty
Data Format
Basic Data Array
With Custom Colors
Examples
Sales Distribution
Resource Usage
Empty Data
Chart Configuration
Pie Type
The chart is configured as a doughnut (hollow center) by default:- Doughnut:
['40%', '70%']- hollow center - Solid pie:
['0%', '70%']- filled center - Thin ring:
['60%', '70%']- thin outer ring
Tooltip
Interactive tooltips show segment details on hover:{b}- Category name{c}- Value{d}%- Percentage of total
Legend
Horizontal legend centered at bottom:Emphasis Effect
Segments highlight on hover with shadow effect:Configuration Schema
The component has a Zod validation schema for configuration:Schema Fields
Chart title (minimum 1 character).
Category name (minimum 1 character).
Category color (minimum 1 character).
Variable ID (minimum 1).
Whether to use the last value or date range.
Start date for data range. Required when
lastValue is false.End date for data range. Required when
lastValue is false.- When
lastValueisfalse, bothstartDateandendDateare required - All required fields must have non-empty values
Customization
Colors
ECharts automatically assigns colors from its default palette. To customize:Ring Size
Modify theradius array in the component:
Use Cases
- Distribution analysis: Sales by channel, traffic sources
- Resource allocation: Budget distribution, capacity usage
- Categorical comparison: Market share, poll results
- Composition breakdown: Material components, time allocation
- Status overview: Task completion, issue categories
Interactivity
- Hover: Segments enlarge and show shadow
- Tooltip: Displays name, value, and percentage
- Legend: Click to show/hide segments
- Animation: Smooth transitions on data updates
Container Requirements
The chart automatically fills its container:- Minimum size: 300x300px
- Allow space for legend at bottom
- Chart auto-resizes on window resize
- Works best in containers with similar width/height
Empty State
Whendata is null, undefined, or an empty array:
- Chart renders with no segments
- Legend remains visible but empty
- Tooltip still functional (but no data to show)
See: DoughnutChartSchema.js

