Firstly thanks to all.
I have done as follows:
I declared a class Names FusionChart in a separate ts file as follows:
declare class FusionCharts {
constructor(ChartType: string, ChartName: string, height: string, width: string);
constructor(ChartType: string, ChartName: string, height: string, width: string, other: string);
public setXMLData(ChartValues: string): any;
public render(renderId: string): any;
public static setCurrentRenderer(renderName: string): any;
}
after that I used the constructor of this class in my ViewModel backend .ts file as follows:
- I added the reference of the FusionChart class.
- Created he fusion chart object.
- In compositionComplete I set the CurrentRenedrer to JavaScript(optional) and used the render method.
My code is as follows:
export class FinancialView
{
public column3DChart: FusionCharts;
constructor() {
this.column3DChart = new FusionCharts("Column3D", "myChartId", "300", "200");
this.column3DChart.setXMLData("XML data");
}
compositionComplete() {
FusionCharts.setCurrentRenderer('javascript');
this.column3DChart.render("chartdivId");
}
}