SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. createHrzBarChart() {
  2.     ....
  3.     this.hrzBars = new Chart(ctx, {
  4.       type: 'horizontalBar',
  5.       data: {
  6.         labels: ['S1', 'S2', 'S3', 'S4', 'S5', 'S6', 'S7', 'S8'],
  7.         datasets: [{
  8.           label: 'Online viewers in millions',
  9.           data: [2.5, 3.8, 5, 6.9, 6.9, 7.5, 10, 17],
  10.           backgroundColor: '#ddee44', // array should have same number of elements as number of dataset
  11.           borderColor: '#ddee44',// array should have same number of elements as number of dataset
  12.           borderWidth: 1
  13.         },
  14.         {
  15.           label: 'Offline viewers in millions',
  16.           data: [1.5, 2.8, 4, 4.9, 3.9, 4.5, 7, 12],
  17.           backgroundColor: '#dd1144', // array should have same number of elements as number of dataset
  18.           borderColor: '#dd1144',// array should have same number of elements as number of dataset
  19.           borderWidth: 1
  20.         }]
  21.       },
  22.       ....
  23.     });
  24.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top