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

Line drawn out of bounds on dataset update #46

Open
sanskar10100 opened this issue Sep 23, 2022 · 9 comments
Open

Line drawn out of bounds on dataset update #46

sanskar10100 opened this issue Sep 23, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@sanskar10100
Copy link

sanskar10100 commented Sep 23, 2022

Using a LineChart, when the dataset is updated with a large value, the recomposition results in a line being drawn out of bounds.

LineChart(
            lineData = pagesReadData,
            color = MaterialTheme.colors.primaryVariant,
            modifier = modifier
                .height(250.dp)
                .fillMaxWidth()
                .padding(32.dp),
            axisConfig = AxisConfig(
                showAxis = true,
                isAxisDashed = false,
                showUnitLabels = true,
                showXLabels = true,
                xAxisColor = MaterialTheme.colors.onSurface,
                yAxisColor = MaterialTheme.colors.onSurface,
            )
        )

Resultant:
Screenshot_20220923_195016

ScreenCap:
Out of bounds.webm

Please let me know if any other data is needed.

@hi-manshu
Copy link
Owner

Hey buddy, thank you for this. Can you pass your dataset for me to replicate!

thanks

@hi-manshu hi-manshu added the bug Something isn't working label Sep 23, 2022
@hi-manshu hi-manshu self-assigned this Sep 23, 2022
@sanskar10100
Copy link
Author

Initial Data:

LineData(xValue=23 Sep , yValue=10.0)
LineData(xValue=24 Sep , yValue=10.0)

Updated Data:

LineData(xValue=23 Sep , yValue=10.0)
LineData(xValue=24 Sep , yValue=10.0)
LineData(xValue=26 Sep , yValue=20.0)

Result:
image

@hi-manshu
Copy link
Owner

Thank you, will check soon!

@sanskar10100
Copy link
Author

Hey @hi-manshu sorry to bug you, but any update on this?

@hi-manshu
Copy link
Owner

Hey I will try to fix this by this weekend

@khaleeljageer
Copy link

Hi,
I'm facing similar problem with CurveLineChart.
When I load the follwing LineData, recomposition draw the CurveLine chart out of bounds.

Screenshot from 2022-10-29 17-41-21

LineData that I used.

listOf(
  LineData(xValue = "23 Sep", yValue = 0.793f),
  LineData(xValue = "24 Sep", yValue = 0.766f),
  LineData(xValue = "25 Sep", yValue = 0.746f),
  LineData(xValue = "26 Sep", yValue = 0.786f),
  LineData(xValue = "27 Sep", yValue = 0.735f),
  LineData(xValue = "28 Sep", yValue = 0.712f),
  LineData(xValue = "29 Sep", yValue = 0.744f),
  LineData(xValue = "30 Sep", yValue = 0.774f)
)

@AlexZhukovich
Copy link

Fixed this issue in PR #55

@khaleeljageer
Copy link

Hi @AlexZhukovich ,

Tested the fix with your branch. Found that the issue still exist with the following LineData.

listOf(
  LineData(xValue = "23 Sep", yValue = 0.793f),
  LineData(xValue = "24 Sep", yValue = 0.766f),
  LineData(xValue = "25 Sep", yValue = 0.746f),
  LineData(xValue = "26 Sep", yValue = 0.786f),
  LineData(xValue = "27 Sep", yValue = 0.735f),
  LineData(xValue = "28 Sep", yValue = 0.712f),
  LineData(xValue = "29 Sep", yValue = 0.744f),
  LineData(xValue = "30 Sep", yValue = 0.774f)
)

@AlexZhukovich
Copy link

@khaleeljageer I think here we have different issues. The initial issue is related to adding additional data and updating the chart component. In your case, the data is displaying incorrectly.

Repository owner deleted a comment from deenMuhammad Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants