About “Chart was not disposed” warning

Type tutorial

Are you getting a “Chart was not disposed” warning in your browser console? You’re doing something wrong. Read on for an explanation. When the warning is displayed? When you instantiate a chart, it creates a bunch of objects as well as other stuff like event handlers. All those things occupy computer memory and consume some […]

Tackling label background

Type tutorial

In amCharts 4, labels – be it bullets, axis values, or just about any other text – are not limited to just font size and color. This tutorial will show how you can set background color and shape for them as well. Enabling label background Whenever you see text on a chart, it is represented […]

Formatting date/time and numbers using “Intl” object

Type tutorial

The¬†Intl¬†object is the namespace for the ECMAScript Internationalization API, which provides language sensitive string comparison, number formatting, and date and time formatting. This tutorial will show how you can use Intl options and locales for date/time and number formatting in place of string-based amCharts format definitions. Intro amCharts 4 uses DateFormatter and NumberFormatter objects to […]

Export menu in external container

Type tutorial

By default, the chart places its export menu in one of its corners. This tutorial will show how you can easily move it out of the chart and into any container on your page. The solution If you examine ExportMenu class, you’ll notice the property named container. By default it contains reference to the <div> […]

Changing appearance of focused items

Type tutorial

amCharts 4 comes with extensive accessibility functionality, of which part is ability to highlight focused items with a high-contrast outline. This tutorial will show how you can modify the appearance of this outline. Default behavior Some chart elements – columns, buttons, bullets, or slices to name a few – are selectable via TAB key. When […]

Adding extra info in exported PDF

Type tutorial

amCharts 4 comes pre-loaded with extensive chart export functionality. Besides ability to export chart to various image and data formats, it can also export to PDF documents. This tutorial will show, how you can easily tap into this process to include extra information, like text, tables, and even images, into exported PDF. The task By […]

Modifying chart for export

Type tutorial

Version 4.6.8 brought a new feature to chart exporting functionality: ability to modify chart appearance any way we want before export. For example we’d like to watermark exported charts with an attribution message. Or we want to add any additional titles or info. This tutorial will show how we can do it. The task Let’s […]

Replacing default export icon

Type tutorial

This tutorial will show how you can easily replace the default … in export menu’s top level item with a custom image. Default behavior Export menu displays a button with a triple dot in it: Let’s change it to something else. Top-menu item The menu which is an object of type ExportMenu has a property […]

Using “sticky” tooltips

Type tutorial

Any element on a chart can have tooltipText set to display in form of a tooltip when hovered or touched. This tutorial will show how you can turn those tooltips into “sticky”, so they are always shown, without requiring to hover/touch the element. Requirements The functionality was introduced in version 4.5.4, so if you happen […]

Using superscript and subscript in labels

Type tutorial

This short tutorial will show how you can make parts of any label super- or sub-script using amCharts 4’s in-line text formatting syntax. Enabling PREREQUISITE If you don’t know how square bracket text formatting works, make sure you read the “Visual formatting” section in our Text formatting article. Basically, a square bracket blocks in any […]