Home Forums Chart Support CanvasJS in Angular 6 Reply To: CanvasJS in Angular 6

#25040

@yansonalvin97,

based on the JSON that you have shared, passing name as label and age as y-value should work fine. Below is the code snippet.

function parseData(jsonData){
	for(var i = 0; i < jsonData.length; i++) {
		dataPoints.push({ label: jsonData[i].name, y: Number(jsonData[i].age)});
	}
}

Please take a look at this updated sample project for working code.


Vishwas R
Team CanvasJS