Flutter charting libraries: an evaluation

Jim Anster
6 min readJun 16, 2019

--

Flutter is growing fast, getting more and more mature. But what about the charting libraries? How powerful and usable are they today? We will compare five libraries:

The code used to test is available on Github:

Note before to start: this comparison is totally subjective, it is just my opinion and feeling. The comparison is made only for a timeline chart so it is not covering all the features of the libraries presented here. Note for the authors of the libraries if they read this: I might not have understood everything right so forgive me if I say something wrong and correct me please.

Let’s start by checking the general results and then we will review the details library by library. The criteria that we use are: general api power, api comfort, customization, maintenance, documentation and beauty.

Api

The api power represents the possibilities offered by the library and the api comfort is the ease of use and understanding.

Maintenance and documentation

The maintenance represents the frequency and recentness of the commits in the repository.

Customization and beauty

The customization is the amount of options and visual changes possible for the chart. The beauty is really subjective, make your own opinion.

Now let’s check the details for each library. The test was made with some stock price data: a date and a double. All the libraries have been tested with 3 dataset sizes: 15 records, 500 records and 3000 records. Note that the speed of rendering has never been a problem: all the libraries render the chart almost instantly in release mode even with 3000 datapoints on an old device (Flutter rocks!), so the speed of rendering has not been included in the comparison.

Flutter charts

The good old chart library from Google (non official).

This library is very powerful: many charts are available: check the gallery. There are a lot of customization options but the api is really complicated and unfriendly. Furthermore the IDE popups help when you hover a function are not helpful at all (in Vscode).

Two more criteria will be used to evaluate the libraries: the ability to use directly some model data from a class without transforming it and the automatic labeling from a DateTime serie on the x axis, which is very helpful for charting time series.

  • Use model data directly: yes
  • Automatic labeling from datetimes: yes

Some very important criteria for me are the documentation and the maintenance. For Flutter Charts the documentation is good with a lot of examples with code in the gallery. Where it hurts is the maintenance: the repository has not been updated since 4 months. Here is the repository activity chart:

To sum up this library is powerful but hard to get a grip on. It can still be very useful and produces good looking animated charts. The problem is that it seems pretty abandoned today. Strengths and weaknesses of this library in a chart:

Fl chart

A pretty new library, one month old.

This library has a good looking and quite a lot of customization options. But the api does not feel nice: too many nested levels and complexity, unnatural names.

  • Use model data directly: no
  • Automatic labeling from datetimes: no

No datetimes auto labeling so it’s cumbersome to set manually. Also you can not limit the labels length: one data point is one label as far as I understand, which make it impossible to chart bigger datasets. I might have missed something here but did not manage to get it right with long series. A positive point: there is some documentation available with example code , appreciable. Another good sign is that this library is actively developed and maintained:

This library looks promising and I hope it will continue to grow up and add some important features like labels inference from data.

Flarts

A pretty young library too: two months old.

This library is interesting but lacks some features. The api is very intuitive and it is my favorite from all the tested ones. The big problem is the lack of basic customization like the background color of the chart. There is no documentation out of an example.

  • Use model data directly: yes
  • Automatic labeling from datetimes: yes

The labels can be inferred from the data so it’s easy to work with any dataset. And they are well spaced automatically, very appreciable. What is worrying is that this library does not seem to be actively maintained:

As I really like this api and the ease of use I hope that the work will continue and that some customization features will be added as well as documentation. Author if you read this go for it!

Bezier line

A brand new library only for drawing lines: 15 days old.

This is a special one with powerful features: it is the only one that has interactivity. If you long press in the chart the value of the taped datapoint will popup: sweet. The killer feature is horizontal scrolling with zoom and automatic data resampling: you can declare a time scale: only yearly, monthly and weekly actually, and the chart will resize itself with some correct labels when zooming.

  • Use model data directly: no
  • Automatic labeling from datetimes: yes

It is actively developed:

This library is promising for charting timeseries. It is still very young, some customization are missing and some little problems exist for corner cases. I submitted a couple of issues and the guys are reactive. Nice library, focused and with some neat features.

Sparkline

A well established library limited to drawing sparklines with no axis labels.

This library is simple and nice to use but very limited: it can not display axis labels. It has a lot of customization options and a very good documentation. It is mature, so it is less significant that the most recent commits are quite old:

A nice library to work with, polished, which is appreciable in the Flutter jungle of today. It’s usage is limited thus.

Conclusion

I have to say that we are still in a very primitive stage comparing to modern charting libraries, specially the Python ones that are top notch with tons of amazing features.

That said I see that the charting ecosystem in Flutter is on good tracks these days, with many young and promising libraries, thanks to the developers that make this happen.
The evolution is interesting and I hope the development will continue at a fast pace, so that we can reach an acceptable level of maturity and have solid packages on which we can count on.

--

--