RadarChartA radar chart is a graphical method of displaying multivariate data in the form of a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point.

Radar - 图1

View on GitHub

  • radarchartdemo.ts
  • radarchartdemo.html

radarchartdemo.ts

  1. export class RadarChartDemo {
  2. data: any;
  3. constructor() {
  4. this.data = {
  5. labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
  6. datasets: [
  7. {
  8. label: 'My First dataset',
  9. backgroundColor: 'rgba(179,181,198,0.2)',
  10. borderColor: 'rgba(179,181,198,1)',
  11. pointBackgroundColor: 'rgba(179,181,198,1)',
  12. pointBorderColor: '#fff',
  13. pointHoverBackgroundColor: '#fff',
  14. pointHoverBorderColor: 'rgba(179,181,198,1)',
  15. data: [65, 59, 90, 81, 56, 55, 40]
  16. },
  17. {
  18. label: 'My Second dataset',
  19. backgroundColor: 'rgba(255,99,132,0.2)',
  20. borderColor: 'rgba(255,99,132,1)',
  21. pointBackgroundColor: 'rgba(255,99,132,1)',
  22. pointBorderColor: '#fff',
  23. pointHoverBackgroundColor: '#fff',
  24. pointHoverBorderColor: 'rgba(255,99,132,1)',
  25. data: [28, 48, 40, 19, 96, 27, 100]
  26. }
  27. ]
  28. };
  29. }
  30. }
  31.  

radarchartdemo.html

  1. <p-chart type="radar" [data]="data"></p-chart>
  2.