How to (Simple) Progress Bar Chart According to "Stage"

Hello!

I have multiple users who go through various stages before they reach completion. I’m attempting to put them into a more “birds-eye-view” table/chart so I can quickly identify what steps to take next with each person. Visually, I’m looking for something like this: Home & Cat Budgets (shared)

Simply put, my (selected) table columns would be something like this:

Name | Current Stage
Doe, John | Beginning
Doe, Jane | End
Deer, John | Middle

I’m not much of an artist, so hopefully I described it accurately enough for someone to help me out.

Thanks!

Hi @Benn_Bennett :blush: : Would this work for you ? :blush:

Ok, I know my sample above will probably seem complicated :sweat_smile: , but it’s not :wink: .

What I did was this :

I’ve created a table People & Stages, a table Stages and a table Colors .

I used the Stages table to define the Min % , Max % and the Max% - Min% for each of the stages you’ve mentioned (Beginning, Middle and End). This table is link to the table People & Stages using a lookup so you can select the current stage for each person in the table.
(The same thing was similarly done in the doc you shared in your post : with the Max, Spent and Remaining fields :wink: )

The Colors table is there so I can define the colors I’m using in the progress bar and because if you want to change the colors, it’s way easier that way :blush: .

Ok, now, for the ugly part :sweat_smile: : here’s what my progress bar formula actually looks likes :

SwitchIf(
	thisRow.Stages=Beginning,
		Concatenate(
			Rectangle(thisRow.Stages.Max*150,10,Colors.Filter(Usage="Current Stage").Hex),
			Rectangle(thisRow.Stages.Left*150,10,Colors.Filter(Usage="Left").Hex)
			),
	thisRow.Stages=Middle,
		Concatenate(
			Rectangle(thisRow.Stages.Min*150,10,Colors.Filter(Usage="Passed").Hex),
			Rectangle(thisRow.Stages.[Max-Min]*150,10,Colors.Filter(Usage="Current Stage").Hex),
			Rectangle(thisRow.Stages.Left*150,10,Colors.Filter(Usage="Left").Hex)
			),
	thisRow.Stages=End,
		Concatenate(
			Rectangle(thisRow.Stages.Min*150,10,Colors.Filter(Usage="Passed").Hex),
			Rectangle(thisRow.Stages.[Max-Min]*150,10,Colors.Filter(Usage="Current Stage").Hex)
	)
)

SwitchIf() is kind of working like If(), with the exception that you don’t need to precise the “otherwise” part of the formula, like you would do with an If() :blush: . And here, it would have become a long nested one …
(More info about SwitchIf())

And basically, it says this :

If Stages = Beginning then Concatenate() this Rectangle() and this other Rectangle().
If Stages = Middle then Concatenate() this Rectangle(),this Rectangle() and this other Rectangle() too.
If Stages = End then Concatenate() this Rectangle() and this other Rectangle().

Now, the Rectangle() formula looks like this : Rectangle(width, height, color, name)

As stated in this topic and specifically this part :point_down: :

It means, in other words that you can put multiple rectangles next to each other (in a Concatenate() formula) and indicate as the Width for each of those rectangles a percent of the total Width of the whole bar :blush: .

For example, if I only take the Concatenate() for when the Stage=Beginning (where you just need 2 rectangles. One for the current stage and one for the rest) :

Concatenate(
 Rectangle(thisRow.Stages.Max*150,10,Colors.Filter(Usage="Current Stage").Hex),
 Rectangle(thisRow.Stages.Left*150,10,Colors.Filter(Usage="Left").Hex)
)

The Width of the first rectangle = thisRow.Stages.Max*150

thisRow.Stages.Max is the value I’ve put as a maximum percent for the Beginning stage in the table Stages, which is here = 33% (as you only have 3 stages (100/3 = ± 33)) .
The 150 is the total Width of the “bar” (where the bar = the rectangle 1 + the rectangle 2).
So the actual Width of that specific rectangle = 33% of 150 ( thisRow.Stages.Max*150)
(Coda does the math here all by itself :blush: ).

For the Height I’ve used 10 :blush: .

And the Color is the one I’ve define in the Colors table for the Current stage :blush:

The second rectangle here follow the same principle but using the Left % :blush: .

And then, it all just begins again with the next Stage :blush: .
(Except that you need 3 rectangles for the Middle stage : One to represent the passed stage, one for the current and one for the stage to come :blush: )

I did prefer to use a separated table for the colors because once the formula is set-up, you can easily change the colors (otherwise, you’ll need to modify accordingly each Hex value manually in each rectangles)

And of course, you can pre-define the Total Width of the “bar” and the Height by using sliders on the canvas (or others) (like in the doc you shared) the same way I pre-define the colors.
You’ll just need to indicate in the diverse Rectangle() formulas where to get those values :blush: .

Note that :bulb: : If you modify the text in the Usage field (which is used for the colors of the rectangles), you’ll need to update it also in the filters in the Color part of the Rectangle() formula :blush: .

Sorry, I it’s quite long but it’s not easy to explain with words :innocent:.

It might not be exactly what you wanted but I hope this help a little :blush: .

Wow. That’s a lot to digest but . . . wow. Thank you! I’m going to read that a couple times (or 8) and implement it. That’s amazing!

As an aside, I was toying around with other apps that compete with Coda, but the flexibility that it gives and, more importantly, the community that exists here, is AWESOME!

2 Likes

@Benn_Bennett : You’re welcome :blush: !

Yeah, I know it’s a lot to read, sorry about that :sweat_smile: !

But creating a progress bar is not that complex, once you know the trick :blush: :

Concatenate(Rectangle(),Rectangle(),Rectangle()) = Progress Bar

Where the Width of each Rectangle() is a fraction (%) of the Width of the Progress Bar

I struggled to explain this in more concise way without omitting some info (which, who knows, could have been important) :innocent: .

But I hope your implementation will be a success :grin: !

1 Like