Overriding series’ tooltip fill color

Type tutorial

Normally, a Tooltip that is displayed when you hover or touch a series’ item – slice, column, etc. – is colored the same way as the related object. This quick tutorial will show you how to override that color. To turn off “inheritance” of color from related object, we can set getFillFromObject = falseĀ for the […]

Positioning XY Cursor via API

Type tutorial

Sometimes you might need to programatically position your chart cursor. This tutorial will show how. Base chart Let’s use this stacked XY chart with a Cursor pre-configured: Placing cursor Our reference chart has a Category axis with categories like “One”, “Two”, “Three”, etc. We’d like to place our cursor at, say, “Three”. This means that […]

Dynamically adding and removing Series

Type tutorial

This tutorial will show how you can dynamically add and remove series to the chart. Adding series Adding a series to the chart is as simple as pushing a series object into chart’s seriesĀ list: let series = new am4charts.LineSeries(); // configure series chart.series.push(series); var series = new am4charts.LineSeries(); // configure series chart.series.push(series); The chart will […]

Using Axis Ranges on Radar Chart

Type tutorial

This quick tutorial will show how you can use Axis Ranges on a Radar chart. If you are already using Radar chart, you know that its essentially bent XY chart. Which means it has X and Y axes, that can be one of the three types: Value, Date, or Category. This also means, that whatever […]

Disabling toggling of items in Legend

Type tutorial

Normally a Legend will allow toggling of its items. This will also toggle related items, like chart’s Series. This tutorial will show how to disable this default functionality. To disable toggling of items, all we have to do is to make those items non-clickable. Legend’s items are stored in its itemContainers template list. So all we […]

Pre-zooming an axis

Type tutorial

This tutorial will explain how you can set up your charts to initialize pre-zoomed. Prerequisites This tutorial relies on event handlers. We recommend reading up on how events work in amCharts 4 in “Event Listeners” article. Reference chart Let’s start off with a simple date-based chart: Setting up pre-zoom There currently are no properties on […]

Wrapping, truncating, and auto-rotating axis labels

Type tutorial

This tutorial will explain how you can deal with very long axis labels, by wrapping and/or truncating them. Prerequisites If you haven’t done that already, we suggest you take a look at the “Positioning Axis Elements” article, which explains the principles about configuring Axis elements, including the concept of “axis renderer”. Moving forward we will […]

Chart Legend in an External Container

Type tutorial

This tutorial will show you how you can easily move your chart legend outside main container into a totally separate one. NOTE We’re going to be using Pie chart as an example in this tutorial. However, this applies to any other chart type that uses Legend. Base chart Let’s start with a basic Pie chart […]