Graphing Issue: Make no data equal zero

Hi everyone. I’m trying to create a simple graph (using the Bubble Chart Element plugin), but I’m pretty new to graphing and am hoping someone can help.

I’m a teacher, my graph tracks student marks per week. So if a student got 2 in week 1 then I’d like the week 1 column to have a height of 2. Easy enough so far, I’ve got that working.

The challenge I’m facing is I’d like for weeks where no data is found to be displayed as a zero on the graph. I don’t add marks of zero (it would be cumbersome to have to go through give zeros for every student who hasn’t earned a mark). But this means the graph just skips that week currently.

So if a student got the following marks:

Week 1: 3

Week 2: 2

Week 3: Absent (no mark)

Week 4: 4

I’d like a graph showing bars of height 3,2,0,4.
Graphing
Is there any way to achieve this?

My data structure is simple enough. I have a data type Student Marks with 3 fields: Student, Mark (the numerical value), and Week.

Additionally (but less important) I’d like the graph to always show 10 weeks (1 term), so for weeks yet to happen I’d like them to display as zero as well, until marks are earned.

Thanks

Barry

@BarryBlock

Is the graph receiving what it needs to display zero for week 3? … If not then it will not display it because it does no have to.

Hi @cmarchan, thanks so much for the reply.

No there is no data for week 3 (or any week where I want to give a zero), that’s the challenge I’m facing here. Those grades don’t exist. I’m hoping to somehow get it to display a zero when it doesn’t find a grade for a week. Is there any trick that can be done to achieve this? Any way of saying ‘display weeks 1 to 10, and if no data is found display zero’?

Thanks
Barry

Can you do this with timeseries data?

I do this with my chart plugin but it’s a line chart.

I always have null values since I don’t do daily data collection but want to display data in a timeline format.

Having the same issue. I am collecting transaction data through an API but days when there is no transaction I want to display 0 in the graph. See the screenshot for how the graph is displayed and with my drawn line representing how it should really look to give an accurate reading.

I’ve been looking around but not finding a solution to make this happen.

@cj11 welcome to the community!

Build logic to detect empty entries and assign a zero to the them. :wink:

Thanks @cmarchan ! Total noob here, any idea of some documentation to use to build such logic? Not even sure there are empty entries, just that the API only feeds me the transactions and nothing in between. So the logic would have to identify which days don’t have an entry, create one and assign a 0 to it. But I am not sure where in Bubble I could look to make this happen.

Thanks @cmarchan, I looked through it but I didn’t get which part applies to what I am trying to do (again, might be that I am not making the right connections).

As I think through it there’s two things that need to be achieved:

  1. Automatically create a registry for a period going back in time (say a month, 6 months or a year) when a user signs up. Each entry should by default show a 0.

  2. Every day add a new entry with a 0. (It seems this could be done with a recurring event, although it seems to be a premium function that is not covered by the personal plan).