WebDataRocks / pivot-angular

Example of integrating the WebDataRocks web reporting tool with the Angular framework

Home Page:https://www.webdatarocks.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Receives error in Console when Measures are defined in GetData() of Google Chart

rajgodia opened this issue · comments

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

can you tell me how to integrate google charts and Angular2+?

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

Hello @nikhilsingh0906 ,

Please find our repository with Google Charts integration sample: https://github.com/WebDataRocks/pivot-google-charts-angular

Hope it helps.

Ian