We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Okay, I feel really bad for even asking this but I'm overwhelmed and I don't know where else to even ask.
I'm trying to make a bar graph and I watched so many tutorials, read so many documents but I can't seem to figure out how to make my bar graph come out the way I want it to. I have my data saved in excel but it needs to be a .txt file and it's ready but I get past the String[] and I'm lost.
This is honestly all I have and its pretty pathetic. I'm still new at this.
String[] dclass = ("dclass.txt");
void setup() size(500,500);
And then I'm stuck. All I want are three bars based on my arena and when you pass over one of them, the color of bar changes to correspond with the class it belongs to. I can usually figure it out when the data is put in int[] above the void setup() but this requires importing and then the lines of code I read get me confused and overwhelmed.
Here's the txt file the way it was seen in excel but converted.
Class 1 Class 2 Class 3
Arena 1 5 8 11 Arena 2 19 17 30 Arena 3 11 11 11
Please, can someone help me get started? I'm kind of in a rush but at this point, I just want to understand how to get started and then understand what each point means afterwards.
Answers
I wonder whether you had taken a look at Processing's reference page already?
https://processing.org/reference/
Particularly: https://processing.org/reference/loadStrings_.html + https://processing.org/reference/split_.html
Also, if you got a ".csv" or a ".tsv" file, you can directly load them as a Table:
https://processing.org/reference/loadTable_.html
https://processing.org/reference/Table.html
I actually have and the reference page helps but I believe my issue is I don't understand what each line of code means. I had this issue with calculus functions and have been struggling the same here.
I found the barGraph() function but I don't see how a .txt file could work. Additionally, I have tried a table, even by loading a different file just to test it out with no luck.
pls show your code and then ask a specific question
your text file is confusing...
shouldn't it have like same number of items each line...?
here
or this where you can replace some lines to load a file