Display Dynamic Data in Angular6 with GoogleChart

前端 未结 1 1115
误落风尘
误落风尘 2021-01-27 06:38

I use Angular Cli6, angularfire2 and firebase. I want to create a timeline with GoogleChart.

//GoogleChart.service

declare var google: any;

export clas         


        
相关标签:
1条回答
  • 2021-01-27 06:59

    It seems you have gotten the right solution. There is just one problem when getting your data to data1.

    For the retrieved data to match the pattern on your data written in hard, you have to loop through it from the perspective of the retrieved data:

    this.ppssToDisplay.subscribe(ppsList => {
      this.data1 = [
        interestingFields,
        ...ppsList.map(pps => interestingFields.map(field => pps[field]))
        ];
    });
    

    And there you go. That should solve your problem.

    0 讨论(0)
提交回复
热议问题