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

Offset in axis #50

Open
arijit4 opened this issue Oct 16, 2022 · 2 comments
Open

Offset in axis #50

arijit4 opened this issue Oct 16, 2022 · 2 comments
Labels
question Further information is requested

Comments

@arijit4
Copy link

arijit4 commented Oct 16, 2022

The point with max yValue is always at the top edge of the graph. Which clips the circle. It would really help a lot if you could add the functionality to set offsets (as paddings in other views) to the graph.

Thanks!

@hi-manshu
Copy link
Owner

Hey @arijit4 ,
What you mean by clips the circle, mind attaching some screenshot withmore detail? thanks

@hi-manshu hi-manshu added the question Further information is requested label Oct 17, 2022
@arijit4 arijit4 changed the title Offset in axix Offset in axis Oct 17, 2022
@arijit4
Copy link
Author

arijit4 commented Oct 18, 2022

Sorry @hi-manshu for not being clear enough.

The circles/blobs on points (don't know what to call it🥲) get clipped by the upper edge.
I'm using padding as a workaround.

LineChart(
    modifier = Modifier
        .fillMaxSize()
        .padding(16.dp),
    lineData = entries,
    color = MaterialTheme.colorScheme.secondary,
    chartDimens = ChartDimens(20.dp)
)

It solves the above-mentioned issue. But the x axis values (15, 16, 17... in the screenshot) still get clipped. Again the dimmed lines parallel to x-axis are not centered according to the y-axis values. This is why the points with yValue = 10 looks less than 10 in the graph.

Couldn't find any doc for ChartDimens. But adding it helped :)

msg1693893067-15752

Hope the issue's a bit clearer now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants