158

Bridging the gap between low-level and high-level JavaScript Chart libraries.

 5 years ago
source link: https://www.tuicool.com/articles/hit/AFJVBjy
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Presenting data in an effective way is becoming more and more important in the data-driven world. For web developers, the choice of selecting the right data-visualization library is vast and the list of chart libraries is getting bigger every day. You might ask now — why again?

rieUZba.png!web

ApexCharts — Open-Source JavaScript Chart library

RfyU3uB.png!web

ApexCharts is a free and open-source modern charting library that helps developers to create interactive visualizations for web pages. It is developed to bridge the gap between low-level and high-level chart libraries.

But, Why the need for another chart library?

Granted, there are dozens of chart libraries including the commercial ones which have evolved heavily in the last decade. Many of them are simply amazing, but costly to use for a simple dashboard. Many of them are just bloated trying to do everything but fails to do one thing perfectly. ApexCharts attempts to pick good things from these high-level libraries and provide one with a simple approach. It doesn’t try to be a “one size fits all” solution, but rather a proposal to provide in-built common charts which are used on web dashboards.

So, what problem does ApexCharts solves?

We will compare ApexCharts with existing open-source high-level, declarative chart solutions and not a low-level chart framework (d3.js).

1. Easier zooming, panning & scrolling

Many open-source chart libraries don’t support this highly interactive feature out of the box. Some do provide this as add-on but I haven’t seen a smoother experience in them. ApexCharts places good amount of importance to the zooming/scrolling and allows multiple options to traverse the data in the chart.

AF7bQrQ.gif

2. Placing annotations

Informative labels along with lines placed over specific values on y-axis and/or x-axis can be incredibly helpful to interpret charts easily. ApexCharts has finite control over the placements of the annotations including font-size/color/border of the labels and line.

R7Vb6f7.png!web

3. Triggering events on user’s actions to provide additional data in callbacks

The true meaning of interactivity is — combining multiple charts and passing information one to other. This is achieved by triggering events on several actions and returning the new data in the callback functions — the new data then can be used to modify the data of other charts. This way we have unlimited possibilities to create charts based on other charts.

FFbeEnm.gif

4. Truly responsive

Responsiveness in charts isn’t just resizing the whole chart and make it equal to screen size, but allow to provide multiple configs for different screen sizes. ApexCharts has an intuitive way to override default config with another config based on viewport width.

q6zyUnE.gif

5. A way to customize nearly every element

Don’t just limit your charts with plain colors in the primary elements. Give colors, gradients, shadows, patterns, images to your chart components and customize to fit your design needs. You can even customize the SVG element through css as each element is given a unique class name.

6. Sparklines

Utilize sparkLines to indicate trends in data, for example, occasional increments or declines, monetary cycles, or to feature most extreme and least values.

6RriUbb.png!web

7. Heatmaps

Use Heatmaps to represent data through colors and shades. Frequently used with bigger data collections, they are valuable for recognizing patterns and area of focus.

YRRbAfz.png!web

8. Cool Gauges that enhances Dashboards

The tiny gauges are an important part of a dashboard and are useful in displaying single series data.

Zrquu2Q.png!web

Any Dependency?

ApexCharts has a dependency on SVG.js , a battle-tested SVG library. Without re-inventing the wheel in this area, we leverage the full power of SVG.js. All the graphics/drawing work, animations, filtering, etc is lifted by the SVG.js library.

ApexCharts on Github


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK