save_points_chart 1.5.2
save_points_chart: ^1.5.2 copied to clipboard
Modern Flutter charting library with 12 chart types, Material 3 design, smooth animations, and zero dependencies.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2025-11-25 #
Added #
- Initial release of Save Points Chart library
- 7 chart types: Line, Bar, Area, Pie, Donut, Radial, and Sparkline
- Full light/dark theme support with automatic adaptation
- Material 3 design principles
- Glassmorphism and Neumorphism effects
- Loading and error states for all charts
- Interactive point/bar/segment tapping
- Smooth animations for all chart types
- Performance optimizations (RepaintBoundary, efficient rendering)
- Comprehensive API documentation
- Main export file for easy imports
- Input validation and error handling
- Accessibility support (Semantics widgets)
- Comprehensive README with examples
Features #
- Line Chart: Multiple series, gradient fills, interactive points
- Bar Chart: Grouped/stacked bars, rounded corners, customizable spacing
- Area Chart: Filled areas with gradients, smooth curves
- Pie Chart: Percentage labels, legend support, animations
- Donut Chart: Center value display, modern design
- Radial Chart: Multi-dimensional data visualization
- Sparkline Chart: Compact inline trend visualization
Performance #
- Single-pass bounds calculation
- Isolated repaints with RepaintBoundary
- Cached calculations
- Batched canvas operations
- Optimized text rendering
Documentation #
- Complete API documentation with dartdoc
- Usage examples for all chart types
- Performance optimization guide
- Architecture documentation
1.1.0 - 2025-11-25 #
Added #
- Optional Theme Parameter: All chart widgets now support optional
themeparameter- Charts automatically adapt to Material theme (light/dark mode) when theme is not provided
- Backward compatible - existing code with explicit themes continues to work
- Simplifies usage:
LineChartWidget(dataSets: data)now works without requiring a theme
Fixed #
- Context Menu Tap Issues: Fixed issue where only the first tap on chart elements was working
- Context menus now work correctly on all subsequent taps
- Fixed overlay blocking that prevented multiple interactions
- Improved tap handling across all chart types (Line, Bar, Area, Pie, Donut, Radial, Sparkline)
- Overlay Management: Improved context menu overlay handling
- Proper cleanup of overlays before showing new menus
- Better hit test behavior to allow taps through overlays
- Fixed selection state management
Improved #
- Performance: Enhanced tap detection and interaction handling
- Added proper state clearing when tapping outside elements
- Optimized overlay removal timing
- Better gesture detector behavior for all chart types
Changed #
themeparameter is now optional in all chart widgets:LineChartWidgetBarChartWidgetAreaChartWidgetPieChartWidgetDonutChartWidgetRadialChartWidgetSparklineChartWidgetChartContainer
1.2.0 - 2025-11-25 #
Added #
- Haptic Feedback: All chart interactions now provide haptic feedback on successful taps
- Uses
HapticFeedback.selectionClick()for better user experience - Applied to all chart types: Line, Bar, Area, Pie, Donut, Radial, Sparkline
- Uses
- Hover Support for Bar Charts: Added
onBarHovercallback to BarChartWidget- Visual feedback with elevation and border highlighting on hover
- Consistent with Line Chart hover behavior
- Hover Support for Radial Charts: Added
onPointHovercallback to RadialChartWidget- Visual feedback with glow effects and size changes on hover
- Improved interactivity for radial/radar charts
- Chart Interaction Constants: Standardized interaction parameters
ChartInteractionConstants.tapRadius = 20.0for consistent tap detectionChartInteractionConstants.hoverRadius = 30.0for hover detection- All charts now use these standardized constants
Fixed #
- Radial Chart Selection State: Fixed missing selection state management in RadialChartWidget
- Added
_selectedPointstate tracking - Passes
selectedPointandhoveredPointto RadialChartPainter - Visual feedback now works correctly for selected/hovered points
- Points now show proper glow, size, and border changes when selected
- Added
Improved #
- Performance Optimization: Removed redundant
setState()calls- All charts now use single
setState()per interaction instead of double calls - Improved rendering performance and reduced unnecessary rebuilds
- All charts now use single
- Code Consistency: Standardized onClick implementation across all charts
- All charts use
ChartInteractionConstantsfor tap/hover radius - Consistent haptic feedback pattern across all chart types
- Unified selection state management approach
- All charts use
- Visual Feedback: Enhanced hover and selection visual feedback
- Bar charts show elevation and border on hover
- Radial charts show enhanced glow and size changes
- Consistent visual language across all interactive elements
Changed #
- Bar Chart Painter: Added
hoveredBarparameter to support hover state- Visual feedback includes elevation, border, and highlight changes
- Hover state is visually distinct from selected state
- Radial Chart Painter: Added
selectedPointandhoveredPointparameters- Points now show visual feedback when selected or hovered
- Glow radius, point size, and border width adjust based on state
1.2.1 - 2025-01-27 #
Fixed #
- Theme Toggle Issue: Fixed theme not changing when clicking the theme toggle icon
- Fixed
InheritedWidget.updateShouldNotifyto properly compare theme values - Theme changes now immediately update MaterialApp and all dependent widgets
- Added proper state management for theme mode changes
- Fixed
- NaN Value Handling: Comprehensive fixes for NaN and invalid value handling
- Added validation in
pointToCanvasto filter out NaN and infinite values - Fixed axis label drawing to handle zero ranges and invalid calculations
- Added validation in all chart painters to prevent NaN offsets
- Charts now gracefully handle edge cases: empty data, zero ranges, invalid bounds
- All drawing operations now validate values before painting to prevent crashes
- Added validation in
- Line Chart Edge Cases: Fixed rendering issues with invalid data points
- Points with NaN or infinite values are now filtered out
- Bezier curve calculations validate all control points
- Area path completion handles edge cases properly
Improved #
- Error Handling: Better error handling for edge cases throughout the library
- All coordinate calculations validate inputs and outputs
- Graceful degradation when encountering invalid data
- No crashes when data contains NaN, infinity, or zero ranges
Documentation #
- Added live demo link to README
- Added screenshots section to README
- Updated documentation with edge case handling information
1.3.0 - 2025-01-27 #
Added #
- Example App: Added comprehensive example application demonstrating all chart types
- Example directory with working demo app
- Shows Line, Area, Bar, Pie, and Donut charts
- Includes interactive callbacks and theme switching
- Demonstrates best practices for using the library
Improved #
- Documentation: Enhanced documentation for AreaChartWidget
- Added comprehensive class-level documentation with examples
- Documented all public properties and constructor parameters
- Improved API documentation coverage
Fixed #
- Package Description: Shortened package description to meet pub.dev requirements (60-180 characters)
- Description now optimized for search engine display
1.3.1 - 2025-01-27 #
Improved #
- Documentation: Added comprehensive documentation for BarChartPainter
- Documented class, constructor, and all public properties
- Added examples and usage information
- Improved API documentation coverage
Fixed #
- Example Detection: Fixed .pubignore to include example directory for pub.dev detection
- Example app is now properly included in published package
- Documentation References: Fixed import for BarChartWidget reference in BarChartPainter documentation
1.4.0 - 2025-12-13 #
Added #
- 4 New Chart Types: Expanded from 8 to 12 chart types
- Scatter Chart: Relationship visualization with correlation analysis
- Bubble Chart: Three-dimensional data visualization with size encoding
- Radar Chart: Multi-dimensional data comparison with spider/web visualization
- Gauge Chart: Single metric visualization for KPIs and progress indicators
- Stacked Area Chart: Cumulative multi-series visualization with stacked layers
- Drawer Navigation: Replaced NavigationRail with Drawer for better mobile experience
- Modern drawer with gradient header
- Visual selection indicators
- Auto-close on selection
- Better mobile-friendly navigation
Improved #
- Documentation: Updated README to reflect all 12 chart types
- Complete chart type descriptions
- Updated feature list
- Replaced screenshots with animated demo video
- UI/UX: Enhanced navigation experience with drawer
- Better mobile responsiveness
- Improved visual hierarchy
- Theme-aware drawer styling
Fixed #
- Empty Dataset Test: Fixed test case that was causing assertion errors
- Replaced with informative message explaining expected behavior
- Better error handling documentation
Changed #
- Chart Count: Library now supports 12 chart types (previously 8)
- Navigation: Changed from NavigationRail to Drawer for better cross-platform support
- Demo: Replaced static screenshots with animated GIF demo
1.4.1 - 2025-12-13 #
Fixed #
- Code Formatting: Fixed Dart formatter compliance in
bubble_chart_widget.dart- Corrected multi-line constructor formatting
- Ensures package passes static analysis checks
1.5.0 - 2025-01-27 #
Added #
- Click Interaction for All Charts: Added comprehensive click interaction support across all chart types
- Step Line Chart:
onPointTapcallback with point selection and details dialog - Stacked Column Chart:
onBarTapcallback with bar selection and details dialog - Spline Chart:
onPointTapcallback with point selection and details dialog - Pyramid Chart:
onSegmentTapcallback with segment selection and details dialog - Funnel Chart:
onSegmentTapcallback with segment selection and details dialog - Radar Chart:
onPointTapcallback with point selection and details dialog - Gauge Chart:
onChartTapcallback with gauge value details dialog
- Step Line Chart:
- Visual Border Highlighting: All charts now show prominent white borders when elements are clicked
- White 3-4px borders for selected elements (vs 1.5-2px default)
- Consistent visual feedback across all chart types
- Enhanced visibility with highlight overlays for selected segments
- Chart Interaction Helpers: New helper functions for detecting interactions
findPyramidSegment()- Detects taps on pyramid chart segmentsfindFunnelSegment()- Detects taps on funnel chart segmentsfindRadarPoint()- Detects taps on radar chart points_isPointInTrapezoid()- Helper for trapezoid hit testing
- Details Dialog: Enhanced details dialog showing comprehensive chart element information
- Shows point/segment values, labels, and dataset information
- Available for all interactive chart types
- Consistent UI across all chart interactions
Improved #
- Visual Feedback: Enhanced visual feedback for all chart interactions
- Selected elements show white borders for better visibility
- Highlight overlays for selected segments in Pyramid and Funnel charts
- Glow effects for selected points in Radar charts
- Consistent border styling (3-4px white borders) across all chart types
- Interaction Consistency: Standardized interaction patterns across all charts
- All charts use the same context menu system
- Consistent haptic feedback on all interactions
- Unified details dialog presentation
- Chart Painter Updates: All painters now support selected state with border highlighting
- Line Chart: White 3px border for selected points
- Bar Chart: White 3px border for selected bars
- Pie/Donut Chart: White border (borderWidth + 3) for selected segments
- Scatter Chart: White 3px border for selected points
- Stacked Area Chart: White 3px border for selected points
- Radial Chart: White 3px border for selected points
- Spline Chart: White 3px border for selected points
- Step Line Chart: White 3px border for selected points
- Bubble Chart: White 3px border for selected bubbles
- Stacked Column Chart: White 3px border for selected bars
- Pyramid Chart: White 4px border for selected segments
- Funnel Chart: White 4px border for selected segments
- Radar Chart: White border with glow for selected points
Changed #
- Chart Widgets: All chart widgets now support click interaction callbacks
- Step Line, Stacked Column, Spline charts: Added
onPointTap/onBarTapcallbacks - Pyramid, Funnel charts: Added
onSegmentTapcallbacks - Radar chart: Added
onPointTapcallback - Gauge chart: Added
onChartTapcallback
- Step Line, Stacked Column, Spline charts: Added
- Demo Screen: Updated demo screen to show interactive examples
- All charts in demo now have click handlers
- Updated subtitles to indicate charts are interactive
- Shows details dialog when clicking on chart elements
1.5.1 - 2025-01-27 #
Fixed #
- Documentation Warnings: Fixed comment reference warnings in
ChartInteractionHelper- Corrected parameter names in
findPieSegmentdocumentation to match actual function signature - Fixed parameter references in
findRadarPointdocumentation - All documentation now accurately reflects function parameters
- Corrected parameter names in
- Pub.dev Compatibility: Removed
sample_data.dartfrom main library exportsSampleDatais now imported directly in example files- Fixes pub.dev dependency constraint validation errors
Improved #
- Documentation Coverage: Added comprehensive dartdoc comments to public APIs
- Enhanced documentation for
StepLineChartWidget,StackedColumnChartWidget - Enhanced documentation for
PyramidChartWidget,FunnelChartWidget - Added detailed documentation for all
ChartInteractionHelpermethods - Improved
ChartInteractionResultclass documentation - All public APIs now have proper dartdoc comments meeting pub.dev requirements
- Enhanced documentation for
1.5.2 - 2025-01-10 #
Fixed #
- Critical NaN Gradient Crash: Fixed application crashes when rendering charts with invalid data
- Bar Chart: Added comprehensive validation to prevent NaN values in gradient coordinates
- Validates point data (x, y values) before calculations
- Validates bar dimensions before creating gradients
- Protects against division by zero in maxYAdjusted
- All Chart Types: Applied NaN validation across all 15 chart painters
- Bubble Chart: Validates point coordinates, size, and canvas points
- Pie/Donut Chart: Validates size, radius, total values, and item values
- Stacked Column Chart: Validates bar heights and calculated dimensions
- Radar Chart: Validates angles, radius, and normalized values
- Funnel Chart: Validates segment dimensions and percentages
- Pyramid Chart: Validates segment values and calculated dimensions
- Scatter Chart: Validates point coordinates and bounds
- Radial Chart: Validates radial values and polar coordinates
- Line Chart: Enhanced existing validations for control points
- Spline Chart: Enhanced existing validations for bezier curves
- Stacked Area Chart: Enhanced existing validations for cumulative paths
- Step Line Chart: Enhanced existing validations for step patterns
- Gauge Chart: Enhanced existing validations for angles and gradients
- Charts now gracefully skip invalid data points instead of crashing
- All gradient creation operations validate rect/circle dimensions before shader creation
- Bar Chart: Added comprehensive validation to prevent NaN values in gradient coordinates
Improved #
- Error Handling: Comprehensive validation throughout all chart rendering pipelines
- All coordinate calculations validate inputs and outputs for finite values
- Dimension checks ensure positive, finite values before drawing
- Graceful degradation when encountering NaN, Infinity, or invalid ranges
- No crashes when data contains invalid numerical values
- Stability: Significantly improved application stability in Analytics sections
- Bar charts and all other chart types now handle edge cases robustly
- Invalid data is filtered out rather than causing application crashes
- Better protection against malformed or corrupted data inputs
Technical Details #
- Added
isFinitechecks for all numerical values before use in calculations - Validates dimensions (width, height, radius) are positive before creating Paint shaders
- Protects against division by zero in normalization and scaling operations
- Validates all Offset coordinates before path operations
- Ensures all gradient rect/circle bounds are valid before shader creation
[Unreleased] #
Planned #
- Unit and widget tests
- Internationalization (i18n) support
- CI/CD pipeline with GitHub Actions
- Additional chart types (Candlestick, Heatmap)
- Export functionality (PNG, SVG)
- Zoom and pan interactions
- Real-time data streaming support