Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 40 additions & 13 deletions dist/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ var FusionChartsService = /** @class */ (function () {
FusionChartsService.prototype.getFusionChartsStatic = function () {
return this._fusionchartsStatice;
};
FusionChartsService.prototype.getNextItemCount = function () {
FusionChartsService.itemCount++;
return FusionChartsService.itemCount;
};
FusionChartsService._fcRoot = null;
FusionChartsService.itemCount = 0;
FusionChartsService.decorators = [
{ type: _angular_core.Injectable },
];
Expand Down Expand Up @@ -416,6 +421,7 @@ var FusionChartsComponent = /** @class */ (function () {
};
this.element = element;
this.fusionchartsService = fusionchartsService;
this.containerId = fusionchartsService.getNextItemCount();
}
// @ViewChild('samplediv') chartContainer: ElementRef;
FusionChartsComponent.prototype.ngOnInit = function () {
Expand Down Expand Up @@ -465,22 +471,37 @@ var FusionChartsComponent = /** @class */ (function () {
this.chartObj.chartType(this.type);
}
};
FusionChartsComponent.prototype.attachChartEventListener = function (chartObj, eventName) {
var _this_1 = this;
chartObj.addEventListener(eventName, function (eventObj, dataObj) {
var fEventObj = { eventObj: {}, dataObj: {} };
if (eventObj)
fEventObj.eventObj = eventObj;
if (dataObj)
fEventObj.dataObj = dataObj;
_this_1[eventName].emit(fEventObj);
/*
// Removed as some events will be fired
attachChartEventListener(chartObj: any, eventName: string){
chartObj.addEventListener(eventName, (eventObj:any, dataObj:any) => {
let fEventObj:FusionChartsEvent = { eventObj:{}, dataObj:{} };
if(eventObj) fEventObj.eventObj = eventObj;
if(dataObj) fEventObj.dataObj = dataObj;
this[eventName].emit(fEventObj);
});
};
FusionChartsComponent.prototype.attachAllChartEvents = function (chartObj, eventList$$1) {
}

attachAllChartEvents(chartObj:any, eventList:Array<string>){
eventList.forEach(eventName => {
this.attachChartEventListener(chartObj, eventName);
});
}
*/
FusionChartsComponent.prototype.generateEventsCallback = function (eventList$$1) {
var _this_1 = this;
var events = {};
eventList$$1.forEach(function (eventName) {
_this_1.attachChartEventListener(chartObj, eventName);
events[eventName] = function (eventObj, dataObj) {
var fEventObj = { eventObj: {}, dataObj: {} };
if (eventObj)
fEventObj.eventObj = eventObj;
if (dataObj)
fEventObj.dataObj = dataObj;
_this_1[eventName].emit(fEventObj);
};
});
return events;
};
FusionChartsComponent.prototype.ngAfterViewInit = function () {
var _this = this, params = _this.constructerParams, configObj = _this.configObj || (_this.configObj = {});
Expand All @@ -496,13 +517,19 @@ var FusionChartsComponent = /** @class */ (function () {
}
}
if (configObj['type']) {
var events = _this.generateEventsCallback(_this.eventList);
if (!configObj['events']) {
configObj['events'] = events;
}
else {
configObj['events'] = Object.assign(events, configObj['events']);
}
_this.chartObj = FusionChartsConstructor(_this.fusionchartsService, configObj);
this.initialized.emit({ chart: _this.chartObj });
// configObj['renderAt'] = 'container-' + _this.chartObj.id;
// _this.containerId = _this.chartObj.id;
this.zone.runOutsideAngular(function () {
setTimeout(function () {
_this.attachAllChartEvents(_this.chartObj, _this.eventList);
_this.chartObj.render(_this.element.nativeElement.querySelector('div'));
}, 1);
});
Expand Down
2 changes: 1 addition & 1 deletion dist/dist/index.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions dist/src/fusioncharts.component.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ declare class FusionChartsComponent implements OnInit, OnChanges, DoCheck, After
updateWidth(): void;
updateHeight(): void;
updateType(): void;
attachChartEventListener(chartObj: any, eventName: string): void;
attachAllChartEvents(chartObj: any, eventList: Array<string>): void;
generateEventsCallback(eventList: Array<string>): {};
ngAfterViewInit(): void;
ngOnDestroy(): void;
}
Expand Down
48 changes: 35 additions & 13 deletions dist/src/fusioncharts.component.js

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

2 changes: 1 addition & 1 deletion dist/src/fusioncharts.component.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/src/fusioncharts.component.metadata.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/src/fusioncharts.service.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ export declare class FusionChartsStatic {
}
export declare class FusionChartsService {
static _fcRoot: any;
static itemCount: any;
_fusionchartsStatice: FusionChartsStatic;
static setFCRoot(fcRoot: any): void;
static getFCRoot(): any;
static isFCRootSet(): boolean;
constructor(FCStatic: FusionChartsStatic);
resolveFusionCharts(core: any, modules: any[]): void;
getFusionChartsStatic(): FusionChartsStatic;
getNextItemCount(): any;
}
5 changes: 5 additions & 0 deletions dist/src/fusioncharts.service.js

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

2 changes: 1 addition & 1 deletion dist/src/fusioncharts.service.js.map

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

Loading