Closed techformationankush closed 4 years ago
[import as FusionCharts from "fusioncharts"; import as charts from "fusioncharts/fusioncharts.charts"; import as FusionTheme from "fusioncharts/themes/fusioncharts.theme.fusion"; import { FusionChartsModule } from "angular-fusioncharts"; import as TimeChart from "fusioncharts/fusioncharts.timeseries"; import as Msstackedcolumn2dlinedy from "fusioncharts/msstackedcolumn2dsplinedy"; import as Gammel from "fusioncharts/themes/fusioncharts.theme.gammel";
FusionChartsModule.fcRoot(FusionCharts, Msstackedcolumn2dlinedy, FusionTheme);
@NgModule({ declarations: [ ParcelsCombinationChartsComponent ], imports: [ FusionChartsModule ] })
data: any; width = 100; height = 400; type = "msstackedcolumn2dlinedy"; dataFormat = "json"; dataSource: any;
constructor() {}
ngOnInit() {
this.data = {
chart: {
caption:
"Market Share of Korean Automobile Manufacturers in US",
subcaption: "2011 - 2016",
pyaxisname: "Units Sold",
syaxisname: "% of total market share",
snumbersuffix: "%",
syaxismaxvalue: "25",
theme: "fusion",
showvalues: "0",
drawcrossline: "1",
divlinealpha: "20"
},
categories: [
{
category: [
{
label: "2011"
},
{
label: "2012"
},
{
label: "2013"
},
{
label: "2014"
},
{
label: "2015"
},
{
label: "2016"
}
]
}
],
dataset: [
{
dataset: [
{
seriesname: "Honda City",
data: [
{
value: "997281"
},
{
value: "1063599"
},
{
value: "1063964"
},
{
value: "1152123"
},
{
value: "1289128"
},
{
value: "1394972"
}
]
},
{
seriesname: "Honda Civic",
data: [
{
value: "196354"
},
{
value: "259493"
},
{
value: "234755"
},
{
value: "205717"
},
{
value: "205081"
},
{
value: "224978"
}
]
}
]
},
{
dataset: [
{
seriesname: "Hyundai Verna",
data: [
{
value: "373709"
},
{
value: "391276"
},
{
value: "380002"
},
{
value: "411456"
},
{
value: "476001"
},
{
value: "500537"
}
]
},
{
seriesname: "Hyundai Sonata",
data: [
{
value: "47548"
},
{
value: "73130"
},
{
value: "107659"
},
{
value: "179783"
},
{
value: "202390"
},
{
value: "156107"
}
]
}
]
}
],
lineset: [
{
seriesname: "Market Share %",
plottooltext:
"Total market share of Korean cars in $label is <b>$dataValue</b> in US",
showvalues: "0",
data: [
{
value: "17.74"
},
{
value: "19.23"
},
{
value: "15.43"
},
{
value: "12.34"
},
{
value: "15.34"
},
{
value: "21.17"
}
]
}
]
};
this.dataSource = this.data;
}
<fusioncharts *ngIf="dataSource !== undefined" [width]="width" [height]="height" [type]="type" [dataFormat]="dataFormat" [dataSource]="dataSource"> ](url)
The correct import statement for Msstackedcolumn2dlinedy should be *import as Msstackedcolumn2dlinedy from "fusioncharts/fusioncharts.msstackedcolumn2dsplinedy";**
Here is a working demo - codesandbox.io/s/ww2y9w1m0l
More could be referred from here - https://stackoverflow.com/questions/59999776/typeerror-cannot-read-property-addsymbol-of-undefined