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.
LineChart component renders interactive time-series line charts using Apache ECharts. It features zoom controls, data table view, mobile responsiveness, and support for multiple series.
Basic Usage
Props
Array of Unix timestamps in milliseconds for the x-axis (time axis).
Array of series objects. Each series should have:
name(string) - Series label for legenddata(number[]) - Array of y-values matching x-axis lengthcolor(string, optional) - Line colorareaStyle(boolean, optional) - Fill area under line- Additional ECharts line series options
Y-axis type. Options:
"value", "log". Use "log" for logarithmic scale.Callback fired when user zooms. Receives
{ startMs, endMs } with selected time range.Callback fired when user clicks restore button to reset zoom.
Examples
Single Series
Multiple Series
With Zoom Callbacks
With Null Values
connectNulls: true).
Time Formatting
Axis Labels
X-axis labels show time and date:America/Argentina/Buenos_Aires
Tooltip
Hover tooltips show:Data Table View
Click Tabla button to see data in table format:| Fecha | Temperature | Pressure |
|---|---|---|
| 04/03/2024, 14:23:45 | 23.5 | 45.2 |
| 04/03/2024, 14:24:00 | 24.1 | 46.1 |
Features
Zoom Controls
Inside Zoom (z-index layer):- Drag to pan horizontally
- Mouse move to navigate (no scroll zoom)
- Minimum zoom: 2 minutes
- Drag handles to select range
- Shows data shadow
- 28px height
- Positioned at bottom (adjusted for mobile)
Toolbox
Interactive tools in top-right:- Data Zoom: Enable zoom mode
- Tabla: View data as table
- Restablecer: Reset to original view
- Guardar imagen: Download as PNG (filename: “Gráfico +Agua”)
Mobile Responsiveness
Detects mobile screens (max-width: 768px):
Mobile adjustments:
- Legend at bottom with scroll, smaller icons
- Reduced x-axis split numbers (6 vs 12)
- Increased label rotation (35° vs 20°)
- Toolbox centered, larger icons (18px)
- Slider zoom higher position (bottom: 5)
- Reduced top/bottom grid margins
- Horizontal legend at top
- More x-axis labels
- Standard toolbox (top-right)
Area Fill
Enable area fill under line:Data Processing
The component internally transforms data:[timestamp, value].
Empty Value Handling
- Empty values show as “Sin datos” in tooltips/table
- Lines connect across gaps (
connectNulls: true) - Points still render (symbol size: 2px)
Callbacks
onZoomRange
Fired when zoom changes:onRestore
Fired when restore button clicked:Configuration Details
Grid
X-Axis (Time)
Y-Axis
DataZoom
Two zoom components:-
Inside (gesture-based):
- Throttle: 80ms
- No mouse wheel zoom
- Move on mouse move
- Min span: 2 minutes
-
Slider (visual control):
- Height: 28px
- Shows data shadow
- Custom label format
- Handle size: 16px
Performance
Memoization
The component usesmemo and useMemo to optimize:
- Component re-renders
- X-series array processing
- Y-series transformation
- Options object creation
- Callback functions
Sampling
'average' or 'lttb'.
Use Cases
- Sensor monitoring: Temperature, pressure, flow over time
- System metrics: CPU, memory, network usage
- Business analytics: Sales, revenue, user growth
- IoT dashboards: Device telemetry and status
- Environmental data: Weather, water quality
- Performance tracking: Response times, error rates
Container Requirements
- Minimum width: 400px (600px+ recommended)
- Minimum height: 300px (400px+ recommended)
- Height must account for legend, toolbox, and zoom slider
- Use
100%width for responsive layouts
Accessibility
- Keyboard-navigable toolbox
- Data table view for screen readers
- Clear visual distinction between series (colors)
- Hover tooltips for data points
- Legend for series identification

