Im attempting to make a parallel coordinates plot. I have so far created the vertical axis for the graph and I have a class that each individual line is object of. I have all my line objects in an ArrayList container and iterate over the container and call the draw function for each object. My problem is that only the last object in the list is showing up on the canvas. I’ve debugged using println to see that the array does contain more than 1 object. I believe my problem lies within the array itself and how im trying to use it, since it the class objects functions are to simply just draw their points on the screen.
I have called noloop() in the setup as well.
I fill the array like this
the mapper utility is just a helper function that maps the value from the data from that min and max range to the height range of he canvas.
for(int i=0; i < myTable.getRowCount(); i++){
TableRow row = myTable.getRow(i);
for(int j=0; j < myTable.getColumnCount(); j++){
float temp = mapperUtility(row.getFloat(j),minArray[j],maxArray[j]);
tmp[j] = temp;
}
lineList.add(new Coordinate_Line(x,tmp));
//print the first value in the y array
println(lineList.get(i).y[0]);
}
then iterate over it like so
for(Coordinate_Line line : lineList){
line.draw();
}
Finally the class draw function iterates over the x&y coordinates and draws an ellipse like this:
void draw(){
for(int i=0; i < x.length; ++i){
fill(255,0,0);
text(y[i],x[i],y[i] - 20);
ellipse(x[i],y[i],radius,radius);
}
}
EDIT i have created a wrapper class that is essentially an ArrayList class that processes my objects, this has fixed my problem as all the lines no are drawn, but im not entirely sure why this has fixed my problem.