Back to amCharts.com

Introduction to ASP.NET controls for amCharts

Note: This section of the documentation does not cover topics related to amCharts in general. You should be familiar with the general workings of amCharts to read and understand these topics. The main amCharts documentation can be found here. "ASP.NET Controls for amCharts" class references can be found here. "ASP.NET Controls for amCharts" is a set of data-bound .NET controls for generating the code required to display amCharts in your ASP.NET 2.x (or higher) websites.

AmCharts are very customizable and flexible Adobe Flash charts. However, generating data and modifying settings on the fly requires a substantial amount of data transformations and XML generation. This is were "ASP.NET Controls for amCharts" step in. This set of ASP.NET controls allows .NET developers to work with amCharts as they would normally do with any native data-bound ASP.NET controls

Core features of "ASP.NET Controls for amCharts"

  • design-time support for creation and customization of amCharts in Visual Studio 2005 or newer;
  • databinding to any .NET compatible data source or data source controls;
  • support for inline or external data generation and settings;
  • supports all settings available in amCharts

System requirements

  • "ASP.NET Controls for amCharts" are distributed as compiled DLL for ASP.NET 2.0 or higher

Installation

  • Download the amCharts distribution packages that you need
  • Extract the appropriate directory from distribution (ampie, amline, etc.) to a folder under your website's root. By default "ASP.NET Controls for amCharts" asume that amPie files are located in ~/amcharts/ampie etc. This can be changed in web.config or in the HTML code.
  • Copy am.Charts.dll from "ASP.NET Controls for amCharts" to the ~/bin directory of your web application.

You can also add "ASP.NET Controls for amCharts" to your Visual Studio toolbox. To do that, right-click on the toolbox in Visual Studio and select "Choose Items…". In the "Choose Toolbox Items" dialog, click the "Browse" button at the bottom of the ".NET Framework Components" tab and select am.Charts.dll from your ~/bin directory, and click "OK".

Configuration

By default, "ASP.NET Controls for amCharts" assumes that amCharts Flash files are located in the appropriate directories under the amCharts directory in the web application root (such as ~/amcharts/ampie/, ~/amcharts/amline/, etc.). If this is not the case, you should inform "ASP.NET Controls for amCharts" about the location of these files. To do that in the web.config of your web application, you must add an application setting with a key of "amcharts_dir". This will specify the location of the root directory for all amCharts subdirectories. You can also add a setting with a key of "ampie_dir" (amline_dir, etc.) to specify exact directory of specific chart files.

For example, if you have amPie files located in ~/flash/charts/ampie/ and amLine located in ~/flash/charts/amline/ you can add a setting for the root directory of your amCharts files. The controls will take it from there:

<appSettings>
    <add key="amcharts_dir" value="~/flash/charts/" />
</appSettings> 

However if, for example, your amPie files are located in ~/pie/ and amLine in ~/files/chart/, you will have to add 2 lines:

<appSettings>
    <add key="ampie_dir" value="~/pie/" />
    <add key="amline_dir" value="~/files/chart/" />
</appSettings> 
Back to top