progress_bar_chart_widget 1.0.0

SDKflutter
Platformandroidioswindowslinuxmacos

A Flutter plugin for creating beautiful progress bar charts with multiple data series, legends, and animations.

progress_bar_chart_widget

A Flutter plugin for creating beautiful, customizable progress bar charts with support for multiple data series, legends, and smooth animations.

Screenshots

AndroidiOSWeb
AndroidiOSWeb

Features

  • Display progress bar charts with current, previous, and average values
  • Animated and static chart widgets
  • Customizable colors, sizes, legends, and styles
  • Supports all major Flutter platforms: Android, iOS, Web, macOS, Windows, Linux
  • Easy integration and flexible API

Installation

Add this to your pubspec.yaml:

dependencies:
  progress_bar_chart_widget: ^1.0.0

Then run:

flutter pub get

Usage

Import the package:

import 'package:progress_bar_chart_widget/progress_bar_chart.dart';

Basic Example

ProgressBarChart(
  data: ChartData(
    title: 'Revenue',
    subtitle: 'US 4, In Thousands',
    currentValue: 2.5,
    previousValue: 3.2,
    averageValue: 4.0,
    maxValue: 5.0,
    unit: 'k',
  ),
)

Animated Example

AnimatedProgressBarChart(
  data: ChartData(
    title: 'Sales Performance',
    subtitle: 'Monthly Sales Data',
    currentValue: 85,
    previousValue: 70,
    averageValue: 95,
    maxValue: 120,
    unit: '%',
  ),
  animationDuration: Duration(milliseconds: 2000),
)

Customization

You can customize colors, bar height, border radius, legend, and more:

ProgressBarChart(
  data: ChartData(
    title: 'Website Traffic',
    subtitle: 'Monthly Visitors',
    currentValue: 12500,
    previousValue: 10200,
    averageValue: 15000,
    maxValue: 20000,
  ),
  currentColor: Color(0xFFEF4444),
  previousColor: Color(0xFFF87171),
  averageColor: Color(0xFFD1D5DB),
  backgroundColor: Color(0xFFF9FAFB),
  customLegend: [
    LegendItem(color: Color(0xFFEF4444), label: 'Current'),
    LegendItem(color: Color(0xFFF87171), label: 'Previous'),
    LegendItem(color: Color(0xFFD1D5DB), label: 'Target'),
  ],
  height: 30,
  borderRadius: 15,
  showLegend: true,
  padding: EdgeInsets.all(12),
)

Compact Version

ProgressBarChart(
  data: ChartData(
    title: 'CPU Usage',
    subtitle: 'System Performance',
    currentValue: 65,
    previousValue: 45,
    averageValue: 80,
    maxValue: 100,
    unit: '%',
  ),
  height: 30,
  borderRadius: 15,
  showLegend: false,
  padding: EdgeInsets.all(12),
  currentColor: Color(0xFF3B82F6),
  previousColor: Color(0xFF93C5FD),
  averageColor: Color(0xFFE5E7EB),
)

API Reference

ChartData

PropertyTypeDescription
titleStringMain title of the chart
subtitleStringSubtitle or description
currentValuedoubleCurrent value
previousValuedoublePrevious value
averageValuedoubleAverage or target value
maxValuedoubleMaximum value for the axis
unitString(Optional) Unit label

ProgressBarChart & AnimatedProgressBarChart

PropertyTypeDefaultDescription
dataChartData-Chart data
currentColorColorIndigo (0xFF6366F1)Color for current value
previousColorColorPurple (0xFFA855F7)Color for previous value
averageColorColorGray (0xFFE5E7EB)Color for average value
backgroundColorColorGray (0xFFF9FAFB)Background color
heightdouble40.0Height of the bar
borderRadiusdouble20.0Border radius of the bar
showLegendbooltrueShow/hide legend
customLegendList?nullCustom legend items
titleStyleTextStyle?nullCustom title style
subtitleStyleTextStyle?nullCustom subtitle style
paddingEdgeInsetsEdgeInsets.all(16.0)Padding around the chart
markerWidthdouble3.0Width of the marker line
markerColorColorGray (0xFF374151)Color of the marker line
animationDurationDuration1500ms (animated only)Animation duration

Platform Support

  • Android
  • iOS
  • Web
  • macOS
  • Windows
  • Linux

Example App

See the example/ directory for a complete app demonstrating all features and customization options.

License

This project is licensed under the LICENSE file. Please add your license.