无法将图表数据从组件绑定到视图。 Angular6、前缀-ui

Can't bind chart-data from component to view. Angular 6, predix-ui

请帮忙。求救

我正在尝试将图表数据绑定到图表,例如:

[attr.chart-data]='chartData'

我的组件:

export class AppComponent {
arr: Array<Object> = [];
seriesConfig: {};

ngOnInit(): void {
    this.arr = [
        { x: 1530426560000, y: 179.46 },
        { x: 1530426570000, y: 179.58 },
        { x: 1530426580000, y: 179.58 },
        { x: 1530426590000, y: 179.6 },
        { x: 1530426600000, y: 179.52 },
        { x: 1530426610000, y: 179.56 },
        { x: 1530426620000, y: 179.52 },
        { x: 1530426630000, y: 179.52 }
    ];

    this.seriesConfig = {
        y: { type: "line", name: "series1", x: "x", y: "y" }
    };
} }

我的看法:

<div>
<h2 id="title-tag">Timeseries</h2>
<px-vis-timeseries id="ts1" prevent-resize width="950" height="500" register-location="side" enable-tooltip="true" tooltip
 include-all-series selection-type="x" [attr.chart-data]='arr' [attr.series-config]='seriesConfig' x-axis-config='{"title": "Date"}'
 y-axis-config='{"title": "y1"}'>
</px-vis-timeseries>

问题:

  1. 请问如何正确绑定数据?
  2. 系列配置需要什么?如何正确化妆?

提前致谢!

我认为您需要使用驼峰式键而不是破折号来传递图表数据。 (这就是 Polymer 的工作方式。)像这样:

<px-vis-timeseries [chartData]='arr'></px-vis-timeseries>

更多信息和链接在这里: https://www.predix-ui.com/#/develop/frameworks-angular