Generate chart based on properties

Hello,

I have some notes with the tag #A and I would like to display some figures in the field “Poids” based on the date in the Date propertie

My code :slight_smile:

```dataviewjs
const tagPages = dv.pages('#A');


const poids = tagPages.map(p => p.Poids).values;
const datesVisites = tagPages.map(p => p.Date).values;

const chartData = {
	type: line',
	data: {
		labels: datesVisites
		datasets: [{
			label: 'Mark',
			data: poids,
			backgroundColor: [
				'rgna(255,99,132,0.2)'
			],
			borderColor: [
				'(rgba(255,99,132,1)'
			],
			borderWidth: 1;
		}]
	}
};

window.renderChart(chartData, this.container);

the error :

Evaluation Error: SyntaxError: Invalid or unexpected token
    at DataviewInlineApi.eval (plugin:dataview:19027:21)
    at evalInContext (plugin:dataview:19028:7)
    at asyncEvalInContext (plugin:dataview:19038:32)
    at DataviewJSRenderer.render (plugin:dataview:19064:19)
    at DataviewJSRenderer.onload (plugin:dataview:18606:14)
    at DataviewJSRenderer.load (app://obsidian.md/app.js:1:1204966)
    at DataviewApi.executeJs (plugin:dataview:19607:18)
    at DataviewPlugin.dataviewjs (plugin:dataview:20537:18)
    at eval (plugin:dataview:20415:124)
    at t.initDOM (app://obsidian.md/app.js:1:20514

I have zero idea if this will help or not :sweat_smile: … but you have 2 typos (I think)…

There could be a missing single quote here: line' instead of 'line'

and here: 'rgna(...)' instead of 'rgba(...)' :blush:

I also don’t think the parenthesis around the rgba(...) for the borderColor are necessary :thinking: … but I could be perfectly wrong :sweat_smile: