We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I'm using p5js to do a little data Visualisation. I've Build a simple script to animate my data as a bar chart.
I would like to be able to have the year, (which is the header in the CVS file), displayed on the canvas as i iterate over the data.
I'm struggling to work out how i parse the header!
Am I going to have to load the table without headers and just start reading data from row 1 and fix row zero as my string for the display, or is there a way to 'table.getHeader(n)' or something similar?
thank you
Answers
in the java version there is:
https://processing.org/reference/TableRow_getColumnTitle_.html
i'm not sure it's there in the javascript but a look at the source sees it doing
where t is the table. so maybe that helps.
https://p5js.org/reference/#/p5.Table/columns
For clarity: each individual years data is in its own column, with the header being the year, as the animation moves through time I want to be able to use the header text, on the canvas, to display which year I am viewing.
or use
loadStrings
and look at slot 0 of the resulting String array