Angular Google Charts - 散点图
以下是散点图的示例。
我们已经在Google Charts 配置语法章节中看到了用于绘制图表的配置。现在,让我们看一个散点图的示例。
配置
我们使用ScatterChart类来显示散点图。
type = 'ScatterChart';
例子
应用程序组件.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Age vs Weight';
type='ScatterChart';
data = [
[8,12],
[4, 5.5],
[11,14],
[4,5],
[3,3.5],
[6.5,7]
];
columnNames = ['Age', 'Weight'];
options = {
};
width = 550;
height = 400;
}
结果
验证结果。
