Skip to content

Commit be9afb9

Browse files
committed
Merge branch 'release/2.0.0'
2 parents b5219dc + 1e2a929 commit be9afb9

File tree

122 files changed

+19205
-1936
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+19205
-1936
lines changed

README.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
# angular2-fusioncharts
1+
# angular-fusioncharts
22

33
## Installation
44

5-
To install `angular2-fusioncharts` library, run:
5+
To install `angular-fusioncharts` library, run:
66

77
```bash
8-
$ npm install angular2-fusioncharts --save
8+
$ npm install angular-fusioncharts --save
99
```
1010

11+
To install `fusioncharts` library:
12+
```bash
13+
$ npm install fusioncharts --save
14+
```
1115
And then in your Angular `AppModule`:
1216

1317
```typescript
@@ -16,16 +20,16 @@ import { NgModule } from '@angular/core';
1620

1721
import { AppComponent } from './app.component';
1822

19-
// Import angular2-fusioncharts
20-
import { FusionChartsModule } from 'angular2-fusioncharts';
23+
// Import angular-fusioncharts
24+
import { FusionChartsModule } from 'angular-fusioncharts';
2125

2226
// Import FusionCharts library and chart modules
23-
import * as FusionCharts from 'fusioncharts';
24-
import * as Charts from 'fusioncharts/fusioncharts.charts';
25-
import * as FintTheme from 'fusioncharts/themes/fusioncharts.theme.fint';
27+
import FusionCharts from 'fusioncharts/core';
28+
import Column2d from 'fusioncharts/viz/column2d';
29+
import FusionTheme from 'fusioncharts/themes/es/fusioncharts.theme.fusion';
2630

2731
// Pass the fusioncharts library and chart modules
28-
FusionChartsModule.fcRoot(FusionCharts, Charts, FintTheme);
32+
FusionChartsModule.fcRoot(FusionCharts, Column2d, FusionTheme);
2933

3034
@NgModule({
3135
declarations: [
@@ -58,30 +62,28 @@ export class AppComponent {
5862
title: string;
5963

6064
constructor() {
61-
this.title = "Angular 2 FusionCharts Sample";
65+
this.title = "Angular FusionCharts Sample";
6266

6367
this.dataSource = {
6468
"chart": {
65-
"caption": "Harry's SuperMart",
66-
"subCaption": "Top 5 stores in last month by revenue"
69+
"caption": "Countries With Most Oil Reserves [2017-18]",
70+
"subCaption": "In MMbbl = One Million barrels",
71+
"xAxisName": "Country",
72+
"yAxisName": "Reserves (MMbbl)",
73+
"numberSuffix": "K",
74+
"theme": "fusion",
6775
},
68-
"data": [{
69-
"label": "Bakersfield Central",
70-
"value": "880000"
71-
}, {
72-
"label": "Garden Groove harbour",
73-
"value": "730000"
74-
}, {
75-
"label": "Los Angeles Topanga",
76-
"value": "590000"
77-
}, {
78-
"label": "Compton-Rancho Dom",
79-
"value": "520000"
80-
}, {
81-
"label": "Daly City Serramonte",
82-
"value": "330000"
83-
}]
84-
}
76+
"data": [
77+
{ "label": "Venezuela", "value": "290" },
78+
{ "label": "Saudi", "value": "260" },
79+
{ "label": "Canada", "value": "180" },
80+
{ "label": "Iran", "value": "140" },
81+
{ "label": "Russia", "value": "115" },
82+
{ "label": "UAE", "value": "100" },
83+
{ "label": "US", "value": "30" },
84+
{ "label": "China", "value": "30" }
85+
]
86+
};
8587
}
8688
}
8789
```
@@ -114,4 +116,4 @@ To lint all `*.ts` files:
114116
```bash
115117
$ npm run lint
116118
```
117-
### [Demos and Documentation](http://fusioncharts.github.io/angular2-fusioncharts/)
119+
### [Demos and Documentation](http://fusioncharts.github.io/angular-fusioncharts/)

dist/README.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# angular-fusioncharts
2+
3+
## Installation
4+
5+
To install `angular-fusioncharts` library, run:
6+
7+
```bash
8+
$ npm install angular-fusioncharts --save
9+
```
10+
11+
To install `fusioncharts` library:
12+
```bash
13+
$ npm install fusioncharts --save
14+
```
15+
And then in your Angular `AppModule`:
16+
17+
```typescript
18+
import { BrowserModule } from '@angular/platform-browser';
19+
import { NgModule } from '@angular/core';
20+
21+
import { AppComponent } from './app.component';
22+
23+
// Import angular-fusioncharts
24+
import { FusionChartsModule } from 'angular-fusioncharts';
25+
26+
// Import FusionCharts library and chart modules
27+
import FusionCharts from 'fusioncharts/core';
28+
import Column2d from 'fusioncharts/viz/column2d';
29+
import FusionTheme from 'fusioncharts/themes/es/fusioncharts.theme.fusion';
30+
31+
// Pass the fusioncharts library and chart modules
32+
FusionChartsModule.fcRoot(FusionCharts, Column2d, FusionTheme);
33+
34+
@NgModule({
35+
declarations: [
36+
AppComponent
37+
],
38+
imports: [
39+
BrowserModule,
40+
// Specify FusionChartsModule as import
41+
FusionChartsModule
42+
],
43+
providers: [],
44+
bootstrap: [AppComponent]
45+
})
46+
export class AppModule { }
47+
```
48+
49+
Once the library is imported, you can use its components, directives in your Angular application:
50+
51+
In your Angular AppComponent:
52+
53+
```javascript
54+
import {Component} from '@angular/core';
55+
56+
@Component({
57+
selector: 'my-app',
58+
templateUrl: './app.component.html'
59+
})
60+
export class AppComponent {
61+
dataSource: Object;
62+
title: string;
63+
64+
constructor() {
65+
this.title = "Angular FusionCharts Sample";
66+
67+
this.dataSource = {
68+
"chart": {
69+
"caption": "Countries With Most Oil Reserves [2017-18]",
70+
"subCaption": "In MMbbl = One Million barrels",
71+
"xAxisName": "Country",
72+
"yAxisName": "Reserves (MMbbl)",
73+
"numberSuffix": "K",
74+
"theme": "fusion",
75+
},
76+
"data": [
77+
{ "label": "Venezuela", "value": "290" },
78+
{ "label": "Saudi", "value": "260" },
79+
{ "label": "Canada", "value": "180" },
80+
{ "label": "Iran", "value": "140" },
81+
{ "label": "Russia", "value": "115" },
82+
{ "label": "UAE", "value": "100" },
83+
{ "label": "US", "value": "30" },
84+
{ "label": "China", "value": "30" }
85+
]
86+
};
87+
}
88+
}
89+
```
90+
91+
92+
```xml
93+
<!-- You can now use fusioncharts component in app.component.html -->
94+
<h1>
95+
{{title}}
96+
</h1>
97+
<fusioncharts
98+
width="600"
99+
height="350"
100+
type="Column2D"
101+
dataFormat="JSON"
102+
[dataSource]="dataSource"
103+
></fusioncharts>
104+
```
105+
106+
## Development
107+
108+
To generate all `*.js`, `*.js.map` and `*.d.ts` files:
109+
110+
```bash
111+
$ npm run tsc
112+
```
113+
114+
To lint all `*.ts` files:
115+
116+
```bash
117+
$ npm run lint
118+
```
119+
### [Demos and Documentation](http://fusioncharts.github.io/angular-fusioncharts/)

0 commit comments

Comments
 (0)