Advertisement
Guest User

Untitled

a guest
Jun 7th, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let data_linear = {
  2.   labels: ["01.05", "02.05", "03.05", "04.05", "05.05", "06.05", "07.05", "08.05", "09.05", "10.05", "11.05", "12.05", "01.05", "02.05", "03.05", "04.05", "05.05", "06.05", "07.05", "08.05", "09.05", "10.05", "11.05", "12.05", "07.05", "08.05", "09.05", "10.05", "11.05", "12.05"],
  3.   datasets: [{
  4.     label: 'Количество нажатий',
  5.     data: [423, 595, 755, 415, 553, 552, 602, 653, 552, 701, 721, 793, 423, 595, 755, 415, 553, 552, 602, 653, 552, 701, 721, 793, 552, 602, 653, 552, 701, 721, 793],
  6.     // showLine: false,
  7.     // spanGaps: true,
  8.     backgroundColor: function(context) {
  9.       const chart = context.chart;
  10.       const {
  11.         ctx,
  12.         chartArea
  13.       } = chart;
  14.       if (!chartArea) {
  15.         // This case happens on initial chart load
  16.         return null;
  17.       }
  18.       return getGradient(ctx, chartArea);
  19.     },
  20.     tension: .4,
  21.     fill: true,
  22.     pointRadius: 0,
  23.     pointHitRadius: 20,
  24.   }]
  25. };
  26. let lineChart = new Chart(document.querySelector('#linearChart'), {
  27.   type: 'line',
  28.   data: data_linear,
  29.   options: {
  30.     plugins: {
  31.       legend: {
  32.         display: false,
  33.       }
  34.     }
  35.   }
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement