tp_charts 1.1.0
tp_charts: ^1.1.0 copied to clipboard
Beautiful animated chart widgets for Flutter with customizable styling. Includes CustomLineChart (with built-in filters), SimpleLineChart (external filtering), and HotChart (gauge-style).
1.1.0 #
π― Major Date Label Formatting Improvement #
π New Features
- PeriodType Enum: Added
PeriodTypeenum with values:hour,day,week,month,year,custom - Smart Period-Based Formatting: SimpleLineChart now formats date labels appropriately based on the period type
- Explicit Period Control: New
periodTypeparameter in SimpleLineChart for precise label formatting control
π Bug Fixes
- Fixed Inappropriate Hour Display: Resolved issue where hour labels (
HH:mm) were shown even when filtering by week, month, or year - Intelligent Auto-Detection: Improved
PeriodType.customlogic to never show hours for inappropriate periods
π Label Formatting Logic
- Week Filter (
PeriodType.week): Shows weekday abbreviations ("Seg", "Ter", "Qua"...) - Month Filter (
PeriodType.month): Shows dates in dd/MM format ("15/09", "16/09"...) - Year Filter (
PeriodType.year): Shows month abbreviations ("Jan", "Fev", "Mar"...) - Custom/Auto (
PeriodType.custom): Intelligent detection, but never shows hours for short periods
π Backward Compatibility
- Default Behavior: Uses
PeriodType.customby default, maintaining existing API compatibility - Enhanced Logic: Existing code works better with improved auto-detection that avoids inappropriate hour labels
π Example Usage
// Week view - shows weekdays
SimpleLineChart(
dates: dates,
yValues: values,
periodType: PeriodType.week,
)
// Month view - shows dates
SimpleLineChart(
periodType: PeriodType.month,
)
// Year view - shows months
SimpleLineChart(
periodType: PeriodType.year,
)
// Auto-detect (default) - improved logic
SimpleLineChart(
// periodType: PeriodType.custom (default)
)
1.0.7 #
Visual Fidelity & Polish Update #
π¨ Visual Improvements
- SimpleLineChart Visual Fidelity: Fixed visual inconsistencies with CustomLineChart
- Smooth Cubic Curves: Implemented proper cubic BΓ©zier curves matching CustomLineChart style
- Gradient Fill: Added proper gradient background fill below the line
- Animation Opacity: Added proper opacity animation for line rendering
π§ Technical Improvements
- Cubic Control Points: Replaced quadratic curves with cubic curves for smoother appearance
- Dynamic Gradient: Implemented dynamic LinearGradient creation for consistent visual style
- Animation Integration: Proper integration of animation values with rendering
1.0.6 #
SimpleLineChart Introduction & Major Improvements #
β¨ New Features
- SimpleLineChart: New chart widget without built-in filter buttons for maximum flexibility
- External Date Filtering: Filter data through
startDateandendDateparameters - Smart Tooltip Positioning: Tooltips now stay within widget bounds automatically
- Improved Number Formatting: Generic number formatting without assuming currency
π§ Architecture
- Two Chart Options:
CustomLineChart: With built-in filter buttons (existing)SimpleLineChart: External filtering only (new)
- Flexible Design: Choose the right chart for your use case
π Bug Fixes
- Tooltip Positioning: Fixed tooltip breaking outside visual container
- Generic Values: Removed automatic "R$" formatting for better reusability
- Animation Timers: Fixed timer conflicts in test environments
π Documentation
- Comprehensive Examples: Added example app demonstrating both chart types
- Clear Comparison: Documentation explaining when to use each chart type
- Better README: Restructured documentation for clarity
1.0.5 #
HotChart Parameter Cleanup #
π Bug Fixes
- Fixed Duplicate Parameters: Removed duplicate color parameters (
goodColor,averageColor,badColor) that were causing confusion - Clean Constructor: Cleaned up HotChart constructor to only include the correct parameters
- Improved IDE Support: Fixed parameter recognition in external projects
π§ Parameter Changes
- Removed:
goodColor,averageColor,badColor(deprecated) - Kept:
excellentColor,regularColor,poorColor(current system) - Consistency: All parameters now follow the percentage-based status system
π Developer Experience
- Better IntelliSense support in IDEs
- Clear parameter documentation
- No more parameter conflicts
1.0.4 #
New Widget: HotChart - Gauge Style Chart #
π― New Features
- HotChart Widget: Added new gauge/speedometer style chart widget
- Percentage-Based Status: Status determination based on percentage ranges (0-30% = Excellent, 30-60% = Regular, 60%+ = Poor)
- Customizable Status Colors: Full control over colors for each status level (excellent, regular, poor)
- Customizable Status Text: Configurable text labels for each status level
- Smooth Animations: Beautiful entrance animations with customizable duration
- Flexible Sizing: Configurable chart size with responsive design
π¨ Styling Options
- Custom Colors: Individual colors for excellent, regular, and poor status levels
- Track Customization: Configurable track color and width
- Text Styling: Customizable value and status text styles
- Animation Control: Optional animations with configurable duration
π HotChart Usage
HotChart(
currentValue: 45.0,
minValue: 0.0,
maxValue: 100.0,
size: 200,
showStatusText: true,
excellentStatusText: 'Γtimo',
regularStatusText: 'Regular',
poorStatusText: 'Ruim',
)
π§ Technical Implementation
- Custom painter for gauge drawing with LinearGradient support
- Percentage-based status calculation
- Smooth color transitions between status levels
- Responsive text positioning and sizing
1.0.3 #
Critical Bug Fix for Single Data Point Charts #
π Critical Bug Fix
- Fixed NaN Offset Error: Resolved critical rendering issue where single data point charts caused NaN (Not a Number) values in canvas drawing
- Single Point Positioning: Fixed calculation for centering single data points in chart area
- Division by Zero: Prevented division by zero when calculating point spacing (dx) for single-point datasets
π― Improvements
- Better error handling for edge cases in chart rendering
- More robust calculations for single data point scenarios
- Enhanced stability for charts with minimal data
π§ Technical Details
- Fixed
dx = chartWidth / (data.length - 1)calculation whendata.length = 1 - Improved
_calculatePointsfunction to handle single points correctly - Added proper centering logic for single data points
1.0.2 #
Smart X-Axis Labels for Large Datasets #
β¨ New Features
- Intelligent Label Display: Automatically limits X-axis labels to prevent overcrowding
- Label Rotation: Rotate labels when they overlap to save horizontal space
- Smart Label Selection: Shows first, last, and evenly distributed labels for optimal readability
π§ New Parameters
maxXLabels: Maximum number of X-axis labels to display (default: 8)rotateLabels: Enable label rotation for space-saving (default: false)labelRotation: Rotation angle for labels in radians (default: 45Β°)
π― Improvements
- Better handling of large datasets (100+ data points)
- Prevents X-axis label overlap and visual clutter
- Maintains readability across different screen sizes
- Optimized performance for charts with many data points
π Bug Fixes
- Fixed X-axis label overcrowding with large datasets
- Improved label positioning for rotated text
- Better canvas state management for label rendering
π Documentation
- Added examples for large dataset handling
- Updated parameter documentation
- Enhanced usage examples for label customization
1.0.1 #
Enhanced Grid and Single Point Support #
β¨ New Features
- Dynamic Grid Count: Automatically adjust grid lines based on data size
- Single Data Point Support: Charts now work with just 1 data point
- Flexible Grid Control: User-defined min/max grid line limits
π§ New Parameters
autoGridCount: Enable automatic grid adjustment (default: false)maxGridCount: Maximum number of grid lines when using auto mode (default: 10)minGridCount: Minimum number of grid lines when using auto mode (default: 3)
π― Improvements
- Better handling of edge cases (single point, zero range)
- Improved grid rendering for small datasets
- Enhanced visual representation for single data points
- More robust chart rendering across different data sizes
π Bug Fixes
- Fixed assertion that required minimum 2 data points
- Fixed grid calculation for single value datasets
- Improved chart drawing for edge cases
π Documentation
- Updated README with new grid parameters
- Added examples for single point charts
- Enhanced parameter documentation
1.0.0 #
Initial Release #
β¨ Features
- Beautiful animated line charts with smooth entrance animations
- Interactive hover effects with tooltips
- DateTime-based filtering (Today, This Week, This Year, All Period)
- Support for both DateTime and String data on X-axis
- Customizable colors, gradients, and styling options
- Responsive design for all screen sizes
- Cross-platform support (iOS, Android, Web, Desktop)
π± Widgets
CustomLineChart: Main chart widget with extensive customization optionsChartFilterButton: Reusable filter button component
π¨ Customization Options
- Line colors and gradients
- Grid line appearance
- Point styling and hover effects
- Tooltip appearance and positioning
- Animation duration and curves
- Text styles and colors
π Data Support
- DateTime objects for time-based data
- String labels for categorical data
- Automatic filtering based on date ranges
- Smooth interpolation between data points
π§ Technical Features
- Built with Flutter's CustomPainter for optimal performance
- Responsive layout with automatic scaling
- Memory-efficient rendering
- Smooth 60fps animations