calculate increment
in
Programming Questions
•
1 year ago
i calculate the y increment with this:
Copy code
- yInc = plotHeight/gv.AL_persons.size();
which works fine as you can see in the image.
The maximum diameter get's calculated with:
Copy code
- float maxDiameter = (yInc/1.5f)+(2*gv.maxEmailsMonth);
Which also works fine (red).
If you look good then you see the horizontal lines also behind the red, i want to skip there the space of maxDiameter. But for that the y increment must decrease and since that happens the maxDiameter should also since they relay on each other.
I'm guessing that calculating a close value for those 2 must be done in a loop, since each iteration will bring the best possible value closer. Only the tries i made are not correct, it's leaving me a too big white space at the bottom (like 3x maxDiameter).
Copy code
- yInc = plotHeight/gv.AL_persons.size();
- float maxDiameter = (yInc/1.5f)+(2*gv.maxEmailsMonth);
- for(int i = 0; i < 999; i++) {
- yInc = (plotHeight-maxDiameter)/gv.AL_persons.size()-1;
- maxDiameter = (yInc/1.5f)+(2*gv.maxEmailsMonth);
- }
1