I am working with google charts for the first time and I have no idea about the errors of this library. Please guide me where I am wrong.
let initFlag = (this.leaderBoardData == null) ? true : false;
let chartData = leaderBoardData;
if (!this.resize) {
for (var data of chartData) {
let strLen = 14;
let uname = data.username;
let title = (uname.length > strLen) ? uname.substring(0, strLen) + '...' : uname;
let value = data.socialPoint;
let color = data.colorCode;
let tooltipValue = data.userName + '\n Count: ' + value;
this.usageData.push([title, value, color, value, tooltipValue]);
}
}
let gcData = new google.visualization.DataTable();
if (initFlag) {
gcData.addColumn('string', 'Dealer Name');
gcData.addColumn('number', 'Count');
gcData.addColumn({ type: 'string', role: "style" });
gcData.addColumn({ type: 'number', role: "annotation" });
gcData.addColumn({ type: 'string', role: 'tooltip' });
}
gcData.addRows(this.usageData);
Response from console
Any solution appreciated!