Receives error in Console when Measures are defined in GetData() of Google Chart
rajgodia opened this issue · comments
rajgodia commented
Can you please advice on below error.
code used
measures: [
{
uniqueName: "duration",
formula: '(sum("duration"))'
}
:5000/test-report/main.js:1207 ERROR TypeError: Cannot read property 'measures_' of undefined
at Function.a.fromObject (:5000/test-report/vendor.js:288652)
at b.getData (:5000/test-report/vendor.js:288039)
at e.getData (:5000/test-report/vendor.js:289649)
at Object.PivotApi.e.getData (:5000/test-report/vendor.js:289667)
at Object.WebDataRocksGooglecharts.getData
nikhil singh commented
can you tell me how to integrate google charts and Angular2+?
Ian Sadovy commented
Hello @rajgodia,
Thank you for writing.
Please ensure that the slice with measures is passed in the following format:
this.pivot.webDataRocks.googlecharts.getData(
{
type: "column",
slice: {
rows: [{ uniqueName: "Business Type" }],
columns: [{ uniqueName: "Measures" }],
measures: [
{
uniqueName: "Formula",
caption: "Formula",
formula: "sum('Price')"
}
]
}
},
(data) => this.drawChart(data),
(data) => this.drawChart(data)
);
We have checked on our sample and it seems working fine.
Regards,
Ian
Ian Sadovy commented
Hello @nikhilsingh0906 ,
Please find our repository with Google Charts integration sample: https://github.com/WebDataRocks/pivot-google-charts-angular
Hope it helps.
Ian