For definitive info about amCharts library please see it's home page and it's reference page.
You need to download amCharts files. Specifically Column & Bar, Line & Area, Pie & Donut zip files.
Unfortunately amCharts ships as several zips, so you need to download each one from the above path:
and within each of these zips you will find the following files:
Download and place them in the downloaded folder of the Drupal Charts and Graphs module, directly, without any folder structure inside the downloaded folder (e.g. into sites/all/modules/charts_graphs/apis/charts_graphs_amcharts/downloaded).
amCharts implementation for Charts and Graphs dependends on the SWFTools module.
At this point, you should be able to start using AmCharts, but it is highly recommended that you complete following three steps as well:
amCharts for Charts and Graphs also depends on PHP's DOM extension. It is a standard PHP extension. If you have any problem, please see DOM Setup.
The quickest code to get something graphed using AmCharts:
<?php function charts_graphs_test() { $canvas = charts_graphs_get_graph('amcharts'); $canvas->title = 'AmCharts Chart'; $canvas->type = 'line'; $canvas->y_legend = 'Y Legend'; $canvas->colour = '#808000'; $canvas->theme = 'keynote'; $canvas->series = array( 'Some Value' => array(9,6,7,9,5,7,6,9,7), 'Page Views' => array(6,7,9,5,7,6,9,7,3), ); $canvas->x_labels = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'); $out = $canvas->get_chart(); return $out; }
License key owners can refer to the following code to use their keys:
<?php $canvas->key = 'YOUR_KEY';
amCharts implementation for Charts and Graphs supports the settings, chart_series, chart_graphs and pie general parameters. With then the user can set any parameter in amCharts as everything set in it will be passed to amCharts through appropriate XML files and will override any default setting or setting through the standard settings supported by Charts and Graphs.
For details on how to set any of these optional parameters, please see Arbitrary XML Settings.
The settings array deals with the contents of the settings file.
The other three arrays deals with the contents of the data file.
This way the user has complete control on what is being included on the charting call.
With great power comes great responsability.As the ultimate control feature the parameters option intends to be, the values are passed absolutely unchanged as defined by the user. There is no urlencoding, quotes inclusion or any other safety net. The values should be set in a safe and complete manner.
Setting bar width and spacing:
<php $canvas->parameters['chbh'] = "25,5,10";
amCharts supports all main and standardized graph types. It also supports the following graph types:
The amCharts charting library doesn't support the y_step property.
The examples below will only work if you have the amCharts submodule configured correctly.