Angular2 directives for AnyChart
npm install anychart-angular2
AngularJS v2.x directives for AnyChart
=========
AngularJS v2.x directives for AnyChart provide an easy way to use AnyChart JavaScript Charts
with Angular2 Framework.
npm install anychart-angular2
bower install anychart-angular2
yarn add anychart-angular2
html
Angular Quick Start
Loading AppComponent content here ...
`
Run the demo
1) Go to any of demos
directory
2) Install all dependencies with npm install command.
3) Start the demo with npm run start command.
Build
1) Despite the AnyChart-Angular2 integration is available with package managers, the license allows to modify and use it freely (though you need AnyChart license to use the library itself in commercial projects). This quick start guide clarifies the structure of integration project and explains how it works and how it can be used.
If the integration is cloned from GitHub and Node Package Manager (npm command) is available in command line, the following command compiles source code to dist/ directory:
`sh
npm run build
`
2) If needed, package.json of demo-application can be configured to declare custom run-commands
and to add required dependencies excepting already included.
3) Run npm install command to load all required npm modules.
4) Configure systemjs.config.js to declare the mapping of dependencies of
application (see any demo
to see the basic configuration). In 'map'-section AnyChart integration library is declared:
`
...
'anychart-angular2': 'node_modules/anychart-angular2'
`
5) In 'packages'-section anychart-angular2 library is declared:
`
'anychart-angular2': {
main: 'index'
}
`
6) These actions allow to use anychart-angular2 integration in an application
like one described in Quick start.
7) Since 'app' folder is declared in systemjs.config.js as application root
directory, the application's Angular2 modules and components can be created
right there.
Package directory
`
├── def
│ ├── anychart.d.ts
│ ...
├── dist
│ ├── anychart.directive.d.ts
│ ├── anychart.directive.js
│ ...
├── src
│ ├── anychart.directive.ts
│ ├── anychart.service.ts
│ ...
│ components.d.ts
│ components.js
│ package.json
│ LICENSE
│ README.md
│ ...
`
- def/anychart.d.ts -
Anychart typescript definition file. Used to correctly compile source
code to dist/ directory.
- dist/ -
Output directory that contains compiled js and d.ts files. The general component
declarations (components.js and components.d.ts) rely on this directory
content.
- src/ -
Source code directory. Contains Angular2-compatible components to provide
AnyChart integration.
- components.d.ts and components.js -
Components definition. Relies on dist/ directory content.
- package.json -
Package manager configuration file. Also contains descriptions of
available run commands (including build command) and the list of dependencies.
Demos overview
See these samples to learn how things work:
* Load Data From JSON: Async data loading sample. Also
shows how AnychartService can be used. Note: this demo can be launched only from a web-server, in browser window, because of cross origin requests security issues.
* Gantt Project After Draw: Shows how to create a Gantt Project
Chart and add the after-draw handler.
* Gantt Resource with Instance: Shows how to use manually created
instance of a Gantt Resource chart and how to add the after-draw handler.
* Line Chart After Draw: Shows how to create and use instance
of a chart and add the after-draw handler.
* Line Chart Data Streaming: Simple data streaming demo.
* Simple Charts On Stage: Shows how to create and add simple
charts on the anychart stage and how to add the after-draw handler.
* Simple Gantt Project: Simple Gantt Project Chart demo.
* Simple Map: Simple AnyMap demo.
* Simple Pie: Simple Pie chart demo.
* Simple Stock Area: Simple AnyStock demo.
* Software Sales Dashboard: Shows how to use anychart-stage`