Advertisement
dhniceday

Untitled

Nov 13th, 2022
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.65 KB | Software | 0 0
  1. ```dataviewjs
  2. const rawData = await dv.query('TABLE length(rows.file.name) FROM "" FLATTEN dateformat(file.ctime, "yyyy-MM-dd") AS D GROUP BY D SORT D');
  3. const rows = rawData.value.values;
  4. const chartData = {
  5.     type: 'line',
  6.     data: {
  7.         labels: rows.map(x => x[0]),
  8.         datasets: [{
  9.             label: 'Notes per day',
  10.             data: rows.map(x => x[1]),
  11.             radius: 1,
  12.             pointStyle: 'cross',
  13.             backgroundColor: ['#bf6ee0'],
  14.             borderWidth: 1,
  15.             borderColor: ['#bf6ee0'],
  16.             fill: false,
  17.             stepped: true,
  18.             }],
  19.     },
  20. }
  21.  
  22. window.renderChart(chartData, this.container);
  23. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement