amCharts AngularJS Directive

1.1.0 · abandoned · verified Wed Apr 22

This package provides an AngularJS directive for integrating amCharts visualizations into web applications. Its current stable version is 1.1.0, and it appears to be an abandoned project, with no active development or maintenance since its last release. The package targets the original AngularJS framework (version 1.x) and its ecosystem, including installation via Bower. Key differentiators at the time of its development included simplifying the integration of various amCharts types, such as serial, pie, radar, and funnel charts, directly within an AngularJS application. It supports both static configuration options and promise-based data loading, allowing for asynchronous chart rendering. Given its foundation on AngularJS, which reached End-of-Life, and its reliance on deprecated tools like Bower, this package is not suitable for modern web development or contemporary Angular applications.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to set up an AngularJS application with the amCharts-Angular directive, load the necessary libraries, and render a basic serial chart using static data defined within the controller's scope.

<!-- Include AngularJS and amCharts libraries first -->
<script type="text/javascript" src="path/to/angular.min.js"></script>
<script type="text/javascript" src="path/to/amcharts/amcharts.js"></script>
<script type="text/javascript" src="path/to/amcharts/serial.js"></script>
<!-- Include the amCharts-Angular directive -->
<script type="text/javascript" src="path/to/amChartsDirective.js"></script>

<div ng-app="MyModule">
    <div ng-controller="MyController">
        <am-chart id="myFirstChart" options="amChartOptions" height="100%" width="100%"></am-chart>
    </div>
</div>

<script>
    angular.module('MyModule', ['amChartsDirective'])
    .controller('MyController', ['$scope', function($scope) {
        $scope.amChartOptions = {
            data: [{
                year: 2005,
                income: 23.5,
                expenses: 18.1
            }, {
                year: 2006,
                income: 26.2,
                expenses: 22.8
            }, {
                year: 2007,
                income: 30.1,
                expenses: 23.9
            }, {
                year: 2008,
                income: 29.5,
                expenses: 25.1
            }, {
                year: 2009,
                income: 24.6,
                expenses: 25
            }],
            type: "serial",
            categoryField: "year",
            rotate: true,
            pathToImages: 'https://cdnjs.cloudflare.com/ajax/libs/amcharts/3.13.0/images/',
            legend: {
                enabled: true
            },
            chartScrollbar: {
                enabled: true,
            },
            categoryAxis: {
                gridPosition: "start",
                parseDates: false
            },
            valueAxes: [{
                position: "top",
                title: "Million USD"
            }],
            graphs: [{
                type: "column",
                title: "Income",
                valueField: "income",
                fillAlphas: 1
            }]
        };
    }]);
</script>

view raw JSON →