Beginners: Console is your friend

Type tutorial

If by chance it happened that working with amCharts is also beginning of your programming career, we have a very valuable suggestion for you: View console of your browser Console is a place where all the errors are listed. To access console of Chrome: Use the keyboard shortcut Command – Option – J (Mac) or Control -Shift -J (Windows/Linux). […]

Compiling and minifying JavaScript file from sources

Type tutorial

In case you have OEM/SaaS license of amCharts, you have access to uncompiled sources – they are available in sources folder. These uncompiled sources have long, self explanatory variable names and comments, which are not available in compiled version. Each class is a separate file – this helps quickly find the place you need. If […]

Using events

Type tutorial

I guess most of you are familiar with events model, but in case not, I will try to explain it in as simple way as I can. The chart fires (dispatches) events. Some of them are dispatched without any user interaction, for example, when chart is rendered for the first time, chart fires init event. Other […]

Working with themes

Type tutorial

Version 3.3.0 of our charting packages and version 3.8.0 of our mapping package supports themes. This means that instead of setting every property for each graph or axis or any other object, you can set new defaults in a theme file. This will make devs’ life a lot easier! Take a quick look at this sample. No colors are […]

Understanding data grouping of Stock chart

Type tutorial

In this article we will explain how data grouping feature of stock chart works. Take a look at this example first. If you roll-over the chart so that chart cursor would appear, you will notice that each data point represents one day. This is quite expected, as we provided daily data for this chart. Now, zoom-out to […]

Working with Stock Chart as with Serial chart (important!)

Type tutorial

Our Stock chart can display multiple StockPanels. And Stock Panel inherits all properties and methods of AmSerialChart. This means that pretty much everything you can do with serial chart – add multiple value axes, guides, trend lines, you can also do with Stock panel. Same is with StockGraph – as it extends AmGraph, it can […]

Resizing chart for print

Type tutorial

Usually browsers use different resolution when printing web pages. If you have charts that are wider than ~600-700 pixels, they will print as cropped. To overcome this, use the following code to make the charts redraw using new dimensions before the page is printed: (function() { var beforePrint = function() { for(var i = 0; […]