I am trying to make a very simple line plot for one variable in different observations (rows) over time, where the columns contain the same variabe at different times. (Say number of enrollments in different courses on our platform once per week, or any other number cumulated over time.) Something like this:
I can’t figure out how to tell the line plot menu to use each row as a separate observation (i.e. line), and use each column as a point on the horizontal axis and the range of all the values as the vertical axis.
I know the Coda line plot menu was not made for this kind of thing, but in a classical spreadsheet this is somehow super easy to do. What am I missing here?
Thanks in advance!
No one? That’s disappointing…
Am I overlooking something here and the answer is super obvious and trivial? Because I am quite sure, I can’t be the only one with this question.
In (1) should select line chart
Of course if you have more values for the same date you can aggregate them at (2)
When you hoover over the line, the values for each point are displayed, according my knowledge it’s not possible to display the actual values as in your sample
Overall it should be workable to my opinion
Hey @Jean_Pierre_Traets Thank you so much for your help!
But actually, I am trying to do the exactly transposed thing: Where the different dates I measured are the columns, and the different lines I want to show are rows (i.e. observations of different “things” at those dates).
However, the possibility to have several columns as “Values”, i.e lines, already helps quite a bit. I will try rebuild what you suggest for the transposed case.
Nope, doesn’t work unfortunately.
“Horizontal axis” only lets me select a column of the table. I can’t manage to tell it to take something else as horizontal axis. So, I’m guessing I will have to transpose my table to make this work?
The reason I want to do this the other way around is because my “objects” come from a lookup in a different table. See below:
I’m afraid yes.
It’s somehow part of the relational data modelling that relies on tables instead of grids.
There are infinite pages in literature about that, but - as a very basic rule of thumb - you should design your data so that “every data you enter, should be a row” maintaining the column consistency without changing the structure.
I think this is a major switch of mindset if coming from Excel.
Feel free to ask if this is not clear.
Dear @Federico_Stefanato Thank you very much for the reply! That makes a lot of sense.
While I totally get the mindset about not adding columns to a fixed model (agreed!), it is a little unfortunate that I thereby lose the wonderful “Lookup” capacity that Coda gives me in the first column of what I have in mind.
If I think about it, it would, in terms of a database model probably make sense to have a very simple table with only three columns: Date - Entry ID - Value. But I am unsure how that would translate in a lineplot in Coda either.
Follow-up question: Is there an automatic way to transpose a table in Coda? i.e. getting the row entries from the column labels? I’d probably have to go copy-pasting through Excel/Sheets, right?
Have a look at this example:
Btw, Entry ID might not even be necessary, if the discriminant is the day.
Yes: I’d warmly suggest so.
You could do it, with a button, but not having metadata for columns, would force you to write manually the column entries… which is not very productive.
Let me know if you need further help.
Thanks again. I‘ll do that then.
Unfortunately, the above example does not really cover my scenario as I want to lineplot several different „things“ (lines) on the same days. Therefore, I do need the „Entry ID“ if the „entry“ is the thing, i.e. the row in my above example.
Anyway, I‘ll go try the manual transposing now and add a column for each „thing“ / entry.
You are right.
Changed the chart accordingly
Dear @Federico_Stefanato and I really enjoy your mastery with the button - “Populate Random Line Chart”
Oh, @Federico_Stefanato this is great! Thank you for all the help!
Yes, this is great stuff!