Here's the code for my formula:
function chart_js(args, ctx) {
const type = args.type;
const labels = args.lables;
const chartTitle = args.chartTitle;
const data = args.data;
const borderWidth = args.borderWidth;
const chartId = args.chartId;
const config = {
labels: labels,
datasets: [{
label: chartTitle,
data: data,
borderWidth: borderWidth
}]
}
const string = `new Chart(document.getElementById(${chartId}), {
type: ${type},
data: ${config},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});`
console.log('arguments in formula: ', string)
return string
}
The formula is returning "null" but I would expect it to return a string value.
What am I doing wrong?