Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CspmIT/centinela-front/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Line Chart component displays time-series data from water treatment sensors, providing interactive features like zoom, pan, and data table export. Built on Apache ECharts with optimized rendering for large datasets.Props
Array of timestamp values in milliseconds (Unix epoch). Defines the x-axis time points for all series.
Array of data series to plot. Each series contains configuration and values.Series Object Structure:
Display name for the series (shown in legend and tooltip)
Array of y-values corresponding to xSeries timestamps. Use
null for missing data points.Line color (hex, RGB, or color name). Defaults to ECharts color palette.
Enable area fill below the line with 15% opacity gradient.
Y-axis type. Options:
'value' (linear), 'log' (logarithmic)Callback triggered when user zooms or pans the chart.Callback Parameters:
startMs(number): Start timestamp of visible rangeendMs(number): End timestamp of visible range
Callback triggered when user clicks the “Restore” button to reset zoom.
Features
Time Formatting
All timestamps are automatically formatted toAmerica/Argentina/Buenos_Aires timezone:
- Tooltip: Full datetime format (DD/MM/YYYY HH:mm:ss)
- Axis Labels: Time on first line, date on second line
- Data Table: Full datetime format for export
Interactive Toolbox
The chart includes a toolbox with the following features:Click and drag on chart to zoom into a specific time range. Works on both desktop and mobile.
Opens a modal displaying all chart data in a sortable table format. Read-only mode.
Resets the chart to its original zoom level and triggers
onRestore callback.Downloads the current chart view as a PNG image named “Gráfico +Agua.png”.
Zoom Controls
Two zoom mechanisms are available:- Inside Zoom: Pan by dragging on the chart area (touch/mouse)
- Slider Zoom: Adjust visible range using the slider at the bottom
Both zoom controls enforce a minimum visible range of 2 minutes to prevent over-zooming.
Missing Data Handling
The chart gracefully handles missing data:null,undefined,'-', orNaNvalues are treated as “Sin datos” (No data)- Lines connect across gaps when
connectNulls: trueis set - Tooltips show “Sin datos” for missing points
Mobile Optimization
The component automatically adapts to mobile viewports (≤768px):- Legend moves to bottom with compact spacing
- Axis labels rotate 35° (vs 20° on desktop)
- Reduced x-axis split points (6 vs 12)
- Toolbox icons enlarged to 18px
- Increased bottom margin for slider control
Usage Examples
Basic Time-Series Chart
Multi-Series with Callbacks
Logarithmic Scale
Performance Considerations
Sampling Strategy: The component uses
sampling: 'none' to preserve all data points. For datasets with >10,000 points, consider downsampling server-side.- Symbol Rendering: Small symbols (2px) with
showAllSymbol: 'auto'optimize rendering - Lazy Updates: ECharts options use
lazyUpdate: trueto batch re-renders - Memoization: All series transformations are memoized to prevent unnecessary recalculations
Accessibility
- Data table view provides accessible alternative to visual chart
- Keyboard navigation supported in toolbox controls
- High contrast colors recommended for series differentiation
Related Components
- Bar Chart - For categorical comparisons
- Gauge - For single-value displays with thresholds
- Boolean Chart - For on/off state indicators
Source Reference
File:~/workspace/source/src/modules/Charts/components/LineChart.jsx:112
Built with Apache ECharts and optimized for Centinela water treatment monitoring.