Array: line graph
in
Programming Questions
•
11 months ago
Hello guys,
I would like to make a line graph, like this:
Code:
- int []values = {200,150,330,100};
- int lineWidth= width/4;
- void setup(){
- size(400,max(values));
- background(0);
- }
- void draw(){
- for(int i=0; i<values.length; i++){
- for (int j= 0; j< values.length-1; j++) {
- // lineWidth??
- stroke(255);
- line(i,j,i+1,j+1);
- }
- }
- }
-The lines must have the same width
-How can i connect the array points...
Thanks,
Tarvajarvi.
1