pointLabel where default is graph but can override with table input

So I have created a unit circle with points on it where students have to label the points through a table. I labeled the points on the graph 1-16 and the table has row numbers 1-16. In the graph, I labeled each point 1-16 but with pointLabel linked to the table, the numbers 1-16 don’t show up anymore. Is there a way to have the graph labels 1-16 show up but then be overridden by pointLabel? I hope that makes sense. I’m still a newbie to CL. Here’s my activity:


The CL will always override whatever’s set up in the graph, so you’ll need to use a when statement to achieve this. You’ve kind of introduced a when/otherwise anyway, so you’d just need something like:

pointLabel("A_3"): when isBlank(table.cellContent(1,4)) "1" otherwise table.cellContent(1,4)

for each of the points.

Quick tips - you can use “this” instead of “table” when you’re in the CL inside the table - and even better, you can define t=table and then just use t.cellContent to save a bit of typing :slight_smile:

1 Like

Thank you @pirsquared !!! This code also helped me with my other post where you also helped me. The summary table wasn’t storing the previous attempts because of the otherwise “” so I added in the history code and it worked!