bargraph text and labels scale down

Merged
#23 · Created  · Last updated

Merged pull request

Merged in sbaar/holographlibrarypoll (pull request #23)

9819d70·Author: ·Closed by: ·2014-02-28

Description

Made changes to allow the axis label, popup and value text in the popup to scale down when there's not enough room. This means the labels and popups won't overlap when there are a bunch in a small space, or a very long label.

I added a new constant to determine the space between labels on the x-axis and chose the best value based on my eye. Value of one leaves way too much space and 2 leaves almost no room. 1.6 felt just right.

There is cache in the form of a map to store the proper sizes of popup labels and it can get used a lot since, in my case, it was only using either two different lengths, 2 or 3, for percentages. It's purpose is to cut down on measuretext calls. measuretext is cheap, but in my case with 12 bars it decreased measuretexts calls from 427 to 77 for valuetext labels. That was enough to make scrolling smooth in my listview, but I should put in another one for the axis labels. It would be a tad trickier to do the right way and not just a good way, but I'll get around to it. In any case, there isn't a real tradeoff here, because the extra code beyond the checks is only called when the text would have been overlapping and unreadable anyway.

0 attachments

0 comments

Loading commits...