If you are a frontend software engineer, it is likely you will need to implement some kind of chart or data visualization in your app at some point. Whether you are building a full-blown analytics tool or enriching some small part of your application, you will need a charting library that is easy to use, highly-configurable and features a wide range of chart types. You will typically reach for a familiar library already in use on thousands of other web apps; something to get the job done.

But, if your experience is anything like mine, you will most likely find your chosen library is deficient in some significant way. If you are lucky, you will discover this early on, before a requirements change truly lands you in hot water. You may find your chosen library does not support more complex visualizations or has minor – but nonetheless irritating – bugs around chart sizing and positioning.

It is no surprise that most charting libraries are lacking in some way. A well-designed, reliable and feature-rich charting library is a huge feat of engineering. It takes a significant amount of skill, time and effort to build these things. But the non-commerical, open-source library we all desire means that projects often rely on part-time contributions from a small group of volunteer engineers.

So when I recently needed to select a charting library for an enterprise SaaS application, I decided to do some extensive research to find a better solution. I looked at open-source and commercial libraries to find something with a wide-range of chart types; something that was easy to use; and something that had no or few bugs. And, amazingly, I found it. The library is called ECharts.

What Is ECharts?

ECharts is a Javascript charting library created by Baidu. The project is open-source and available on Github but you can download builds direct from the ECharts website. Having used ECharts for over 6 months now, I highly recommend you consider it the next time you are looking for a robust charting library.

The first thing you will notice is that ECharts boasts a huge number of chart types out of the box. Your standard line, bar and pie charts are there, as well as more complex types like geographic maps, tree diagrams and Sankey diagrams. A few add-on chart types are also available. This breadth is important since it avoids the need for a mishmash of charting libraries for different types of visualizations.

But dig deeper into the ECharts examples and you will see that almost everything on a chart is configurable. Every chart is controlled by an ‘option’ object which is fully documented and easy to use. With a little work on colours, tooltips, line styles, etc, you can get each chart looking just perfect.

So what about robustness? I am glad to say that in 6 months, I have only encountered 2 or 3 minor issues with ECharts. For one of those issues, ECharts readily accepted a pull request. The other issues were very niche and there were easy workarounds. ECharts has made it quick and easy to create charts and, unlike other charting libraries, I have not spent much time diagnosing problems. All in all, it is a very positive experience.

Choosing a Charting Library

Charts and visualizations are often an extremely important feature of an enterprise SaaS application. A good chart tells a good story and should be easy to interpret and interact with. By making a chart part of an app’s ‘native experience’, we can deliver a high-quality product that really makes users smile.

It is unfortunate then that many teams will choose any-old charting library without due consideration. The focus is often on ‘getting the job done’ and choices may be based on the engineers’ familiarity with a particular library. But this could result in a poor experience for users and will often result in regret when the new library faces its first teething problems.

Being such a critical part of an app, you should take the time now to evaluate all the possible solutions. Think about the present and future requirements and play around with a few different libraries. Choosing the best library now can result in a better-quality product and minimize the risk of an overhaul in the future.

But whatever you do, take a look at ECharts. Seriously. It is one of the best charting libraries I have ever seen. Since I stumbled upon it by chance, I feel I need to spread the word. It may not be the right choice for every project, but it is worth evaluating.

Leave a Reply

Your email address will not be published. Required fields are marked *