Compiling and minifying JavaScript file from sources

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 you made modifications for these sources and wish to compile and minify them into one or several files, you might need some tools for that. We personally use Closure compiler from Google. Of course, we don't paste the source of each class to the field in the left. Instead, we upload all the files to our web server and then paste the following code which has links to all the class files we want to compile:

// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @output_file_name default.js
// @code_url http://extra.amcharts.com/AmSerialChart.js
// @code_url http://extra.amcharts.com/AmXYChart.js
// @code_url http://extra.amcharts.com/AmPieChart.js
// ==/ClosureCompiler==

Then, after clicking Compile button, if the application will find all the files you indicated, you will get minified and merged source code on the right.

You can use this technique to reduce the size of the amCharts library. For example, if you are not using ChartCursor or ChartScrollbar or some other features, you can omit these classes and do not include them when compiling. You can use this service to compile export as image files into one, minified file.