Height of bars in BarChart correct

Issue #10 resolved
Stefan Barth created an issue

I used the BarGraph and was wondering why the height of the bars were so small. I think its a failure in class BarGraph on line 111, where the maximum height will be calculated.

Instead of:

for (Bar p : points) {
       maxValue += p.getValue();
}

shouldnt it be:

for (Bar p : points) {
       if(p.getValue() > maxValue) {
               maxValue = p.getValue();
       }
}

I fixed this in my library project and after that the height of the bars uses the full height of the bar graph

Comments (4)

  1. Daniel Nadeau repo owner

    You are correct, this must have snuck by in a pull request in the past. I have fixed it. Thanks!

  2. Stefan Barth reporter

    I have seen another problem with this, maybe it can help you :) When the highest bar was touched it gets an selected border, but the top isn't visible because of the maxValue/usableHeight. I reduced the maxValue by 5% or what else can help is to reduce the pixel for usableHeight :)

  3. Log in to comment