Show information for overlapping points (data viz)

edited May 2014 in How To...

Hi all, hoping someone could help me with a data viz problem. I'm using a Table class to show a txt/tsv document information. There is data for every day of the month but some days have two items so the point overlaps. I couldn't figure out how to just move the points a little so they didn't overlap, but I am close to figuring out how to just make the data display on separate lines on roll overs.

I want a description of the what the dot represents to show when you hover over the point, but since the position by row number, the larger the row number the further the data is from the point (instead of staying in the same place. Is there a way to detect there is multiple entries and then move the data?

Screen Shot 2014-05-09 at 6.13.12 PM

(^ details close)

Screen Shot 2014-05-09 at 6.13.46 PM

(^ details move far away)

Here's the code that is calling it, I can include more if it helps:

float x = map(day, -1, 32, 100, width-200);
     float y = map(month, 0, 13, 100, height-200);

      //////////////////DRAW DATA POINTS ///////////////////////
      fill(0, 0, 255, 80);
      ellipse(x-7, y, d, d);

      //////////////////OUTPUT DATA AMOUNTS ///////////////////////
      if (dist(x-7, y, mouseX, mouseY) < (d/2+1) )  ///find circle
        float r = map(row, 0, 190, 100, height-200);
        xday[row] = int (mouseX); // determining where the text is
        yday[row] = int (20+row*20);

        fill(255, 0, 0); //change color
        ellipse(x-7, y, d, d); //data point
        text (month + "/" + day + " " + amt, xday[row], yday[row]);  /// show details
Sign In or Register to comment.