Below is my code
getReportData()
{
let infoJSON;
infoJSON= this.http.get('ourApiUrl').subscribe(data => {
console.log(data)
});
return infoJSON
}
binding the above method to Pivot as below
public pivotReport = {
dataSource: {
dataSourceType: "json",
date:this.getReportData()
}
..
...
.....
};
HTML:
<fm-pivot #pivot
[toolbar]="true"
[width]="'100%'"
[height]="500"
[report]="pivotReport"
[customizeCell]="onCustomizeCell"
(ready)="onPivotReady($event)"
(beforetoolbarcreated)="customizeToolbar($event)">
</fm-pivot>
Hello, Naidu,
Thank you for reaching out to us.
Our team would like to kindly note that the data
property of the dataSource
object should be used in order to use inline JSON as a data source. In your code snippet, the date
property is used instead.
Please change the corresponding line of code as shown below and try establishing connection one more time:
public pivotReport = {
dataSource: {
dataSourceType: “json”,
data: this.getReportData()
},
...
};
Detailed information about the dataSource
object and its properties can be found in our documentation.
Please let us know if it works for you.
Do not hesitate to contact us if additional assistance is needed.
Best regards,
Illia
Thank you for the information,
We use data property only. showing the popup with jsonData is invalid
This is the json data i am getting in the console
Hello,
Thank you for writing to us.
It seems we have answered your question in the following forum thread: https://www.flexmonster.com/question/data-not-binding-to-pivottable-in-angular/.
Regards,
Illia