Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GridLabelRenderer humanRound causes data to be hidden #681

Open
VeloSteve opened this issue Jan 18, 2022 · 0 comments
Open

GridLabelRenderer humanRound causes data to be hidden #681

VeloSteve opened this issue Jan 18, 2022 · 0 comments

Comments

@VeloSteve
Copy link

In GridLabelRenderer.adjustHorizontal the call to humanRound is hardwired to false for the second argument. This means that the increments between labels will always round down. That leads to data being truncated from the graph.

An easy way to see this is a one-line modification of the all-XML example given here. Replace the last line of

    <com.jjoe64.graphview.helper.GraphViewXML
        android:layout_width="match_parent"
        android:layout_height="100dip"
        app:seriesData="0=5;2=5;3=0;4=2" />

with

        app:seriesData="100=5;150=5;200=0;250=2" />

and you will see that the data, which runs from 100 to 250, is truncated at 180, hiding two of the four points.
GraphTruncated

There are several ways to address this I suppose, including

  • Just hardwire the value to true. This may waste a little screen space, but should not hide data.
  • Make the value user-configurable.
  • Adjust both the step size and number of labels for a possibly better compromise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant