Individual legend item for each column

Type tutorial

Normally on an XY Chart, Legend creates a single item for each Series. This brief tutorial will show how you can create custom legend which will show an item for each individual column in a single Column series. Base chart Let’s take this chart as a base. It uses an adapter to color each column […]

Chart element class names and CSS

Type tutorial

amCharts 4 allows automatically adding element-specific class attributes to its SVG elements for easy targeting via CSS selectors. This tutorial explains how to enable and use them. Enabling class names By default, when chart is generating SVG elements, no class attributes are added to it’s element. Let’s take a simple Line series with bullets: The […]

Modifying big number prefixes

Type tutorial

amCharts’ number formatter has a way of formatting numbers in a variety of ways, including converting to prefix/suffix-based shorter equivalents. This tutorial will explain how you can tweak it according to your needs. The problem Extremely big numbers on a chart can be confusing and wasteful of space: Let’s see how we can fix that. […]

Truncating legend labels

Type tutorial

Sometimes chart legend can get out of control size-wise, especially if you have long labels. This tutorial will show how you can get it back in check by capping the length of its labels. The problem Long labels will bloat up legend size. This is especially prominent where chart size is not very big: Even […]

Combining different axis types

Type tutorial

amCharts allows any number of any type combined in the same XY Chart. Below demo demonstrates how you can combine utterly incompatible scales – numeric and date/time – with separate Value and Number axes.

Lazy loading amCharts modules

Type tutorial

It is possible to load the amCharts library only when needed. This tutorial will explain how. The import() expression is the official way to lazy load any ES6 module, including amCharts. However, import() can only import a single module, so you have to combine it with Promise.all to load multiple modules. Here is how to […]

Using curved labels

Type tutorial

In amCharts 4 any SVG label can follow any curve. This tutorial will explain how it works and how you can spice up the look of your charts in various situations, using curved labels. The basics All text labels in amCharts 4 are represented by an object of type Label. To make a label follow […]

Using “fill rules” on a Date Axis

Type tutorial

This tutorial will show how to highlight weekends on a Date Axis. It will explain how you can use custom function to force your own custom logic in determining what ranges of dates should be highlighted and how. Base chart Let’s take a simple Date-based chart. Enabling axis fills We do have nice clean grid. […]

Different column fill colors for positive and negative values

Type tutorial

This tutorial will explain how you can use adapters to fill columns to different colors, based on their value. The task Let’s say we have a column chart that has both positive and negative values. Right now, all of the columns are filled with a single color. What we want to do, is to color […]

Styling or removing tooltip shadow

Type tutorial

Most of the elements on charts can display a tooltip when hovered. By default, a tooltip will cast a slight shadow behind it. This tutorial will explain on how to style it, or get rid of it altogether. Accessing tooltip Before we can start, let’s see how we can access the tooltip, that is Tooltip […]