Advertisement
dojiny

typescript with chartjs

Jun 15th, 2020
2,302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component, OnInit } from '@angular/core';
  2.  
  3. @Component({
  4.   selector: 'app-my-bar-chart',
  5.   templateUrl: './my-bar-chart.component.html',
  6.   styleUrls: ['./my-bar-chart.component.css']
  7. })
  8. export class MyBarChartComponent implements OnInit {
  9.  
  10.   public barChartOptions = {
  11.     scaleShowVerticalLines: false,
  12.     responsive: true
  13.   };
  14.  
  15.   public barChartLabels = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July'];
  16.   public barChartType = 'bar';
  17.   public barChartLegend = true;
  18.  
  19.   public barChartData = [
  20.     {data: [65, 59, 80, 81, 56, 55, 40], label: 'female'},
  21.     {data: [28, 48, 40, 19, 86, 27, 90], label: 'male'}
  22.   ];
  23.  
  24.   constructor() { }
  25.  
  26.   ngOnInit() {
  27.   }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement