Hello,
I have been trying to display a chart in the dashboard, I used the template node in Function palette to create the chart, and points to template node in dashboard palette.
I am following this link, https://medium.com/javascript-in-plain-english/exploring-chart-js-e3ba70b07aa4
Code, In Function Template node-
<canvas id="myChart222" width=600 height =300></canvas>
<script>
var textcolor = getComputedStyle(document.documentElement).getPropertyValue('--nr-dashboard-widgetTextColor');
var gridcolor = getComputedStyle(document.documentElement).getPropertyValue('--nr-dashboard-groupBorderColor');
var linecolors = ['#009900','#889900']
var ctx = document.getElementById('myChart222').getContext('2d');
var chart = new Chart(ctx, {
type: 'line',
data: {
labels:["part1", "part2"],
datasets: [{
label: 'This week',
data: [10, 20],
}]
};
});
</script>
But, it shows no graph in the dashboard, I do not know what is not correct,
Is this the var ctx is not correct?
Help me solve this issue, thanks