Hi all,
Apologies in advance for the long post and thanks so much for all the help.
I am trying to make a stacked bar chart, and I think I need to do it using quickchart.io as I havent been able to get the detail level I need using the built in charts (or progress bars) in Adalo.
I create a bar chart in quickchart.io, it looks like this:
and the associated code is this:
{
type: 'bar',
data: {
labels: ['7 Days ago', '6 Days ago', '5 Days ago', '4 Days ago', '3 Days ago', 'Yesterday', 'Today'],
datasets: [
{
label: 'Green',
backgroundColor: 'rgb(0,128,0)',
stack: 'Stack 1',
data: [29, 29, 29, 29, 29, 29, 29],
fill: true,
},
{
label: 'Yellow',
backgroundColor: 'rgb(255, 233, 0)',
stack: 'Stack 1',
data: [39, 39, 39, 39, 39, 39, 39],
fill: true,
},
{
label: 'Orange',
backgroundColor: 'rgb(255,140,0)',
stack: 'Stack 1',
data: [43, 43, 43, 43, 43, 43, 43],
fill: true,
},
{
label: 'Red',
backgroundColor: 'rgb(255,0,0)',
stack: 'Stack 1',
data: [53, 53, 53, 53, 53, 53, 53],
fill: true,
},
],
},
options: {
title: {
display: true,
text: 'Weekly Team Stress Continuum Levels',
},
tooltips: {
mode: 'index',
intersect: false,
},
responsive: true,
scales: {
xAxes: [
{
stacked: true,
},
],
yAxes: [
{
stacked: true,
ticks: {
beginAtZero: true,
callback: function(value) {
return value + '%';
},
},
scaleLabel: {
display: true,
labelString: 'Percentage',
},
},
],
},
},
}
When I bring the link into the image URL in Adalo, it works with the dummy data.
It also works when I put in magic text with no filter: (here replaced the first data point, 29)
When I put in the magic text with a formula, though, the preview only shows a blank screen.
Edit to add:
I just did a quick verification that the custom formula does, in fact work, and it does:
Edit again to add:
After a lot of troubleshooting, it seems that for some reason the date condition causes an error. If I have the date condition in, and there is a record that exists on that date, it crashes.
If I have the date condition in, but there is no record on that date, the chart displays.
In either case, the same formula in a text box works.
Any thoughts?
I really appreciate the help.