fl_chart 0.4.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 98

FL Chart #

pub package APK

FL Chart Logo

💥 A library to draw fantastic charts in Flutter 💥

Chart Types #

Read MoreRead MoreRead More

Banner designed by Soheil Saffar, and samples inspired from David Kovalev, Ricardo Salazar, Dmitro Petrenko, Ghani Pradita, MONUiXD. Thank you all!

Let's get started #

1 - Depend on it #

Add it to your package's pubspec.yaml file #
  fl_chart: ^0.4.2

2 - Install it #

Install packages from the command line #
flutter packages get

3 - Learn it like a charm #

Read the docs from here
- Animations

4 - Follow the roadmap #

you can follow the roadmap from here, and (let me know your suggestions)

And the last but not least 🔥 #

🍺 pull requests are welcome! #

💰 Donation (bitcoin) 💰

Buy me some food to survive, I would add more features if I was alive #


0.4.2 #

  • implemented stacked bar chart, check the samples
  • added `groupSpace in BarChartData to apply space between bar groups
  • fixed drawing left and right titles of the BarChart
  • fixed showing gridLines bug (the grid line of exact max value of each direction doesn't show)

0.4.1 #

  • fixed handling disabled handleBuiltInTouches state bug

0.4.0 #

  • There is no FlChart class anymore, instead use LineChart, BarChart, and PieChart directly as a widget.
  • Touch handling system is improved and for sure we have some changes, there is no touchedResultSink anymore and use touchCallback function which is added to each TouchData like (LineTouchData), read more.
  • TouchTooltipData class inside LineTouchData and BarTouchData renamed to LineTouchTooltipData and BarTouchTooltipData respectively, and also TooltipItem class renamed to LineTooltipItem and BarTooltipItem.
  • spots inside LineTouchResponse renamed to lineBarSpots and type changed from LineTouchedSpot to LineBarSpot.
  • FlTouchNormapInput renamed to FlTouchNormalInput (fixed typo)
  • added showingTooltipIndicators in LineChartData to show manually tooltips in LineChart.
  • added showingIndicators in LineChartBarData to show manually indicators in LineChart.
  • added showingTooltipIndicators in BarChartGroupData to show manually tooltips in BarChart.

0.3.4 #

  • swapped horizontal and vertical semantics in FlGridData, fixed this issue.

0.3.3 #

  • added support for drawing below and above areas separately in LineChart
  • added cutOffY feature in LineChart, see this issue
  • added aboveBarData in LineChartBarData
  • BelowBarData class renamed to BarAreaData to reuse for both above and below areas
  • belowSpotsLine renamed to spotsLine in BarAreaData
  • cutOffY and applyCutOffY fields are added in BarAreaData to handle cutting of drawing below or above area
  • BelowSpotsLine renamed to BarAreaSpotsLine, and inside it checkToShowSpotBelowLine renamed to checkToShowSpotLine

0.3.2 #

  • provided default size (square with 30% smaller than screen) for the FLChart, fixed this issue.

0.3.1 #

0.3.0 #

0.2.2 #

  • fixed a typo on CHANGELOG
  • reformatted dart files with flutter format command

0.2.1 #

  • fixed #64, added a technical debt :(

0.2.0 #

  • fixed a critical got stuck in draw loop bug,
  • set BarChartGroupData x as required property to keep consistency and prevent unpredictable bugs

0.1.6 #

  • added enableNormalTouch property to chart's TouchData to handle normal taps, and enabled by default.

0.1.5 #

  • reverted getPixelY() on axis_chart_painter to solve the regression bug (fixed issue #48)
  • (fix) BelowBar considers its own color stops refs #46

0.1.4 #

  • bugfix -> fixed draw bug on BarChart when y value is very low in high scale y values (#43).

0.1.3 #

  • added SideTitles class to hold titles representation data, and used in FlTitlesData to show left, top, right, bottom titles, instead of legacy direct parameters, and implemented a reversed chart sample using this update.

0.1.2 #

  • added preventCurveOverShooting on BarData, check this issue

0.1.1 #

  • nothing important

0.1.0 #

  • added Touch Interactivity, read more about it here

0.0.8 #

  • added backgroundColor to axis based charts (LineChart, BarChart) to draw a solid background color behind the chart
  • added getDrawingHorizontalGridLine, getDrawingVerticalGridLine on FlGridData to determine how(color, strokeWidth) the grid lines should be drawn with the given value on FlGridLine

0.0.7 #

  • added ExtraLinesData in the LineChartData to draw extra horizontal and vertical lines on LineChart
  • added BelowSpotsLine in the BlowBarData to draw lines from spot to the bottom of chart on LineChart

0.0.6 #

  • fixed charts repainting bug, #16

0.0.5 #

  • added clipToBorder to the LineChartData to clip the drawing to the border, #3

0.0.4 #

  • fixed bug of adding bar with y = 0 on bar chart #13

0.0.3 #

  • renamed FlChartWidget to FlChart (our main widget) and now you have to import package:fl_chart/fl_chart.dart instead of package:fl_chart/fl_chart_widget.dart
  • renamed FlChart* to BaseChart* (parent class of our charts like PieChart)
  • renamed FlAxisChart* to AxisChart*

0.0.2 #

  • fixed minX, maxX functionality on LineChart
  • restricted to access private classes of the library

0.0.1 - Released on (2019 June 4) #


example #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  fl_chart: ^0.4.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:fl_chart/fl_chart.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/fl_chart.dart.

Run flutter format to format lib/fl_chart.dart.

Format lib/src/chart/bar_chart/bar_chart.dart.

Run flutter format to format lib/src/chart/bar_chart/bar_chart.dart.

Format lib/src/chart/bar_chart/bar_chart_data.dart.

Run flutter format to format lib/src/chart/bar_chart/bar_chart_data.dart.

Fix additional 12 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/chart/bar_chart/bar_chart_painter.dart (Run flutter format to format lib/src/chart/bar_chart/bar_chart_painter.dart.)
  • lib/src/chart/base/axis_chart/axis_chart_data.dart (Run flutter format to format lib/src/chart/base/axis_chart/axis_chart_data.dart.)
  • lib/src/chart/base/axis_chart/axis_chart_painter.dart (Run flutter format to format lib/src/chart/base/axis_chart/axis_chart_painter.dart.)
  • lib/src/chart/base/base_chart/base_chart_data.dart (Run flutter format to format lib/src/chart/base/base_chart/base_chart_data.dart.)
  • lib/src/chart/base/base_chart/base_chart_painter.dart (Run flutter format to format lib/src/chart/base/base_chart/base_chart_painter.dart.)
  • lib/src/chart/line_chart/line_chart.dart (Run flutter format to format lib/src/chart/line_chart/line_chart.dart.)
  • lib/src/chart/line_chart/line_chart_data.dart (Run flutter format to format lib/src/chart/line_chart/line_chart_data.dart.)
  • lib/src/chart/line_chart/line_chart_painter.dart (Run flutter format to format lib/src/chart/line_chart/line_chart_painter.dart.)
  • lib/src/chart/pie_chart/pie_chart.dart (Run flutter format to format lib/src/chart/pie_chart/pie_chart.dart.)
  • lib/src/chart/pie_chart/pie_chart_data.dart (Run flutter format to format lib/src/chart/pie_chart/pie_chart_data.dart.)
  • lib/src/chart/pie_chart/pie_chart_painter.dart (Run flutter format to format lib/src/chart/pie_chart/pie_chart_painter.dart.)
  • lib/src/utils/lerp.dart (Run flutter format to format lib/src/utils/lerp.dart.)


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies