Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```dataviewjs
- const rawData = await dv.query('TABLE WITHOUT ID file.name, G.distanz, G.dauer FROM "10 - Daily Notes" WHERE sport AND contains(sport.type, "Gehen") FLATTEN sport.gehen AS G');
- const rows = rawData.value.values;
- const chartData = {
- data: {
- labels: rows.map(x => x[0]),
- datasets: [{
- type: 'bar',
- label: 'km',
- data: rows.map(x => x[1]),
- barThickness: 7,
- pointStyle: 'cross',
- backgroundColor: ['#80bfff'],
- borderWidth: 1,
- borderColor: ['#80bfff'],
- fill: false,
- xAxisID: 'x2'
- },
- {
- type: 'bar',
- label: 'Minuten',
- data: rows.map(x => x[2]),
- barThickness: 7,
- backgroundColor: ['#707a8c'],
- borderWidth: 1,
- borderColor: ['#707a8c'],
- fill: false,
- xAxisID: 'x1',
- },
- ],
- },
- options: {
- responsive: true,
- animations: false,
- indexAxis: 'y',
- plugins: {
- legend: {
- display: true,
- position: 'bottom',
- },
- },
- scales: {
- x1: {
- type: 'linear',
- display: true,
- position: 'top',
- },
- x2: {
- type: 'linear',
- display: true,
- position: 'bottom',
- },
- },
- },
- }
- this.container.style.width = "80%";
- this.container.style.margin = "auto";
- window.renderChart(chartData, this.container);
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement