I created the following HTML code and added it to the page’s HTML component.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.bundle.min.js"></script>
</head>
<body onLoad="ready()">
<canvas id="myChart" width="570" height="340"></canvas>
<script>
var ctx = document.getElementById("myChart");
var DonutChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['Red', 'Yellow', 'Blue']
datasets: [{
data: [],
backgroundColor: ['rgb(255, 99, 132)', 'rgb(255, 199, 132)', 'rgb(55, 99, 132)']
}]
},
options: {
cutoutPercentage: 50,
};
});
</script>
</body>
</html>
What I liked to do and I can’t do was link the graphic to the page to make it work. So far only the blank HTML component appears to me.
I know I have to use the postMessage () and onMessage () functions I just wanted to know what information I have to pass, given the chart type.
Could someone give me an idea of the code I should use.
Thanks you in advance
Tomás Martins