Skip to content

Commit

Permalink
Amexio Charts added
Browse files Browse the repository at this point in the history
1.Area
2.Bar
3.column
4.gauge
5.histogram
6.line
7.pie
8.geo
9.donut
  • Loading branch information
sagarthecook committed Aug 11, 2017
1 parent ca57351 commit 56d7073
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amexio-ng-extensions",
"version": "2.0.3",
"version": "2.1.0",
"scripts": {
"build": "gulp build",
"build:watch": "gulp",
Expand Down
8 changes: 6 additions & 2 deletions src/modules/charts/src/areachart/area.chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Author - Sagar Jadhav
*
*/
import {AfterContentInit, Component, ContentChildren, Input, QueryList} from '@angular/core';
import {AfterContentInit, Component, ContentChildren, Input, OnInit, QueryList} from '@angular/core';
import {ChartBaseClass} from "../baseclass/base.chart.class";
import {ChartLegendComponent} from "../chartlegend/chart.legend.component";
import {ChartTitleComponent} from "../charttitle/chart.title.component";
Expand All @@ -27,7 +27,7 @@ declare var google: any;
></div>`
})

export class AreaChartComponent extends ChartBaseClass implements AfterContentInit {
export class AreaChartComponent extends ChartBaseClass implements AfterContentInit ,OnInit{

private options;
private areaData;
Expand Down Expand Up @@ -122,4 +122,8 @@ export class AreaChartComponent extends ChartBaseClass implements AfterContentIn
this.chartAreaComponent=this.chartAreaArray.pop();
}
}
ngOnInit(): void {
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}
}
10 changes: 7 additions & 3 deletions src/modules/charts/src/barchart/bar.chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
*
*/

import {AfterContentInit, Component, ContentChildren, Input, QueryList} from "@angular/core";
import {AfterContentInit, Component, ContentChildren, Input, OnInit, QueryList} from "@angular/core";
import {ChartBaseClass} from "../baseclass/base.chart.class";
import {ChartLegendComponent} from "../chartlegend/chart.legend.component";
import {ChartTitleComponent} from "../charttitle/chart.title.component";
import {ChartLoaderService} from "../chart.loader.service";
import {ChartAreaComponent} from "../chartarea/chart.area.component";

declare var google: any;
@Component({
selector: 'amexio-chart-bar',
template: `
Expand All @@ -28,7 +28,7 @@ import {ChartAreaComponent} from "../chartarea/chart.area.component";
</div>
`
})
export class BarChartComponent extends ChartBaseClass implements AfterContentInit {
export class BarChartComponent extends ChartBaseClass implements AfterContentInit ,OnInit{

private options;
private barData;
Expand Down Expand Up @@ -133,4 +133,8 @@ export class BarChartComponent extends ChartBaseClass implements AfterContentIni
this.chartAreaComponent=this.chartAreaArray.pop();
}
}
ngOnInit(): void {
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}
}
2 changes: 0 additions & 2 deletions src/modules/charts/src/baseclass/base.chart.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export class ChartBaseClass {
} else {
google.charts.load('current', {packages: ['corechart']});
}
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}

//draw charts
Expand Down
8 changes: 6 additions & 2 deletions src/modules/charts/src/columnchart/column.chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Author - Sagar Jadhav
*
*/
import {AfterContentInit, Component, ContentChildren, Input, QueryList} from '@angular/core';
import {AfterContentInit, Component, ContentChildren, Input, OnInit, QueryList} from '@angular/core';
import {ChartBaseClass} from "../baseclass/base.chart.class";
import {ChartLegendComponent} from "../chartlegend/chart.legend.component";
import {ChartTitleComponent} from "../charttitle/chart.title.component";
Expand All @@ -28,7 +28,7 @@ declare var google: any;
`
})

export class ColumnChartComponent extends ChartBaseClass implements AfterContentInit {
export class ColumnChartComponent extends ChartBaseClass implements AfterContentInit ,OnInit{

private options;
private columnData;
Expand Down Expand Up @@ -124,4 +124,8 @@ export class ColumnChartComponent extends ChartBaseClass implements AfterConten
this.chartAreaComponent=this.chartAreaArray.pop();
}
}
ngOnInit(): void {
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}
}
7 changes: 5 additions & 2 deletions src/modules/charts/src/donutchart/donut.chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ declare var google: any;
`
})

export class DonutChartComponent extends ChartBaseClass implements AfterContentInit {
export class DonutChartComponent extends ChartBaseClass implements AfterContentInit ,OnInit{

private options;
private donutData;
Expand Down Expand Up @@ -123,5 +123,8 @@ export class DonutChartComponent extends ChartBaseClass implements AfterContentI
this.chartAreaComponent=this.chartAreaArray.pop();
}
}

ngOnInit(): void {
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}
}
9 changes: 7 additions & 2 deletions src/modules/charts/src/gaugechart/gauge.chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
* Author - Sagar Jadhav
*
*/
import {Component, Input} from '@angular/core';
import {Component, Input, OnInit} from '@angular/core';
import {ChartBaseClass} from "../baseclass/base.chart.class";
import {ChartLoaderService} from "../chart.loader.service";
declare var google: any;
@Component({
selector: 'amexio-chart-gauge',
template: `
Expand All @@ -24,7 +25,7 @@ import {ChartLoaderService} from "../chart.loader.service";
`
})

export class GaugeChartComponent extends ChartBaseClass {
export class GaugeChartComponent extends ChartBaseClass implements OnInit{

private options;
private gaugeData;
Expand Down Expand Up @@ -67,4 +68,8 @@ export class GaugeChartComponent extends ChartBaseClass {
this.chart = this.createGaugeChart(document.getElementById(this.id));
this.chart.draw(this.gaugeData, this.options);
}
ngOnInit(): void {
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}
}
8 changes: 6 additions & 2 deletions src/modules/charts/src/geochart/geo.chart.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Created by sagar on 10/8/17.
*/
import {AfterContentInit, Component, ContentChildren, Input, QueryList} from '@angular/core';
import {AfterContentInit, Component, ContentChildren, Input, OnInit, QueryList} from '@angular/core';
import {ChartBaseClass} from "../baseclass/base.chart.class";
import {ChartAreaComponent} from "../chartarea/chart.area.component";
import {ChartLoaderService} from "../chart.loader.service";
Expand All @@ -18,7 +18,7 @@ declare var google: any;
`
})

export class GeoChartComponent extends ChartBaseClass implements AfterContentInit {
export class GeoChartComponent extends ChartBaseClass implements AfterContentInit ,OnInit{

private options;
private geomapData;
Expand Down Expand Up @@ -78,4 +78,8 @@ export class GeoChartComponent extends ChartBaseClass implements AfterContentIni
this.chartAreaComponent=this.chartAreaArray.pop();
}
}
ngOnInit(): void {
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Author - Sagar Jadhav
*
*/
import {AfterContentInit, Component, ContentChildren, Input, QueryList} from '@angular/core';
import {AfterContentInit, Component, ContentChildren, Input, OnInit, QueryList} from '@angular/core';
import {ChartBaseClass} from "../baseclass/base.chart.class";
import {ChartLegendComponent} from "../chartlegend/chart.legend.component";
import {ChartTitleComponent} from "../charttitle/chart.title.component";
Expand All @@ -30,7 +30,7 @@ declare var google: any;
`
})

export class HistogramChartComponent extends ChartBaseClass implements AfterContentInit {
export class HistogramChartComponent extends ChartBaseClass implements AfterContentInit,OnInit {

private options;
private histogramData;
Expand Down Expand Up @@ -125,4 +125,8 @@ export class HistogramChartComponent extends ChartBaseClass implements AfterCont
this.chartAreaComponent=this.chartAreaArray.pop();
}
}
ngOnInit(): void {
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}
}
8 changes: 6 additions & 2 deletions src/modules/charts/src/linechart/line.chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Author - Sagar Jadhav
*
*/
import {AfterContentInit, Component, ContentChildren, Input, QueryList} from '@angular/core';
import {AfterContentInit, Component, ContentChildren, Input, OnInit, QueryList} from '@angular/core';
import {ChartAreaComponent} from "../chartarea/chart.area.component";
import {ChartLegendComponent} from "../chartlegend/chart.legend.component";
import {ChartTitleComponent} from "../charttitle/chart.title.component";
Expand All @@ -29,7 +29,7 @@ declare var google: any;
`
})

export class LineChartComponent extends ChartBaseClass implements AfterContentInit {
export class LineChartComponent extends ChartBaseClass implements AfterContentInit,OnInit {

private options;
private lineData;
Expand Down Expand Up @@ -124,4 +124,8 @@ export class LineChartComponent extends ChartBaseClass implements AfterContentIn
this.chartAreaComponent=this.chartAreaArray.pop();
}
}
ngOnInit(): void {
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}
}
8 changes: 6 additions & 2 deletions src/modules/charts/src/piechart/pie.chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Author - Sagar Jadhav
*
*/
import {AfterContentInit, Component, ContentChildren, Input, QueryList} from "@angular/core";
import {AfterContentInit, Component, ContentChildren, Input, OnInit, QueryList} from "@angular/core";
import {ChartTitleComponent} from "../charttitle/chart.title.component";
import {ChartLegendComponent} from "../chartlegend/chart.legend.component";
import {ChartLoaderService} from "../chart.loader.service";
Expand All @@ -25,7 +25,7 @@ declare var google: any;
></div>
`
})
export class PieChartComponent extends ChartBaseClass implements AfterContentInit {
export class PieChartComponent extends ChartBaseClass implements AfterContentInit,OnInit {

private options;
private pieData;
Expand Down Expand Up @@ -132,5 +132,9 @@ export class PieChartComponent extends ChartBaseClass implements AfterContentIni
this.chartAreaComponent=this.chartAreaArray.pop();
}
}
ngOnInit(): void {
//call draw chart method
google.charts.setOnLoadCallback(() => this.drawChart());
}
}

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amexio-ng-extensions",
"version": "2.0.3",
"version": "2.1.0",
"repository": {
"type": "git",
"url": "https://github.com/meta-magic/amexio.github.io"
Expand Down

0 comments on commit 56d7073

Please sign in to comment.