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

Compose: ChartView blinks with white color #139

Open
sudansh opened this issue Nov 7, 2023 · 0 comments
Open

Compose: ChartView blinks with white color #139

sudansh opened this issue Nov 7, 2023 · 0 comments

Comments

@sudansh
Copy link

sudansh commented Nov 7, 2023

I am using Android Compose and setting background but there white background comes up momentarily before setting up the background color.
I have gone through previous issues on white color like 38 which was closed but still persists

code:

AndroidView(
                modifier = Modifier,
                factory = {
                    ChartsView(it).apply {
                        with(api) {
                            applyOptions {
                                layout = layoutOptions {
                                    background = SolidColor(Color.Green)
                                }
                            }
                        }
                    }
                },
                update = { chartsView ->
                    with(chartsView.api) {
                        applyOptions {
                            layout = layoutOptions {
                                background = SolidColor(surfaceColor)
                            }
                        }
                        addHistogramSeries(
                            options = histogramSeriesOptions {
                                color = barColor
                                visible = false
                                priceScaleId = PriceScaleId("")
                            },
                            onSeriesCreated = { seriesApi ->
                                seriesApi.priceScale().applyOptions(PriceScaleOptions().apply {
                                    scaleMargins = PriceScaleMargins(
                                        top = 0.7f,
                                        bottom = 0f,
                                    )
                                })
                                seriesApi.setData(barData.distinctBy { it.time })
                            }
                        )
                    }
                }
            )
white.mov
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