Angular Google Charts - Donut Chart



Following is an example of a Donut Chart.

We have already seen the configurations used to draw a chart in Google Charts Configuration Syntax chapter. Now, let us see an example of a Donut Chart.

Configurations

We've used pieHole configuration to show a Pie Chart as Donut Chart.

options = { pieHole:0.4 };

Example

app.component.ts

import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Browser market shares at a specific website, 2014'; type = 'PieChart'; data = [ ['Firefox', 45.0], ['IE', 26.8], ['Chrome', 12.8], ['Safari', 8.5], ['Opera', 6.2], ['Others', 0.7] ]; columnNames = ['Browser', 'Percentage']; options = { pieHole:0.4 }; width = 550; height = 400; }

Result

Verify the result.

Donut Chart
angular_googlecharts_pie_charts.htm
Advertisements