### README (README.md) [](https://pub.dartlang.org/packages/fl_chart) [](https://codecov.io/gh/imaNNeo/fl_chart) Awesome Flutter GitHub Repo stars GitHub contributors GitHub closed issues Buy Me A Coffee donate button ### Our Financial Heroes Your financial support acts as fuel for fl_chart's development. [Support here](https://github.com/sponsors/imaNNeo).
Become a sponsor
### Overview FL Chart is a highly customizable Flutter chart library that supports **[Line Chart](https://app.flchart.dev/#/line)**, **[Bar Chart](https://app.flchart.dev/#/bar)**, **[Pie Chart](https://app.flchart.dev/#/pie)**, **[Scatter Chart](https://app.flchart.dev/#/scatter)**, and **[Radar Chart](https://app.flchart.dev/#/radar)**.

### Chart Types |LineChart |BarChart |PieChart | |:------------:|:------------:|:-------------:| | [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-1-source-code) [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-2-source-code) | [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-1-source-code) [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-2-source-code) | [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/pie_chart.md#sample-1-source-code) [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/pie_chart.md#sample-2-source-code) | |[Read More](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md)|[Read More](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md)|[Read More](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/pie_chart.md)| |ScatterChart |RadarChart| CandlestickChart| |:------------:|:------------:|:-------------:| | [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#sample-1-source-code) [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#sample-2-source-code) | | | |[Read More](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md)|[Read More](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/radar_chart.md)|[Read More](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/candlestick_chart.md)| Banner designed by [Soheil Saffar](https://www.linkedin.com/in/soheilsaffar), and samples inspired from [David Kovalev](https://dribbble.com/shots/5560237-Live-Graphs-XD), [Ricardo Salazar](https://dribbble.com/shots/1956890-Data-Stats), [Dmitro Petrenko](https://dribbble.com/shots/5425378-Mobile-Application-Dashboard-for-Stock-Platform), [Ghani Pradita](https://dribbble.com/shots/6379476-Calories-Management-App), [MONUiXD](https://www.uplabs.com/posts/chart-pie-chart-bar-chart). Thank you all! # Let's get started First of all, you need to add the `fl_chart` in your project. To do that, follow [this guide](https://pub.dev/packages/fl_chart/install). Then you need to read the docs. Start from [here](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/index.md). We suggest that you check the sample source code. ##### - You can read about the animation handling [here](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/handle_animations.md) |Sample1 |Sample2 |Sample3 | |:------------:|:------------:|:-------------:| | [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-1-source-code) | [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-2-source-code) | [](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-1-source-code) | ### Try it out You can try the FL Chart sample app on the platforms that are available below: [](https://play.google.com/store/apps/details?id=dev.flchart.app) [](https://apps.apple.com/us/app/fl-chart/id6476523019) [](https://app.flchart.dev) [//]: # ([![Download for macOS](https://img.shields.io/badge/Download-for%20macOS-darkblue?style=for-the-badge&logo=apple&logoColor=white)](https://apps.apple.com/app/your-macos-app-id)) [//]: # ([![Download for Linux](https://img.shields.io/badge/Download-for%20Linux-orange?style=for-the-badge&logo=linux&logoColor=white)](https://your-linux-distribution-link.com)) [//]: # ([![Download for Windows](https://img.shields.io/badge/Download-for%20Windows-blue?style=for-the-badge&logo=windows&logoColor=white)](https://your-windows-app-link.com)) ### Donation Your donation motivates me to work more on the fl_chart and resolve more issues. There are multiple ways to donate to me: 1. You can be my sponsor on [GitHub](https://github.com/sponsors/imaNNeo) (This is the most reliable way to donate to me) 2. You can buy me a coffee! 3. Or if you are a fan of crypto, you can donate me Bitcoins here: `1L7ghKdcmgydmUJAnmYmMaiVjT1LoP4a45` ### Contributing ##### :beer: Pull requests are welcome! Remember that open-source projects thrive on contributions. Every improvement—no matter how small—makes a meaningful difference, even if it’s just a single line. Our documentation may contain grammatical issues, and if you’re fluent in English, your help in correcting them would be greatly appreciated. Check out [CONTRIBUTING.md](https://github.com/imaNNeo/fl_chart/blob/main/CONTRIBUTING.md), which contains a guide for those who want to contribute to the FL Chart. Reporting bugs and issues is also a contribution, yes, it is. #### Below are the people who have contributed to the FL Chart. We hope we have your picture here soon. [](https://github.com/imaNNeo/fl_chart/graphs/contributors) --- ### .Codecov.Yml (.codecov.yml) comment: require_changes: true coverage: status: project: default: target: auto threshold: 1% patch: default: target: 50% threshold: 10% precision: 1 range: "80...100" # Ignore all the file inside the example and # end eventually also the autogenerate file ignore: - '**/example/' - '**/*.g.dart' --- ### Analysis Options.Yaml (analysis_options.yaml) include: package:very_good_analysis/analysis_options.yaml analyzer: exclude: - "**.mocks.dart" linter: rules: always_put_required_named_parameters_first: false avoid_bool_literals_in_conditional_expressions: false avoid_positional_boolean_parameters: false comment_references: false library_private_types_in_public_api: false lines_longer_than_80_chars: false no_default_cases: false parameter_assignments: false prefer_asserts_with_message: false prefer_constructors_over_static_methods: false public_member_api_docs: false use_if_null_to_convert_nulls_to_bools: false use_setters_to_change_properties: false avoid_catches_without_on_clauses: false --- ### CHANGELOG (CHANGELOG.md) ## 1.2.0 * **BUGFIX** (by @imaNNeo) Consider the `enabled` property in [LineTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling), [BarTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartouchdata-read-about-touch-handling), [PieTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/pie_chart.md#pietouchdata-read-about-touch-handling), [ScatterTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scattertouchdata-read-about-touch-handling), [RadarTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/radar_chart.md#radartouchdata-read-about-touch-handling) and [CandlestickTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/candlestick_chart.md#candlesticktouchdata-read-about-touch-handling), #1676 * **BUGFIX** (by @artshooter) Fix wrong bar chart color with small value, #1757 * **FEATURE** (by @3ph) Add `horizontalMirrored` and `verticalMirrored` properties in our `LabelDirection` enum which is used in ([HorizontalLineLabel](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#HorizontalLineLabel) and [VerticalLineLabel](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#VerticalLineLabel)), #1890 * **FEATURE** (by @Vizten18) Add `cornerRadius` property in the [PieChartSectionData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/pie_chart.md#piechartsectiondata), #1175 * **IMPROVEMENT** (by @imaNNeo) Add convention and linter (checker) for PRs title and updated contributing guideline. We're gonna have automated changelog generation from the next release * **BUGFIX** (by @diymelvin) Fix inverted lowerBy/upperBy in error range calculation, #2031 * **FEATURE** (by @imaNNeo) Add `label` property in the [BarChartRodData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartroddata) to allow you to show a label on top of each bar rod, #2071, #84 ## 1.1.1 * **IMPROVEMENT** (by @imaNNeo) Upgrade `vector_math` dependency to `2.2.0`, #1985 * **IMPROVEMENT** (by @imaNNeo) Upgrade `build_runner` (dev) dependency to `2.8.0` * **IMPROVEMENT** (by @imaNNeo) Upgrade `mockito` (dev) dependency to `5.5.1` * **IMPROVEMENT** (by @imaNNeo) Upgrade `very_good_analysis` (dev) dependency to `9.0.0` ## 1.1.0 * **FEATURE** (by @kamilJ96) Add `gradient` property inside our `BarChartRodStackItem` to be able to render gradient (along with the possibility to render a solid color), #919 * **FEATURE** (by @alettsy) Add `sideTitleAlignment` property in our `AxisTitles` to allow you to control the alignment of side titles (for example show them inside the chart), #1946 * **FEATURE** (by @huanghui1998hhh) Add `gradientArea` property to `LineChartBarData` to allow you to control the scope of gradient effects, #1925 * **FEATURE** (by @alikhavarii13) Add `label` and `labelStyle` properties in our `BarChartRodStackItem` to allow you to show labels on each stack item, #598 * **BREAKING** ⚠️ (by @alikhavarii13) `borderSide` now is a [named parameter](https://dart.dev/language/functions#named-parameters) (instead of a [optional positional parameter](https://dart.dev/language/functions#optional-positional-parameters) in `BarChartRodStackItem` constructor. As it is a very minor breaking change, we decided to include it in this minor release (instead of doing a major release based on the [semantic versioning](https://semver.org/). Sorry about that! So you just need to change this: ```dart BarChartRodStackItem( 0, 10, Colors.green, BorderSide(color: Colors.white), ), ``` to this: ```dart BarChartRodStackItem( 0, 10, Colors.green, borderSide: BorderSide(color: Colors.white), ), ``` ## 1.0.0 Image * **FEATURE** (by @imaNNeo) Implement a new chart type called CandlestickChart. You can take a look at the documentation [here](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/candlestick_chart.md). And I just implemented a basic example to show the Bitcoin price in 2024, you can take a look at it in our sample app [here](https://app.flchart.dev/#/candlestick). #433, #1143 Image * **BREAKING** (by @imaNNeo) Remove the deprecated `tooltipRoundedRadius` property -> you should use `tooltipBorderRadius` instead. * **BUGFIX** (by @imaNNeo) Fix the BarChartData mismatch issue when changing the data, #1911 * **FEATURE** (by @frybitsinc) Add fillGradient property in [RadarDataSet](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/radar_chart.md#radardataset) * **BREAKING** (by @imaNNeo) Upgrade the min flutter version to `3.27.4`. So please make sure that your project is not using an old flutter version, #1846 * **IMPORTANT** (by @imaNNeo) You can read more about this release and the history of fl_chart here in my [blog post](https://flutter4fun.com/fl-chart-1-0-0) ## 0.71.0 * **IMPROVEMENT** (by @MattiaPispisa) Add a new property called `BorderRadius tooltipBorderRadius` instead of (deprecated) `double tooltipRoundedRadius` in `BarTouchTooltipData`, `LineTouchTooltipData` and `ScatterTouchTooltipData` #1715 * **FEATURE** (by @frybitsinc) Add `children` property in our [RadarChartTitle](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/radar_chart.md#radarcharttitle), #1840 * **BUGFIX** (by @morvagergely) Fix the initial zoom issue in our scrollable LineChart, #1863 ## 0.70.2 * **FEATURE** (by @imaNNeo) Add error range feature in our axis-based charts. You can set `xError` and `yError` in the [FlSpot](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#flspot) or `toYErrorRange` in [BarChartRodData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartroddata). Also we have `errorIndicatorData` property in our [LineChartData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartdata), [BarChartData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartdata) and [ScatterChartData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scatterchartdata) that is responsible to render the error bars. You can take a look at the [LineChartSample 13](https://github.com/imaNNeo/fl_chart/blob/main/example/lib/presentation/samples/line/line_chart_sample13.dart) and [BarChartSample 8](https://github.com/imaNNeo/fl_chart/blob/main/example/lib/presentation/samples/bar/bar_chart_sample8.dart) in our [sample app](https://app.flchart.dev), #1483 ## 0.70.1 * **FEATURE** (by @Peetee06) Add `panEnabled` and `scaleEnabled` properties in the TransformationController, #1818 * **FEATURE** (by @mitulagr2) Add `renderPriority` feature in our [ScatterSpot](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scatterspot), #1545 * **FEATURE** (by @imaNNeo) Add `rotationQuarterTurns` property in our Axis-Based charts (such as [LineChart](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md), [BarChart](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md) and [ScatterChart](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md)). It allows you to rotate the chart 90 degrees (clockwise) in each turn. For example you can have Horizontal Bar Charts by setting `rotationQuarterTurns` to 1 (which rotates the chart 90 degrees clockwise). It works exactly like [RotatesBox](https://api.flutter.dev/flutter/widgets/RotatedBox-class.html) widget, #113 * **FEATURE** (by @soraef) Add `isMinValueAtCenter` property in the [RadarChart](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/radar_chart.md) to allow the user to set the minimum value at the center of the chart, #1351, #1442 * **BREAKING** (by @imaNNeo) Add `TitleMeta` parameter in the `SideTitleWidget` instead of `axisSide` ## 0.70.0 * **FEATURE** (by @Peetee06) Implemented a 5 years-old feature request about scroll and zoom support in our axis-based charts. Special thanks to @Peetee06 who made it happen, #71 * **IMPROVEMENT** (by @Peetee06) Added functionality to control the transformation of axis-based charts using `FlTransformationConfig` class. You can now enable scaling and panning for `LineChart`, `BarChart` and `ScatterChart` using this class * **IMPROVEMENT** (by @Peetee06) Added some new unit tests in `bar_chart_data_extensions_test.dart`, `gradient_extension_test.dart` and fixed a typo in `bar_chart_data.dart` * **BREAKING** (by @Peetee06) Fixed the equatable functionality in our BarChart. We hope it will not affect anything in our chart, but because the behaviour is changed, we marked it as a breaking change. (read more [here](https://github.com/imaNNeo/fl_chart/pull/1789#discussion_r1858371718)) * **BREAKING** (by @Peetee06) `BarChart` is not const anymore due to adding an assert to check if transformations are allowed depending on the `BarChartData.alignment` property (read more [here](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.70.0/MIGRATION_00_70_00.md)) * **IMPROVEMENT** (by @Peetee06) Upgrade to the new Flutter version ([3.27.0](https://medium.com/flutter/whats-new-in-flutter-3-27-28341129570c)), #1804 * **IMPROVEMENT** (by @AliAkberAakash) Minor typo fix in our line chart documentation, #1795 * **IMPROVEMENT** (by @imaNNeo) Fixed the code coverage API rate-limit issue * **Improvement** (by @imaNNeo) Published the example app in Google Play and App Store. Other stores (such as [snap store](https://snapcraft.io/store) and [Microsoft Store](https://apps.microsoft.com/home)) will come next. You can download the Android version here in [Google Play](https://play.google.com/store/apps/details?id=dev.flchart.app) and the iOS version here in [App Store](https://apps.apple.com/us/app/fl-chart/id6476523019) ## 0.69.2 * **IMPROVEMENT** (by @imaNNeo) Fix the analyzer warnings (to have maximum score in the [pub.dev](https://pub.dev/packages/fl_chart/score)) ## 0.69.1 * **IMPROVEMENT** (by @moshe5745) Update the docs related to line chart's `duration` and `curve` properties, #1618 * **IMPROVEMENT** (by @imaNNeo) Deprecate `swapAnimationDuration` and `swapAnimationCurve` properties to use `curve` and `duration` instead to keep the consistency over the project, #1618 * **BUGFIX** (by @aimawari) Fixed lots of issues related to the zero value in the PieChartSectionData, #697, #817 and #1632 ## 0.69.0 * **BUGFIX** (by @imaNNeo) Fix a memory leak issue in the axis-based charts, there was a logic to calculate and cache the minX, maxX, minY and maxY properties to reduce the computation cost. But it caused some memory issues, as we don't have a quick solution for this, we disabled the caching logic for now, later we can move the calculation logic to the render objects to keep and update them only when the data is changed, #1106, #1693 * **BUGFIX** (by @imaNNeo) Fix showing grid lines even when there is no line to show in the LineChart, #1691 * **IMPROVEMENT** (by @sczesla) Allow users to control minIncluded and maxIncluded using SideTitles, #906 * **IMPROVEMENT** (by @elizabethzhenliu) Reverse the touch order in ScatterChart, so now the top spots are touched first, #1675 * **IMPROVEMENT** (by @ksw2000) Remove redundant math import, #1683 * **IMPROVEMENT** (by @Neer-Pathak) Fix linux example build issue, #1668 * **IMPROVEMENT** (by @TobiasRump) Update the bar chart documentation, #1662 ## 0.68.0 * **Improvement** (by @imaNNeo) Update LineChartSample6 to implement a way to show a tooltip on a single spot, #1620 * **Feature** (by @herna) Add `titleSunbeamLayout` inside the [BarChartData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartdata) to allow the user to customize the layout of the title sunbeam * **Improvement** (by @imaNNeo) Add LineChart and BarChart explanation videos on top of the respective documentation pages ([LineChart video](https://youtu.be/F3wTxTdAFaU?si=8lwlypKjt-0aJJK0), [BarChart video](https://youtu.be/vYe0RY1nCAA?si=30q_7eNn9MDLcph4)) ## 0.67.0 * **FEATURE** (by @julien4215) Add direction property to the [HorizontalLineLabel](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#horizontallinelabel) and [VerticalLineLabel](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#verticallinelabel), #1574 * **FEATURE** (by @apekshamehta) Added new method called getTooltipColor for axis charts (bar,line,scatter) to change background color of tooltip dynamically, #1279. * **BREAKING** (by @apekshamehta) Removed tooltipBgColor property from Bar, Line and Scatter Charts (you can now use `getTooltipColor` which provides more customizability), checkout the [full migration guide here](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.67.0/MIGRATION_00_67_00.md). ```dart /// Migration guide: /// This is the old way: BarChartData( barTouchData: BarTouchData( touchTooltipData: BarTouchTooltipData( tooltipBgColor: Colors.blueGrey, ) ) ) /// This is the new way: BarChartData( barTouchData: BarTouchData( touchTooltipData: BarTouchTooltipData( getTooltipColor: (BarChartGroupData group) => Colors.blueGrey, ) ) ) ``` ## 0.66.2 * **BUGFIX** (by @stwarwas) Remove dart.io to fix web platform issue, #1577 ## 0.66.1 * **BUGFIX** (by @imaNNeo) Fix PieChart blackout issue, #1538 * **BUGFIX** (by @imaNNeo) Fix memory leak in LineChart and BarChart, #1106 ## 0.66.0 * **IMPROVEMENT** (by @imaNNeo) Add Flutter sdk constraints to the pubspec.yaml to force the user/developer to upgrade the Flutter version to 3.16.0 (latest), #1509 * **IMPROVEMENT** (by @imaNNeo) Add `dotPainter` property to ScatterSpot to allow customizing the dot painter, #568 * **BREAKING** (by @imaNNeo) Remove `color` and `radius` properties from ScatterSpot (use `dotPainter` instead), #568 * **BREAKING** (by @imaNNeo) Change the default value of FlDotCirclePainter.`strokeWidth` to 0.0 ```dart /// Migration guide: /// This is the old way: ScatterSpot( 2, 5, color: Colors.red, radius: 12, ) /// This is the new way: ScatterSpot( 2, 8, dotPainter: FlDotCirclePainter( color: Colors.red, radius: 22, ), ), ``` * **BUGFIX** (by @imaNNeo) Fix barChart tooltip for values below or above the 0 point, #1462 * **BUGFIX** (by @imaNNeo) Fix pieChart drawing single section on iPhone, #1515 * **IMPROVEMENT** (by @imaNNeo) Add gradient property to the [HorizontalLine](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#horizontalline) and [VerticalLine](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#verticalline), #1525 * **FEATURE** (by @raldhafiri) Add gradient property to the [PieChartSectionData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/pie_chart.md#piechartsectiondata), #1511 * **IMPROVEMENT** (by @imaNNeo) Rename default branch `master` to `main` * **IMPROVEMENT** (by @imaNNeo) Update flutter sdk constraints to remove the upper bound limit (Read more [here](https://dart.dev/go/flutter-upper-bound-deprecation)). ## 0.65.0 * **FEATURE** (by @Dartek12) Added gradient to [FlLine](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#FlLine), #1197 * **BUGFIX** (by @imaNNeo) Fix bar line shadow crash when we have only one (or zero) spot, #1466 * **BUGFIX** (by @imaNNeo) Fix having negative `toY` (or positive `fromY`) in BarChart's `minY` and `maxY` calculations, #1470 * **BUGFIX** (by @bobatsar) Fix bars drawn outside of diagram * **FEATURE** (by @k0psutin) Add dashed border to BarChartRodData, #1144 * **FEATURE** (by @imaNNeo) Allow to show single point line in LineChart, #1438 ## 0.64.0 * **BUGFIX** (by @Anas35) Fix Tooltip not displaying when value from BackgroundBarChartRodData is less than zero. #1345. * **BUGFIX** (by @imaNNeo) Fix Negative BarChartRodStackItem are not drawn correctly bug, #1347 * **BUGFIX** (by @imaNNeo) Fix bar_chart_helper minY calculation bug, #1388 * **IMPROVEMENT** (by @imaNNeo) Consider fraction digits when formatting chart side titles, #1267 ## 0.63.0 * **BUGFIX** (by @imaNNeo) Fix PieChart crash on web-renderer html by ignoring `sectionsSpace` when `Path.combine()` does not work (it's flutter engine [issue](https://github.com/flutter/flutter/issues/44572)), #955 * **BUGFIX** (by @imaNNeo) Fix ScatterChart long-press interaction bug (disappears when long-pressing on the chart), #1318 * **FEATURE** (by @imaNNeo) Upgrade dart version to [3.0](https://dart.dev/resources/dart-3-migration) ## 0.62.0 * **BUGFIX** (by @JoshMart) Fix extra lines not painting when at chart min or max, #1255. * **BUGFIX** (by @imaNNeo) Check if mounted before calling setState in _handleBuiltInTouch methods in bar, line and scatter charts, #1101 * **FEATURE** (by @MagdyYacoub1): Added gradient color to [RangeAnnotations](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#rangeannotations) by adding gradient attribute to [horizontalRangeAnnotations](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#horizontalrangeannotation) and [VerticalRangeAnnotation](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#verticalrangeannotation), #1195. * **BUGFIX** (by @Motionz-Von)Fix windows build for example app * **FEATURE** (by @Motionz-Von)BarChart groupSpace also takes effect when alignment is BarChartAlignment.end or BarChartAlignment.start. * **FEATURE** (by @Motionz-Von) supports setting line StrokeCap on HorizontalLine/VerticalLine * **BUGFIX** (by @nav-28) Fix radar chart tick and graph point not matching #1078 * **IMPROVEMENT** (by @imaNNeo) Update LineChartSample5 to demonstrate click to toggle show/hide tooltip, #118 ## 0.61.0 * **IMPROVEMENT** (by @imaNNeo) Remove assertion to check to provide only one of `color` or `gradient` property in the [BarChartRodData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartroddata) and [BackgroundBarChartRodData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#backgroundbarchartroddata), #1121. * **IMPROVEMENT** (by @imaNNeo) Make `drawBehindEverything` property default to `true` in [AxisTitles](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#axistitle) class, #1097. * **BUGFIX** (by @imaNNeo) Show `0` instead of `-0` in some edge-cases in the default titles * **FEATURE** (by @tamasapps): Add `tooltipHorizontalAlignment` and `tooltipHorizontalOffset` property in [LineTouchTooltipData], [BarTouchTooltipData], [ScatterTouchTooltipData]. * **FEATURE** (by @dhiyaaulauliyaa) Add ability to force SideTitle to be placed inside its corresponding axis bounding box, #603. ## 0.60.0 * **IMPROVEMENT** (by @lsaudon) Replace flutter_lints by very_good_analysis * **BREAKING** (by @lsaudon) Update dart sdk to 2.17.0 (flutter 3.0.0) * **BUGFIX** (by @imaNNeo) Fix indicator out of range error in line chart, #1187 * **FEATURE** (by @HTsuruo): Add `longPressDuration` optional property that allows to control the duration LongPress gesture occurs, #1114 #1127. * **IMPROVEMENT** (by @imaNNeo) Add some screenshots in `pubspec.yaml` to support new [pub.dev](pub.dev) feature. Read more about it [here](https://dart.dev/tools/pub/pubspec#screenshots) and [here](https://medium.com/dartlang/screenshots-and-automated-publishing-for-pub-dev-9bceb19edf79). * **IMPROVEMENT** (by @imaNNeo) Update the homepage url in `pubspec.yaml` (I just renamed my username) * **FEATURE** (by @JoshMart) Add ability to draw extra horizontal lines on BarChart, #476 * **FEATURE** (by @soraef) Add a `positionPercentageOffset` optional property to RadarChartTitle to allow individual title positioning * **BUGFIX** (by @imaNNeo) Allow to draw empty radarChart (with all zero values), #1217 * **IMPORTANT** **IRAN NEEDS YOU. SPREAD THE NEWS.** ## 0.55.2 * **BUGFIX** (by @imaNNeo): Fix inner border of pieChart with single section, #1089 * **IMPORTANT** **IRAN NEEDS HELP** As you might know, Islamic Republic of Iran is murdering people in silence right now in Iran They shut the Internet down to do that. That’s why I cannot maintain this library for a while. Now we need your help, please be our voice by spreading news in your media to support us Search these hashtags: [#MahsaAmini](https://twitter.com/search?q=%23MahsaAmini&src=typeahead_click) [مهسا_امینی](https://twitter.com/search?q=%23%D9%85%D9%87%D8%B3%D8%A7_%D8%A7%D9%85%DB%8C%D9%86%DB%8C&src=typeahead_click&f=top) [OpIran](https://twitter.com/search?q=%23OpIran&src=typeahead_click&f=top) Also, [this article](https://www.bbc.com/news/world-middle-east-62984076) might help. ## 0.55.1 * **BUGFIX** (by @ateich): Fix infinite loop in RadarChart when all values in RadarDataSet are equal, #882. * **BUGFIX** (by @ateich): Fix uneven titles in RadarChart when using titlePositionPercentageOffset, #1074. * **BUGFIX** (by @imaNNeo): Fix PieChart single section stroke issue, #1089 ## 0.55.0 * **FEATURE** (by @emelinepal): Add `tooltipBorder` property in [LineTouchTooltipData], [BarTouchTooltipData], [ScatterTouchTooltipData], #692. * **BUGFIX** (by @imaNNeo): Fix tooltip issue on negative bar charts, #978. * **IMPROVEMENT** (by @imaNNeo): Use Container to draw axis-based charts border. * **FEATURE** (by @FlorianArnould) Add the ability to select the RadarChart shape (circle or polygon), #1047. * **BUGFIX** (by @imaNNeo): Fix LineChart titles problem with single FlSpot, #1053. * **FEATURE** (by @FlorianArnould) Add the ability to rotate the RadarChar titles, #883. * **BREAKING** (by @FlorianArnould) [RadarChartData.getTitle](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/radar_chart.md#RadarChartData) have a new parameter `angle` and now returns a [RadarChartTitle](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/radar_chart.md#RadarChartTitle) instead of a simple `string`. (Read our [Migration Guide](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.55.0/MIGRATION_00_55_00.md) to learn more about it) ## 0.51.0 * **FEATURE** (by @imaNNeo): Add `SideTitleWidget` to help you use it in [SideTitles.getTitlesWidget]. It's a wrapper around your widget. It keeps your provided `child` widget close to the chart. It has `angle` and `space` properties to handle margin and rotation. There is a `axisSide` property that you should fill, it has provided to you in the MetaData object. Check the below sample: ```dart getTitlesWidget: (double value, TitleMeta meta) { return SideTitleWidget( axisSide: meta.axisSide, space: 8.0, angle: 0.0, child: const Text("This is your widget"), ); }, ``` * **IMPROVEMENT** (by @imaNNeo): Fix default LineChart interval issue on small view sizes, #909. ## 0.50.6 * **IMPROVEMENT** Fix a backward compatibility issue with Flutter 3.0, #1016 ## 0.50.5 * **IMPROVEMENT** Fix test coverage problem again :/ ## 0.50.4 * **IMPROVEMENT** Fix test coverage problem ## 0.50.3 * **IMPROVEMENT** Fix order of drawing lineChart bar indicator problem, #198. * **FEATURE** Add `isStrokeJoinRound` property in [LineChartBarData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartbardata). * **IMPROVEMENT** Upgrade to Flutter 3, #997. * **FEATURE** Add `chartRendererKey` property to the [LineChart](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md), [BarChart](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md), and [ScatterChart](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md). We pass it directly to our chart renderers that are responsible to render the chart itself (without anything around it like titles), #987. ## 0.50.1 * **BUGFIX** Allow to show axisTitle without sideTitles, #963 ## 0.50.0 **This release has some breaking changes. So please check out the migration guide [here](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.50.0/MIGRATION_00_50_00.md)** * **IMPROVEMENT** Allow to return a Widget in [SideTitles.getTitlesWidget](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#sidetitles) instead of a `String`. For example, you can pass an [Icon](https://api.flutter.dev/flutter/widgets/Icon-class.html) widget as a title, #183. Check below samples: > **LineChartSample 8** ([Source Code](https://github.com/imaNNeo/fl_chart/blob/main/example/lib/presentation/samples/line/line_chart_sample8.dart)) > > > **BarChartSample 7** ([Source Code](https://github.com/imaNNeo/fl_chart/blob/main/example/lib/presentation/samples/bar/bar_chart_sample7.dart)) > > * **BREAKING** Structure of `FlTitlesData`, `AxisTitles`, and `SideTitles` are changed. Because we are using a new system which allows you to pass any [Flutter Widget](https://docs.flutter.dev/development/ui/widgets) as a title instead of passing `string`, `textStyle`, `textAlign`, `rotation`, ... (Read our [Migration Guide](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.50.0/MIGRATION_00_50_00.md)) * **FEATURE** Now we can use any [Gradient](https://api.flutter.dev/flutter/dart-ui/Gradient-class.html) such as [LinearGradient](https://api.flutter.dev/flutter/painting/LinearGradient-class.html) and [RadialGradient](https://api.flutter.dev/flutter/painting/RadialGradient-class.html) everywhere we have gradient. * **BUGFIX** Fix BarChart rods gradient problem, #703. * **BREAKING** `colors` property renamed to `color` to keep only one solid color. And now we have a `gradient` field instead of `colorStops`, `gradientFrom` and `gradientTo` in following classes: [BarChartRodData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartroddata), [BackgroundBarChartRodData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#backgroundbarchartroddata), [BarAreaData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#BarAreaData), [BetweenBarsData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#betweenbarsdata), [LineChartBarData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartbardata). (Read our [Migration Guide](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.50.0/MIGRATION_00_50_00.md) to learn more about it) ## 0.46.0 * **BUGFIX** Fix drawing BetweenBarsArea problem when there are `nullSpots` in fromLine and toLine, #912. * **FEATURE** Allow to have vertically grouped BarChart using `fromY` and `toY` properties in [BarChartRodData](https://github.com/imaNNeo/fl_chart/blob/feature/multi-rods-on-bar-chart/repo_files/documentations/bar_chart.md#BarChartRodData) It means you can have a negative and a positive bar chart at the same X location. #334, #875. Check [BarChartSample5](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-5-source-code) and [BarChartSample6](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-6-source-code. * **BREAKING** Renamed `y` property to `toY` in [BarChartRodData](https://github.com/imaNNeo/fl_chart/blob/feature/multi-rods-on-bar-chart/repo_files/documentations/bar_chart.md#BarChartRodData) and [BackgroundBarChartRodData](https://github.com/imaNNeo/fl_chart/blob/feature/multi-rods-on-bar-chart/repo_files/documentations/bar_chart.md#backgroundbarchartroddata) due to the above feature. * **BUGFIX** Fix smaller radius bubble hiding behind bigger radius bubble in ScatterChart, #930. * **BUGFIX** Fix tooltip text alignment and direction in line chart, #927. ## 0.45.1 * **IMPORTANT** **Fuck Vladimir Putin** * **BUGFIX** Fix `FlSpot.nullSpot` at the first of list bug, #912. * **FEATURE** Add `scatterLabelSettings` property in [ScatterChart](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md) which lets you to add titles on the spots, #902. ## 0.45.0 * **BUGFIX** Fix `clipData` implementation in ScatterChart and LineChart, #897. * **BUGFIX** Fix PieChart changing sections issue (we have disabled semantics for pieChart badgeWidgets), #861. * **BUGFIX** Fix LineChart width smaller width or height lower than 40, #869, #857. * **BUGFIX** Allow to show title when axis diff is zero, #842, #879. * **IMPROVEMENT** Improve iteration over axis values logic (it solves some minor problems on showing titles when min, max values are below than 1.0). * **IMPROVEMENT** Add `baselineX` and `baselineY` property in our axis-based charts, It fixes a problem about `interval` which mentioned in #893 (check [this sample](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#gist---baselinex-baseliney-sample-source-code). * **IMPROVEMENT** Added `distanceCalculator` to `LineTouchData` which is used to calculate the distance between spots and touch events, #716, #261, #892 * **BREAKING** `LineTouchResponse` response now contains a list of `TouchLineBarSpot` instead of `LineBarSpot`. They are ordered based on their distance to the touch event and also contain that distance. ## 0.41.0 * **BUGFIX** Fix getNearestTouchedSpot. Previously it returned the first occurrence of a spot within the threshold, and not the nearest, #641, #645. * **FEATURE** Add `textAlign` property in the [SideTitles](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#sidetitles), #784. * **IMPROVEMENT** Write some unit-tests and enable code coverage reports in our CI ## 0.40.6 * **IMPROVEMENT** Fix showing zero value in side titles and grid lines when we add negative value. Now we always go through the zero value in each axis, #739. * **BUGFIX** Fix example app unsupported operation problem on web, #844. ## 0.40.5 * **BUGFIX** Fix BarChart empty groups state error, #797. * **BUGFIX** Fix drawTooltipOnTop direction minor bug, #815. * **BUGFIX** Fix section with zero value problem in PieChart (disabled animation on changing value to zero and from zero), #817 * **BUGFIX** Fix pie chart stroke problem when adding space between sections (using new approach), #818. * **IMPROVEMENT** Fix interval below one, #811 ## 0.40.2 * **IMPROVEMENT** Use 80 characters for code format line-length instead of 100 (because pub.dev works with 80 and decreased our score). ## 0.40.1 * **IMPROVEMENT** Fix pub.dev determining web support, #780. * **IMPROVEMENT** Implement flutter_lints in the code. * **BUGFIX** Fix below/above area data transparency issue, #770. ## 0.40.0 * **BUGFIX** Fixed pieChart `centerRadius = double.infinity` problem, #747.c * **BREAKING** Charts touchCallback signature has changed to `(FlTouchEvent event, BaseTouchResponse? response)` which [FlTouchEvent](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#fltouchevent) determines which touch/pointer event happened (such as `FlTapUpEvent`, `FlPanUpdateEvent`, ...), and BaseTouchResponse gives us the chart response. * **BREAKING** Chart touchResponse classes don't have `touchInput` and `clickHappened` properties anymore. Use [FlTouchEvent](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#fltouchevent) provided in the callback instead of `touchInput`. Check `event is FlTapUpEvent` to detect touch events instead of checking `clickHappened`; * **IMPROVEMENT** Again we support `longPress` touch events. check [FlTouchEvent](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#fltouchevent) to see all kind of supported touch/pointer events (which can be `FlLongPressStart`, `FlLongPressMoveUpdate`, `FlLongPressEnd`, ...). Also you can check out [touch handling doc](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/handle_touches.md), #649. * **IMPROVEMENT** Added `mouseCursorResolver` callback in touchData classes such as [LineTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling) and [BarTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartouchdata-read-about-touch-handling). You can change the [MouseCursor](https://api.flutter.dev/flutter/services/MouseCursor-class.html) based on the provided [FlTouchEvent](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/base_chart.md#fltouchevent) and touchResponse using this callback. (We have used this feature in [PieChartSample2](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#sample-2-source-code)) * **BUGFIX** Fixed `ScatterChart` default touchHandling crash * **BUGFIX** Fix text styles when updating the theme. Check this [theme-aware-sample](https://gist.github.com/imaNNeo/bf95e720621d799ab980a7a3287c56e2). * **IMPROVEMENT** Show narrow horizontal and vertical grid lines by default. * **IMPROVEMENT** Show all left, top (except BarChart), right, bottom titles in Axis based charts by default. * **IMPROVEMENT** Set `BarChartAlignment.spaceEvenly` as `alignment` property of [BarChartData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartdata) by default * **IMPROVEMENT** Allow [BarChart](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md) and [LineChart](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md) have empty values instead of throwing exception (we don't show anything if there is nothing provided) * **BREAKING** `textStyle` of [ScatterTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#ScatterTooltipItem) is now nullable and optional. `bottomMargin` is also optional (default is zero). So both are named parameters now. * **IMPROVEMENT** We improved touch precision of `ScatterChart`. * **BUGFIX** Fix overlapping last gridlines on border lines problem. * **NEWS** Your donation **motivates** me to work more on the `fl_chart` and resolve more issues. Now you can [buy me a coffee](https://www.buymeacoffee.com/fl_chart)! ## 0.36.4 * **IMPROVEMENT** Added `borderSide` property in [BarChartRodData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#BarChartRodData) and [BarChartRodStackItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#BarChartRodStackItem) to draw strokes around each bar and rod stack items, #714. * **IMPROVEMENT** Now all textStyles are nullable and theme-aware by default, #269. * **BREAKING** All `getTextStyles` callback now give you a `context` and `value` (previously it was only a `value`). * **BUGFIX** Fixed `colorStops` calculation which used in gradient colors, #732. ## 0.36.3 * **IMPROVEMENT** Show proper error message when there is less than 3 [RadarEntry](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/radar_chart.md#radarentry) in [RadarChart](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/radar_chart.md), #694. * **IMPROVEMENT** Added `borderSide` property in [PieChartSectionData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/pie_chart.md#piechartsectiondata) to draw strokes around each section, #606. ## 0.36.2 * **IMPROVEMENT** Support `onMouseExit` event in all charts. * **IMPROVEMENT** Add `rotateAngle` property in [LineTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchtooltipdata), [BarTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartouchtooltipdata), [ScatterTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scattertouchtooltipdata), #260, #679. * **BUGFIX** Fix PieChart section index problem, when there is a section with 0 value, #697. ## 0.36.1 * **IMPROVEMENT** Allow to set zero value on PieChartSectionData (we remove zero sections instead of crashing), #640. * **BUGFIX** Fix NPE crash in our renderers touchCallback, #651. * **BUGFIX** Fix line index problem in LineChart, #665. (It has appeared in `0.36.0`, we had to revert 2nd change of `0.36.0`) * **BREAKING** Remove unused `lineIndex` property from (ShowingTooltipIndicators)[https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#showingtooltipindicators]. ## 0.36.0 * **BUGFIX** Fixed bug of lerping FlSpot.nullSpot, #487. * **BUGFIX** Fixed showing tooltip problem when animating chart, #647. * **BUGFIX** Fixed RadarChart drawing problem, #627. * **IMPROVEMENT** Now [SideTitles](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#SideTitles).`interval` is working correctly in bottomTitles in the BarChart, #648. * **BREAKING** You should provide `spotsIndices` instead of `showingSpots` in [ShowingTooltipIndicators](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#showingtooltipindicators). ## 0.35.0 * **IMPROVEMENT** Added `children` property in the [LineTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetooltipitem), [BarTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartooltipitem) and [ScatterTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scattertooltipitem) which accepts a list of [TextSpan](https://api.flutter.dev/flutter/painting/TextSpan-class.html). It allows you to have more customized texts inside the tooltip. See [BarChartSample1](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-1-source-code) and [ScatterSample2](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#sample-2-source-code), #72, #294. * **IMPROVEMENT** Added `getTouchLineStart` and `getTouchLineEnd` in [LineTouchData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling) to give more customizability over showing the touch lines. see [SampleLineChart9](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-8-source-code). * **IMPROVEMENT** Enabled `sectionsSpace` in PieChart for the web. * **IMPROVEMENT** Added [Makefile](https://makefiletutorial.com) commands which makes it comfortable for verifying your code before push (It is related to contributors, red more about it in [CONTRIBUTING.md](https://github.com/imaNNeoFighT/fl_chart/blob/main/CONTRIBUTING.md)). * **IMPROVEMENT** Added `FlDotCrossPainter` which extends `FlDotPainter` to paint X marks on line chart spots. * **IMPROVEMENT** Added `textDirection` property in [LineTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetooltipitem), [BarTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartooltipitem) and [ScatterTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scattertooltipitem). It allows you to support rtl languages in tooltips. * **IMPROVEMENT** Added `textDirection` property in [SideTitles](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#sidetitles) class, #531. It allows you to support rtl languages in side titles. * **IMPROVEMENT** Added `textDirection` property in [AxisTitles](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#AxisTitle) class. It allows you to support rtl languages in axis titles. * **BUGFIX** Fixed some bugs on drawing PieChart (for example when we have only one section), #582, * **BREAKING** Border of pieChart now is hide by default (you can show it using `borderData: FlBorderData(show: true)`. * **BREAKING** You cannot set `0` value on [PieChartSectionData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/pie_chart.md#piechartsectiondata).value anymore, instead remove it from list. * **BREAKING** Removed `fullHeightTouchLine` property from [LineTouchData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling). Now you can have a full line with following snippet: ```dart LineTouchData( ... getTouchLineStart: (barData, index) => -double.infinity // default: from bottom, getTouchLineEnd: (barData, index) => double.infinity //to top, ... ) ``` ## 0.30.0 * [IMPROVEMENT] We now use [RenderObject](https://api.flutter.dev/flutter/rendering/RenderObject-class.html) as our default drawing system. It brings a lot of stability. Such as size handling, hitTest handling (touches), and It makes us possible to paint Widgets inside our chart (It might fix #383, #556, #582, #584, #591). * [IMPROVEMENT] Added [Radar Chart Documentations](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/radar_chart.md) * [IMPROVEMENT] Added `textAlign` property in the [BarTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartooltipitem), [LineTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetooltipitem), and [ScatterTooltipItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scattertooltipitem), default is `TextAlign.center`. * [IMPROVEMENT] Added `direction` property in the [BarTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartouchtooltipdata), and [LineTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchtooltipdata) to specify the position of the tooltip (can be `auto`, `top`, `bottom`), default is `auto`. * [IMPROVEMENT] Updated touch flow, we now use [hitTest](https://api.flutter.dev/flutter/rendering/RenderProxyBoxWithHitTestBehavior/hitTest.html) for handling touch and interactions. * [IMPROVEMENT] Added 'clickHappened' property in all of our TouchResponses (such as [LineTouchResponse](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#LineTouchResponse), [BarTouchResponse](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartouchresponse), ...), #210. * [IMPROVEMENT] Added `swapAnimationCurve` property to all chart widgets which handles the built-in animation [Curve](https://api.flutter.dev/flutter/animation/Curves-class.html), #436. * [BREAKING] Some properties in [ScatterTouchResponse](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scattertouchresponse), and [PieTouchResponse](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/pie_chart.md#pietouchresponse) moved to a wrapper class, you need to access them through that wrapper class. * [BREAKING] Renamed `tooltipBottomMargin` to `tooltipMargin` property in the [BarTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartouchtooltipdata), and [LineTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchtooltipdata) * [Bugfix] Fixed `double.infinity` in [PieChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/pie_chart.md#piechartdata) .centerSpaceRadius, #584. ## 0.20.1 * [BREAKING] We now support flutter version 2.0 (null-safety), check out the [migration guide](https://dart.dev/null-safety/migration-guide). * [NEW_CHART] We have added [RadarChart](https://github.com/payam-zahedi/fl_chart/blob/main/repo_files/documentations/radar_chart.md). Thanks to [Payam Zahedi](https://github.com/payam-zahedi)! ## 0.20.0-nullsafety1 * [BREAKING] **We have migrated our project to null-safety. You may need to change your source-code to compile**. check [migration guide](https://dart.dev/null-safety/migration-guide). * [BREAKING] You cannot set null value on FlSpot any more (use FlSpot.nullSpot instead). ## 0.12.3 * [Bugfix] Fixed PieChart exception bug on sections tap, #514. * [Bugfix] Fixed PieChart badges problem, #538. * [Bugfix] Fixed Bug of drawing lines with strokeWidth zero, #558. * [Improvement] Updated example app to support web. * [Improvement] Show tooltips on mouse hover on Web, and Desktop. ## 0.12.2 * [Bugfix] Fixed PieChart badges draw in first frame problem, #513. * [Improvement] Use CanvasWrapper to proxy draw functions (It does not have any effect on the result, it makes the code testable) ## 0.12.1 * [Bugfix] Fixed PieChart badges bug with re-implementing the solution, #507 * [Bugfix] Fix the setState issue using PieChart in the ListView, #467 * [Bugfix] Fixed formatNumber bug for negative numbers, #486. * [Improvement] Added applyCutOffY property in [BarAreaSpotsLine](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#barareaspotsline) to inherit cutOffY property of its parent, #478. ## 0.12.0 * [Improvement] [BREAKING] Replaced `color` property with `colors` in [BarChartRodData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartroddata), and [BackgroundBarChartRodData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#backgroundbarchartroddata) to support gradient in BarChart, instead of solid color, #166. Check [BarChartSample3](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-3-source-code) * [Improvement] Improved gradient stops calculating algorithm. * [Improvement] [BREAKING] Changed SideTitle's `textStyle` property to `getTextStyles` getter (it gives you the axis value, and you must return a TextStyle based on it), It helps you to have a different style for specific text, #439. Check it here [LineChartSample3](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-3-source-code) * [Improvement] Added `badgeWidget`, and `badgePositionPercentageOffset` in each [PieChartSectionData](https://github.com/imaNNeoFighT/fl_chart/blob/dev/repo_files/documentations/pie_chart.md#piechartsectiondata) to provide a widget to show in the chart, see [this sample](https://github.com/imaNNeoFighT/fl_chart/blob/dev/repo_files/documentations/pie_chart.md#sample-3-source-code), #443. Providing a widget is an important step in our library, if it works perfectly, we will aplly this solution on other parts. Then I appreciate any feedback. * [Bugfix] Fixed aboveBarArea flickers after setState, #440. ## 0.11.1 * [Bugfix] Fixed drawing BarChart rods with providing minY (for positive), maxY (for negative) values bug, #404. * [Bugfix] Fixed example app build fail error, by upgrading flutter_svg package to `0.18.1` ## 0.11.0 * [Bugfix] Prevent show ScatterSpot if show is false, #385. * [Improvement] Set default centerSpaceRadius to double.infinity in [PieChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/pie_chart.md#piechartdata), #384. * [Improvement] Allowed to have topTitles in the [BarChart](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md), see [BarChartSample5](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-5-source-code), #394. * [Improvement] Added `touchedStackItem` and `touchedStackItemIndex` properties in the [BarTouchedSpot](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartouchedspot) to determine in which [BarChartRodStackItem](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartrodstackitem) click happened, #393. * [Improvement] [BREAKING] Renamed `rodStackItem` to `rodStackItems` in [BarChartRodData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartroddata). ## 0.10.1 * [Improvement] Show barGroups `x` value instead of `index` in bottom titles, #342. * [Improvement] [BREAKING] Use `double.infinity` instead of `double.nan` for letting `enterSpaceRadius` be as large as possible in the (PieChartData)[https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/pie_chart.md#piechartdata], #377. * [Bugfix] Fixed PieChart bug with 1 section, #368. ## 0.10.0 * [IMPORTANT] **BLACK LIVES MATTER** * [Improvement] Auto calculate interval in [SideTitles](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#sidetitles) and [FlGridData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#flgriddata), instead of hard coding 1, to prevent some performance issues like #101, #322. see [BarChartSample4](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-4-source-code). * [Bugfix] drawing dot on null spots * [Bugfix] Fixed LineChart have multiple NULL spot bug. * [Feature] Added `checkToShowTitle` property to the [SideTitles](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#sidetitles), for checking show or not show titles in the provided value, #331. see [LineChartSample8](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-8-source-code). * [Feature] Added compatibily to have customized shapes for [FlDotData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#fldotdata), just override `FlDotData.etDotPainter` and pass your own painter or use built-in ones, see this [sample](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-3-source-code). * [Improvement] [BREAKING] Replaced `clipToBorder` with `clipData` in [LineChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartdata) to support clipping 4 sides of a chart separately. ## 0.9.4 * [Bugfix] Fixed showing PieChart on web (we've ignored `groupSpace` on web, because some BlendModes are [not working](https://github.com/flutter/flutter/issues/56071) yet) ## 0.9.3 * [BugFix] Fixed groupBarsPosition exception, #313. * [Improvement] Shadows default off, #316. ## 0.9.2 * [Feature] Added `shadow` property in [LineChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartdata) to have shadow effect in our [LineChart](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md), take a look at [LineChartSampl5](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-5-source-code), #304. * [Feature] Added `isStepLineChart`, and `lineChartStepData` in the [LineChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartdata) to support Step Line Chart, take a look at [lineChartSample3](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-3-source-code), #303. * [Improvement] Added `barData` parameter to checkToShowDot Function in the [FlDotData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#fldotdata). ## 0.9.0 * Added `strokeWidth`, `getStrokeColor`, `getDotColor` in the [FlDotData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#fldotdata), also removed `dotColor` from it (you should use `getDotColor` instead, it gives you more customizability), now we have more customizability on [FlDotData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#fldotdata), check [line_chart_sample3](https://github.com/imaNNeoFighT/fl_chart/blob/dev/repo_files/documentations/line_chart.md#sample-3-source-code), and [line_chart_sample5](https://github.com/imaNNeoFighT/fl_chart/blob/dev/repo_files/documentations/line_chart.md#sample-5-source-code), #233, #99, #274. * Added `equatable` library to solve some equation issues. * Implemented negative values feature for the BarChart, #106, #103. * add Equatable for all models, it leads to have a better performance. * Fixed a minor touch bug in the [BarChart](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md). * Fixed ScatterChart built-in touch behaviour. * Fixed drawing grid lines bug, #280. * Implemented [FlDotData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#fldotdata).`getDotColor` in a proper way, it returns a color based on the [LineChartBarData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartbardata) color, #274, #282. * Updated [LineChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartdata).`showingTooltipIndicators` field type to list of [ShowingTooltipIndicators](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#showingtoltipindicators) to have a clean naming. ## 0.8.7 * Added `show` property in the `VerticalLineLabel` and set default to `false`, #256. * Fixed bug, when the screen size is square, #258. ## 0.8.6 * Fixed exception on extraLinesData, #251. * Show extra lines value with 1 floating-point. * Implemented multi-section lines in LineChart, check this issue (#26) and this merge request (#252) ## 0.8.5 * Added `fitInsideHorizontally` and `fitInsideVertically` in [ScatterTouchTooltipData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scattertouchtooltipdata) * Fixed `clipToBorder` functionality basdd on the border sides. ## 0.8.4-test1 * Improved documentations ## 0.8.4 * Added `preventCurveOvershootingThreshold` in `LineChartBarData` for applying prevent overshooting algorithm, #193. * Fixed `clipToBorder` bug in the [LineChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartdata), #228, #214. * Removed unused `enableNormalTouch` property from all charts TouchData. * Implemented ImageAnnotations feature (added `image`, and `sizedPicture` in the [VerticalLine](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#verticalline), and the [HorizontalLine](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#horizontalline), check [this sample](https://github.com/imaNNeoFighT/fl_chart/blob/dev/repo_files/documentations/line_chart.md#sample-8-source-code) for more information. * Enable 'fitInsideTheChart' to support vertical tooltip overflow as well, #225. * BREAKING CHANGE-> changed `fitInsideTheChart` to `fitInsideHorizontally` and added `fitInsideVertically` to support both sides, #225. ## 0.8.3 * prevent to set BorderRadius with numbers larger than (width / 2), fixed #200. * added `fitInsideTheChart` property inside `BarTouchTooltipData` and `LineTouchTooltipData` to force tooltip draw inside the chart (shift it to the chart), fixed #159. ## 0.8.2 * added `fullHeightTouchLine` in [LineTouchData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling) to show a full height touch line, see sample in merge request #208. * added `label` ([HorizontalLineLabel](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#horizontallinelabel)) inside [HorizontalLine](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#horizontalline) and [VerticalLine](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#verticalline) to show a lable text on the lines. ## 0.8.1 * yaaay, added some basic unit tests * skipped the first and the last grid lines from drawing, #174. * prevent to draw touchedSpotDot if `show` is false, #180. * improved paint order, more details in #175. * added possibility to set `double.nan` in `centerSpaceRadius` for the PieChart to let it to be calculated according to the view size, fixed #179. ## 0.8.0 * added functionallity to have dashed lines, in everywhere we draw line, there should be a property called `dashArray` (for example check [LineChartBarData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartbardata), and see [LineChartSample8](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-8-source-code)) * BREAKING CHANGE: * swapped [HorizontalExtraLines](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#horizontalline), and [VerticalExtraLines](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#verticalline) functionalities (now it has a well definition) * and also removed `showVerticalLines`, and `showHorizontalLines` from [ExtraLinesData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#ExtraLinesData), if the `horizontalLines`, or `verticalLines` is empty we don't show them ## 0.7.0 * added rangeAnnotations in the [LineChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartdata) to show range annotations, #163. * removed `isRound` fiend in the [BarChartRodData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartroddata) to add more customizability, and fixed #147 bug. * fixed sever bug of click on pie chart, #146. ## 0.6.3 * Fixed drawing borddr bug, #143. * Respect text scale factor when drawing text. ## 0.6.2 * added `axisTitleData` field to all axis base charts (Line, Bar, Scatter) to show the axes titles, see [LineChartSample4](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-4-source-code) and [LineChartSample5](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-5-source-code). ## 0.6.1 * added `betweenBarsData` property in [LineChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartdata), fixed #93. ## 0.6.0 * fixed calculating size for handling touches bug, #126 * added `rotateAngle` property to rotate the [SideTitles](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#sidetitles), fixed issue [#75](https://github.com/imaNNeoFighT/fl_chart/issues/75) , see in this [sample](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-5-source-code) * BREAKING CHANGES: * some property names updated in the [FlGridData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#flgriddata): `drawHorizontalGrid` -> `drawHorizontalLine`, `getDrawingHorizontalGridLine` -> `getDrawingHorizontalLine`, `checkToShowHorizontalGrid` -> `checkToShowHorizontalLine` (and same for vertical properties), fixed issue [#92](https://github.com/imaNNeoFighT/fl_chart/issues/92) ## 0.5.2 * drawing titles using targetData instead of animating data, fixed issue #130. ## 0.5.1 * prevent to show touch indicators if barData.show is false in LineChart, [#125](https://github.com/imaNNeoFighT/fl_chart/issues/125). ## 0.5.0 * 💥 Added ScatterChart ([read about it](https://jbt.github.io/markdown-editor/repo_files/documentations/scatter_chart.md)) 💥 * Added Velocity to in [FlPanEnd](https://github.com/imaNNeoFighT/fl_chart/blob/feature/scatter-chart/repo_files/documentations/base_chart.md#fltouchinput) to determine the Tap event. ## 0.4.3 * fixed a size bug, #100. * direction support for gradient on the LineChart (added `gradientFrom` and `gradientTo` in the [LineChartBarData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartbardata)). ## 0.4.2 * implemented stacked bar chart, check the [samples](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#sample-5-source-code) * added `groupSpace in [BarChartData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#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 * BIG BREAKING CHANGES * There is no `FlChart` class anymore, instead use [LineChart](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md), [BarChart](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md), and [PieChart](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/pie_chart.md) 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](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling)), [read more](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/handle_touches.md). * `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](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartdata) to show manually tooltips in `LineChart`. * added `showingIndicators` in [LineChartBarData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartbardata) to show manually indicators in `LineChart`. * added `showingTooltipIndicators` in [BarChartGroupData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/bar_chart.md#barchartgroupdata) to show manually tooltips in `BarChart`. ## 0.3.4 * BREAKING CHANGES * swapped horizontal and vertical semantics in [FlGridData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#FlGridData), fixed this [issue](https://github.com/imaNNeoFighT/fl_chart/issues/85). ## 0.3.3 * BREAKING CHANGES * added support for drawing below and above areas separately in LineChart * added cutOffY feature in LineChart, see this [issue](https://github.com/imaNNeoFighT/fl_chart/issues/62) * added `aboveBarData` in [LineChartBarData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartbardata) * `BelowBarData` class renamed to [BarAreaData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#barareadata) to reuse for both above and below areas * `belowSpotsLine` renamed to `spotsLine` in [BarAreaData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#barareadata) * `cutOffY` and `applyCutOffY` fields are added in [BarAreaData](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#barareadata) to handle cutting of drawing below or above area * `BelowSpotsLine` renamed to [BarAreaSpotsLine](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#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](https://github.com/imaNNeoFighT/fl_chart/issues/74). ## 0.3.1 * added `interval` field in [SideTitles](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/base_chart.md#sidetitles), fixed this [issue](https://github.com/imaNNeoFighT/fl_chart/issues/67) ## 0.3.0 * 💥 Added Animations 💥, [read about it](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/handle_animations.md). ## 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](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/line_chart.md#sample-6-source-code) using this update. ## 0.1.2 * added `preventCurveOverShooting` on BarData, check this [issue](https://github.com/imaNNeoFighT/fl_chart/issues/25) ## 0.1.1 * nothing important ## 0.1.0 * added **Touch Interactivity**, read more about it [here](https://github.com/imaNNeoFighT/fl_chart/blob/main/repo_files/documentations/handle_touches.md) ## 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) --- ### CLAUDE (CLAUDE.md) # CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview FL Chart is a highly customizable Flutter chart library supporting 6 chart types: Line, Bar, Pie, Scatter, Radar, and Candlestick. Single-package Flutter library (not a monorepo). ## Common Commands ```bash make sure # Run tests + checkstyle (use before pushing) make runTests # flutter test make analyze # flutter analyze make checkFormat # Verify formatting (dry run) make format # Auto-format code make checkstyle # analyze + format check make codeGen # Generate mock files: dart run build_runner build --delete-conflicting-outputs flutter test test/chart/line_chart/line_chart_painter_test.dart # Run a single test file ``` ## Architecture ### Per-Chart Pattern Every chart type in `lib/src/chart/` follows a consistent structure: - `{type}_chart.dart` — Widget (extends `ImplicitlyAnimatedWidget` for built-in animations) - `{type}_chart_data.dart` — Data classes (extend `BaseChartData` or `AxisChartData`) - `{type}_chart_painter.dart` — Canvas drawing logic (extends `BaseChartPainter`) - `{type}_chart_renderer.dart` — Rendering widget that builds the custom painter - `{type}_chart_helper.dart` — Chart-specific utility functions ### Class Hierarchy ``` BaseChartData ├── AxisChartData (charts with X/Y axes) │ ├── LineChartData │ ├── BarChartData │ ├── ScatterChartData │ └── RadarChartData ├── PieChartData └── CandlestickChartData ``` Painters follow the same hierarchy: `BaseChartPainter` → `AxisChartPainter` → specific painters. ### Key Design Decisions - **CanvasWrapper** (`lib/src/utils/canvas_wrapper.dart`): All drawing goes through this proxy instead of `Canvas` directly, enabling unit testing of paint logic with Mockito. - **PaintHolder**: Holds current data, target data, text scaler, and virtual rect — passed to painters for rendering and animation interpolation. - **Implicit animations**: Charts use `ImplicitlyAnimatedWidget` with `*DataTween` classes. Default: 150ms linear. - **Equatable**: All data classes use `equatable` for value equality. - **Lerp**: Data models must implement a `lerp()` method to enable smooth implicit animations between states. See `lib/src/utils/lerp.dart` for helpers. - **Theme-aware text styles**: When rendering text in painters, always use `Utils().getThemeAwareTextStyle(context, style)` instead of hardcoded fallback `TextStyle` values. This merges user-provided styles with the app's theme. ### Touch System Each chart type defines `*TouchData` and uses `FlTouchEvent` base class. Touch callbacks are configured in the chart data classes. ## Testing Tests mirror the `lib/` structure under `test/`. Each chart has tests for data, painter, renderer, and helper. Painter tests mock `CanvasWrapper` to verify drawing calls. Key test utilities: - `test/helper_methods.dart` — Path/RRect equality helpers - `test/chart/data_pool.dart` — Shared mock data - `*.mocks.dart` files are generated by Mockito (run `make codeGen` to regenerate) ## Code Style - Uses `very_good_analysis` linter (strict, with some relaxed rules in `analysis_options.yaml`) - `public_member_api_docs` is disabled — public API docs are not enforced - `lines_longer_than_80_chars` is disabled - Generated `*.mocks.dart` files are excluded from analysis ## PR Conventions PR titles must follow Conventional Commits: `: ` (e.g., `feat: Add tooltip support`). Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert. Breaking changes use `!` (e.g., `feat!: Change API`). Subject starts with a capital letter. --- ### CONTRIBUTING (CONTRIBUTING.md) # Contributing Hello, we are glad to have a contributor like you here. Don't forget that `open-source` makes no sense without contributors. No matter how big your changes are, it helps us a lot, even if it is just a line of change. This file is intended to be a guide for those who are interested in contributing to the FL Chart. #### Below are the people who have contributed to FL Chart. We hope to have your picture here soon. [](https://github.com/imaNNeo/fl_chart/graphs/contributors) ## Let's get Started Make sure you have Flutter installed and on your path (follow the [installation guide](https://docs.flutter.dev/get-started/install)). Follow these steps to clone FL Chart and set up the development environment: 1. Fork the repository 2. Clone the project, you can find it in your repositories: `git clone https://github.com/your-username/fl_chart.git` 3. Go into the cloned directory: `cd fl_chart` 4. Install all packages: `flutter packages get` 5. Try to run the sample app. It should work on all platforms (Android, iOS, Web, Linux, MacOS, Windows) 6. Create a new branch for your changes: `git checkout -b your-branch-name`. The branch name doesn't matter for our project history (as we use **Squash and Merge**), but it's good practice to use descriptive names. You can [read more about naming conventions here](https://www.geeksforgeeks.org/git/how-to-naming-conventions-for-git-branches/). ## Before Modifying the Code If the work you intend to do is non-trivial, it is necessary to open an issue before starting to write your code. This helps us and the community to discuss the issue and choose what is deemed to be the best solution. ### Mention the related issues: If you are going to fix or improve something, please find and mention the related issues in commit message and Pull Request description. In case you couldn't find any issue, it's better to create an issue to explain what's the issue that you are going to fix. ## Let's start by our drawing architecture We have a *_chart_painter.dart class per each chart type. It draws elements into the Canvas. We made the CanvasWrapper class, because we wanted to test draw functions. CanvasWrapper class holds a canvas and all draw functions proxies through it. You should use it for drawing on the canvas, Instead of directly accessing the canvas. It makes draw functions testable. (made with [draw.io](https://drive.google.com/file/d/1bj-2TqTRUh80dRKJk10drPNeA3fp3EA8/view)) ## Keep your branch updated If your branch falls behind the `main` branch, you can update it using the "Update branch" button on GitHub or by merging `main` into your branch. We use **Squash and Merge**, which combines all your PR commits into a single, clean commit in the `main` branch. ## Checking Your Code's Quality After you have made your changes, you have to make sure your code works correctly and meets our guidelines. Our guidelines are: You can simply run `make checkstyle`, and if you faced any formatting problem, run `make format`. ##### Run `make checkstyle` to ensure that your code is formatted correctly - It runs `flutter analyze` to verify that there are no warnings or errors. - It runs `dart format --set-exit-if-changed --dry-run .` to verify that code has formatted correctly. #### Run `make format` to reformat the code - It runs `dart format .` to format your code. #### Run `make runTests` to ensure that all tests are passing. - It runs `flutter test` under the hood. #### Run `make sure` before pushing your code. - It runs both `make runTests` and then `make checkstyle` sequentially with a single command. ## Test coverage (unit tests) We should write unit tests for our written code. If you are not familiar with unit-tests, please start from [here](https://docs.flutter.dev/cookbook/testing/unit/introduction). [Mockito](https://pub.dev/packages/mockito) is the library that we use to mock our classes. Please read more about it in their docs [here](https://github.com/dart-lang/mockito#lets-create-mocks). Our code coverage is calculated by [Codecov](https://app.codecov.io/gh/imaNNeo/fl_chart) (Our coverage is [](https://codecov.io/gh/imaNNeo/fl_chart) at the moment) When you push something in your PR (after your PR is approved by one of us), you will see a coverage report that describes how much coverage is increased or decreased by your code (You can check the details to see which part of your code made the change). Please make sure that your code is **not decreasing** the coverage. ## Creating a Pull Request Congratulations! Your code meets all of our guidelines :100:. Now you have to submit a pull request (PR for short) to us. These are the steps you should follow when creating a PR: ### PR Title Convention We use [Conventional Commits](https://www.conventionalcommits.org/) for our PR titles. This title will be used to automatically generate the **CHANGELOG**. The title must follow this format: `: ` - **Type**: Must be one of `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`. - **Subject**: Must start with a **Capital Letter** and adequately summarize the changes. - **Breaking Changes**: If your PR contains a breaking change, add a `!` after the type (e.g., `feat!: Change PieChart API`). **Examples:** - `feat: Add rounded corners to PieChart` - `fix: Resolve memory leak in BarChart` - `docs: Update BarChart documentation` A GitHub Action will validate your PR title and will fail if it doesn't follow this convention. ### PR Description - Use the provided PR template. - Provide a concise description of the changes. This text will become the permanent commit body in our Git history, so please keep it clear and brief. (Tip: Feel free to use AI assistants to help you draft this!) - Mention the issues that you are fixing (e.g., `Closes #1234`). - If it's a breaking change, provide migration instructions in the "Migration instructions" section of the template. After you follow the above steps, your PR will hopefully be merged. Thanks for contributing! --- ### Pubspec.Yaml (pubspec.yaml) name: fl_chart description: A highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart. version: 1.2.0 homepage: https://flchart.dev/ repository: https://github.com/imaNNeo/fl_chart issue_tracker: https://github.com/imaNNeo/fl_chart/issues documentation: https://github.com/imaNNeo/fl_chart environment: sdk: ">=3.6.2 <4.0.0" flutter: ">=3.27.4" funding: - https://github.com/sponsors/imaNNeo - https://www.buymeacoffee.com/fl_chart dependencies: equatable: ^2.0.7 flutter: sdk: flutter vector_math: ^2.2.0 dev_dependencies: build_runner: ^2.8.0 flutter_test: sdk: flutter mockito: ^5.5.1 very_good_analysis: ^10.2.0 screenshots: - description: "FL Chart Logo" path: pub_screenshots/logo_1024.png - description: "LineChartSample1 and LineChartSample2" path: pub_screenshots/line_chart.jpg - description: "LineChartSample10" path: pub_screenshots/line_chart_sample_10.gif - description: "BarChartSample1 and BarChartSample2" path: pub_screenshots/bar_chart.jpg - description: "BarChartSample7" path: pub_screenshots/bar_chart_sample_7.gif - description: "PieChartSample1, PieChartSample2 and PieChartSample3" path: pub_screenshots/pie_chart.jpg - description: "ScatterChartSample2" path: pub_screenshots/scatter_chart_sample_2.gif - description: "RadarChartSample1" path: pub_screenshots/radar_chart_sample_1.jpg topics: - chart - charts - visualization - graph - diagram --- ### SOURCES (SOURCES.md) ### Sources to learn more about the fl_chart: All sources are sorted by date. Did you find any new article or source? please contribute to have them all here. #### Blog post: * [Design Stunning Charts with fl_charts in Flutter](https://www.atatus.com/blog/design-stunning-charts-with-fl-charts-in-flutter/) * [Build beautiful charts in Flutter with FL Chart](https://blog.logrocket.com/build-beautiful-charts-flutter-fl-chart) * [Flutter4Fun UI Challenge 7](https://flutter4fun.com/ui-challenge-7/) * [Stock charts](https://dev.to/kamilpowalowski/stock-charts-with-flchart-library-1gd2) #### Video: * [how to create line chart in flutter | fl_chart](https://www.youtube.com/watch?v=Iv3F2HO5Jvc) * [line chart in flutter - flutter tutorial](https://www.youtube.com/watch?v=xHzDAewbSGY) * [Portfolio Dashboard Flutter UI Desktop & Web](https://www.youtube.com/watch?v=H9vXUine7Zo) * [Flutter UI | Stocks App UI Design - Day 55](https://www.youtube.com/watch?v=oILraFu8OE8) * [Implementing Chart in Flutter - Pair Programming with Fl_Chart Author](https://www.youtube.com/watch?v=msMxuUERtg8) * [how to create line chart in flutter | fl_chart](https://www.youtube.com/watch?v=Iv3F2HO5Jvc) * [Responsive Admin Dashboard or Panel using Flutter - Flutter Web UI - Part 1](https://www.youtube.com/watch?v=MRiZpwdy1CM) * [Admin Panel Dashboard - Flutter Responsive UI Design](https://www.youtube.com/watch?v=n7O3pXfENPU) * [How to build Flutter UI - 3 Steps](https://www.youtube.com/watch?v=I0NBtFS_ibc) * [Flutter Web - Dashboard Website Template (Responsive)](https://www.youtube.com/watch?v=3SMdJE_dSxU) * [How to create charts in Flutter](https://www.youtube.com/watch?v=JBJ6o4blgPA) * [Flutter Charts 📊📈](https://www.youtube.com/watch?v=ibkcwCv9Lyw) * [Flutter Library for Customizable](https://www.youtube.com/watch?v=1pjAItIDNz8) * [Pie Chart - FLChart](https://www.youtube.com/watch?v=rZx_isqXrhg&t=77s) * [Flutter Tutorial - Bar Chart](https://www.youtube.com/watch?v=7wUmzYOPQ8w) * [wallet-app-ui-piechart](https://www.youtube.com/watch?v=M4w-dighmMU) * [Flutter UI Tutorial - Fitness App](https://www.youtube.com/watch?v=hTg4DDl8Ixo) * [Gradient Chart](https://www.youtube.com/watch?v=OR2DMRnEXkA) * [Flutter charts tutorial for beginners](https://www.youtube.com/watch?v=nCmihMrWS38) * [The easy way with fl-Chart](https://www.youtube.com/watch?v=R_vpnW5QZEw) * [Get the data form COVID-19 API](https://www.youtube.com/watch?v=QXMWzbdGDkA) * [Flutter COVID-19 Dashboard UI](https://www.youtube.com/watch?v=krU-ASLb8lM) * [Flutter UI](https://www.youtube.com/watch?v=axWBN1aotQk) * [Flutter](https://www.youtube.com/watch?v=rwHFslLo6ho) * [Setup Pie Charts](https://www.youtube.com/watch?v=zRZiJdbp3_E) --- ### Example/README (example/README.md) This is the FL Chart App. Check it out live here: [app.flchart.dev](https://app.flchart.dev) --- ### Example/Analysis Options.Yaml (example/analysis_options.yaml) # This file configures the analyzer, which statically analyzes Dart code to # check for errors, warnings, and lints. # # The issues identified by the analyzer are surfaced in the UI of Dart-enabled # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be # invoked from the command line by running `flutter analyze`. # The following line activates a set of recommended lints for Flutter apps, # packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints # and their documentation is published at https://dart.dev/lints. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code # or a specific dart file by using the `// ignore: name_of_lint` and # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options --- ### Example/Pubspec.Yaml (example/pubspec.yaml) name: fl_chart_app description: FL Chart App is an application to demonstrate samples of the fl_chart (A Flutter package to draw charts). publish_to: 'none' version: 1.2.0+10200 environment: sdk: ^3.0.0 dependencies: flutter: sdk: flutter flutter_web_plugins: sdk: flutter cupertino_icons: ^1.0.8 google_fonts: ^6.3.2 flutter_svg: ^2.2.1 universal_platform: ^1.1.0 flutter_staggered_grid_view: ^0.7.0 url_launcher: ^6.3.2 go_router: ^16.2.4 dartx: ^1.2.0 fl_chart: path: ../ flutter_bloc: ^9.1.1 package_info_plus: ^9.0.0 equatable: ^2.0.7 intl: ^0.20.2 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^6.0.0 msix: ^3.16.13 flutter: uses-material-design: true fonts: - family: Digital fonts: - asset: assets/fonts/digital-7.ttf assets: - assets/icons/ - assets/fonts/ - assets/data/ msix_config: display_name: FL Chart publisher_display_name: App2Pack identity_name: App2Pack.FLChart publisher: CN=FBB84607-3250-433E-9236-B21FF8A84B05 msix_version: 1.2.0.0 logo_path: assets/icons/fl_chart_logo_icon.png architecture: x64 capabilities: internetClient store: true ---