I have questions about visualization data

this is a study that I have done using the data of two different months to visualize this data, I want to fill in between these two different data, but I have not been successful in this matter. I have something wrong with vertex or fill command.

float incr1, incr2, offset, h, a;

// Energy data
//Table dataHaziran;
//Table dataAralik;
Table[] tables = new Table[2];

int counterHaziran;
int counterAralik;

ArrayList<PVector> ptsHaziran = new ArrayList<PVector>();
ArrayList<PVector> ptsAralik = new ArrayList<PVector>();


void setup() {
  size(900, 400);
  background(#292929);
  //colorMode(HSB, 360, 100, 100, 100);
  colorMode(HSB, 255);

  //frameRate(20);

  // Energy data
  //dataHaziran = loadTable("ikitellihaziran.csv", "header");
  //dataAralik = loadTable("ikitelliaralik.csv", "header");
  
  tables[0] = loadTable("ikitellihaziran.csv", "header");
  tables[1] = loadTable("ikitelliaralik.csv", "header");

}

void draw() {

  // background opacıty
  //fill(0, 1);
  //noStroke();
  //rect(0, 0, width, height);

  //background(0);



  offset = - 0;
  //h = 0;
  //a = 255;

  strokeWeight(random(.3, 1));

  for (int i = 0; i < tables.length; i++) {
    stroke(h, 255, 255);
    noFill();

    beginShape();

    for (int x = 0; x <= width; x++) {
      // Energy data
      //// Haziran data
      //TableRow rowHaziran = dataHaziran.getRow(x);

      //// Haziran temperature data
      //float uretHaziran = rowHaziran.getFloat("Uretim");
      //float mappedUretHaziran = map(uretHaziran, 0, 100, 5, 50);
      //float mappedUretColorHaziran = map(uretHaziran, -5, 10, 44, 0);
      
            // Haziran data
      TableRow row = tables[i].getRow(x);

      // Haziran temperature data
      float uret = row.getFloat("Uretim");
      float mappedUret = map(uret, 0, 100, 5, 50);
      float mappedUretColor = map(uret, -5, 10, 44, 0);


      //vertex(x-200, (height+offset)*noise(incr1, x/incr2));
      vertex(x, offset+mappedUret);
    }

    endShape();

    offset += 200.;
    //h += 5;
    //a -= 7;
  }
}
1 Like

Hi,

Welcome to the forum. So you have two sets of data and you would like to fill area that is between the data points?

Can you describe or do you have an image what shows what your visualization would look like?

3 Likes

I think you should try going to the right with the ‘upper’ set of vertex points, and get an inverted list of the second data set to get the vertices going to the left, then they can be part of a single PShape beginShape()/endShape(CLOSE) object you can fill.

Hello @ranaulubas ,

Please format your post as a courtesy to this community:
https://discourse.processing.org/faq#format-your-code

:)