codeandtheory / YCharts

YCharts is a graph library for Android.
Apache License 2.0
604 stars 56 forks source link

java.lang.IllegalStateException Offset is unspecified #147

Closed BigCoach closed 1 year ago

BigCoach commented 1 year ago

Catched a crash with LineChart, please help me find a reason.

LineChartKt.drawStraightOrCubicLine java.lang.IllegalStateException - Offset is unspecified

Fatal Exception: java.lang.IllegalStateException: Offset is unspecified at androidx.compose.ui.geometry.Offset.getX-impl(Offset.kt:67) at co.yml.charts.ui.linechart.LineChartKt.drawStraightOrCubicLine(LineChart.kt:358) at co.yml.charts.ui.linechart.LineChartKt$LineChart$2$1$4.invoke(LineChart.kt:188) at co.yml.charts.ui.linechart.LineChartKt$LineChart$2$1$4.invoke(LineChart.kt:107) at co.yml.charts.chartcontainer.container.ScrollableCanvasContainerKt$ScrollableCanvasContainer$4$1$4$1.invoke(ScrollableCanvasContainer.kt:110) at co.yml.charts.chartcontainer.container.ScrollableCanvasContainerKt$ScrollableCanvasContainer$4$1$4$1.invoke(ScrollableCanvasContainer.kt:108) at androidx.compose.ui.draw.DrawBackgroundModifier.draw(DrawModifier.kt:116) at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105) at androidx.compose.ui.node.LayoutNodeDrawScope.performDraw(LayoutNodeDrawScope.kt:76) at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:55) at androidx.compose.foundation.BackgroundNode.draw(Background.kt:159) at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105) at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:86) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:365) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:66) at androidx.compose.material.ripple.AndroidRippleIndicationInstance.drawIndication(Ripple.android.kt:172) at androidx.compose.foundation.IndicationModifier.draw(Indication.kt:183) at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:349) at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105) at androidx.compose.ui.node.LayoutNodeDrawScope.performDraw(LayoutNodeDrawScope.kt:76) at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:55) at androidx.compose.foundation.BackgroundNode.draw(Background.kt:159) at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105) at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:86) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:365) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:929) at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:174) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt:54) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:384) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:383) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:496) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:383) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:54) at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209) at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:304) at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:246) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:349) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:66) at androidx.compose.material.ripple.AndroidRippleIndicationInstance.drawIndication(Ripple.android.kt:172) at androidx.compose.foundation.IndicationModifier.draw(Indication.kt:183) at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:349) at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105) at androidx.compose.ui.node.LayoutNodeDrawScope.performDraw(LayoutNodeDrawScope.kt:76) at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:55) at androidx.compose.foundation.BackgroundNode.draw(Background.kt:159) at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105) at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:86) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:365) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:929) at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:174) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt:54) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:384) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:383) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:496) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:383) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:54) at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209) at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:304) at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:246) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:349) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:66) at androidx.compose.foundation.BackgroundNode.draw(Background.kt:159) at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105) at androidx.compose.ui.node.LayoutNodeDrawScope.performDraw(LayoutNodeDrawScope.kt:76) at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:55) at androidx.compose.foundation.BackgroundNode.draw(Background.kt:159) at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105) at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:86) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:365) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:929) at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:174) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt:54) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:384) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:383) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:496) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:383) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:54) at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209) at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:304) at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:246) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:349) at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:929) at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:174) at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:66) at androidx.compose.foundation.DrawOverscrollModifier.draw(AndroidOverscroll.kt:81) at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:349) at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:105) at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:86) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:365) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt:54) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:384) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:383) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:496) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:383) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:54) at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209) at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:304) at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:246) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:349) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt:54) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:384) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:383) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:496) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:383) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:54) at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209) at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:304) at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:246) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:349) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:929) at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:174) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:354) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182) at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:362) at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt:54) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:384) at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:383) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2303) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:496) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:256) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:383) at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:54) at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209) at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:304) at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:1209) at android.view.View.draw(View.java:24409) at android.view.View.updateDisplayListIfDirty(View.java:23267) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704) at android.view.View.updateDisplayListIfDirty(View.java:23214) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704) at android.view.View.updateDisplayListIfDirty(View.java:23214) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704) at android.view.View.updateDisplayListIfDirty(View.java:23214) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704) at android.view.View.updateDisplayListIfDirty(View.java:23214) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:777) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:783) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:881) at android.view.ViewRootImpl.draw(ViewRootImpl.java:5647) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5330) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4486) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3116) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10885) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1301) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1309) at android.view.Choreographer.doCallbacks(Choreographer.java:923) at android.view.Choreographer.doFrame(Choreographer.java:852) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1283) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8762) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

   Here is my code

   `ConstraintLayout(
                        modifier = Modifier
                            .padding(top = 0.dp)
                            .height(300.dp)
                            .onGloballyPositioned {
                                chartWidth = with(density) {
                                    it.size.width.toDp()
                                }
                            }) {

                        val (chart, topPrice, bottomPrice, progress) = createRefs()

                        //initial height set at 0.dp
                        val priceString = stringResource(id = R.string.price)
                        // get local density from composable

                        val xAxisStepSize = (chartWidth.value / ((coin.pointsData.size) - 1)).dp

                        val xAxisData = AxisData.Builder()
                            .axisStepSize(xAxisStepSize)
                            .labelAndAxisLinePadding(0.dp)
                            .startPadding(0.dp)
                            .backgroundColor(Color.Transparent)
                            .shouldDrawAxisLineTillEnd(true)
                            .axisLineThickness(0.dp)
                            .axisLineColor(MaterialTheme.colorScheme.secondary)
                            .indicatorLineWidth(0.dp)
                            .steps(coin.pointsData.size - 1)
                            .build()

                        val steps = coin.pointsData.size - 1

                        val yAxisData = AxisData.Builder()
                            .steps(steps)
                            .axisPosition(Gravity.RIGHT)
                            .backgroundColor(Color.Transparent)
                            .shouldDrawAxisLineTillEnd(true)
                            .axisLineThickness(0.dp)
                            .axisLineColor(Color.Transparent)
                            .indicatorLineWidth(0.dp)
                            .labelAndAxisLinePadding(0.dp)
                            .axisOffset(0.dp)
                            .axisLabelColor(MaterialTheme.colorScheme.secondary)
                            .axisLabelAngle(45f)
                            .shouldDrawAxisLineTillEnd(false)
                            .build()

                        val lineChartData = LineChartData(
                            containerPaddingEnd = 0.dp,
                            paddingRight = 0.dp,
                            bottomPadding = 8.dp,
                            paddingTop = 28.dp,
                            backgroundColor = MaterialTheme.colorScheme.surface,
                            linePlotData = LinePlotData(
                                lines = if (coin.pointsData.isEmpty()) listOf() else listOf(
                                    Line(
                                        dataPoints = coin.pointsData.map {
                                            Point(it.x, it.y)
                                        },
                                        LineStyle(
                                            lineType = LineType.SmoothCurve(),
                                            color = MaterialTheme.colorScheme.primary,
                                            width = 6f,
                                            alpha = 1f,
                                        ),
                                        IntersectionPoint(
                                            color = MaterialTheme.colorScheme.secondary,
                                            radius = 2.dp,
                                            alpha = 0.1f
                                        ),
                                        SelectionHighlightPoint(
                                            color = MaterialTheme.colorScheme.tertiary,
                                            alpha = 0.7f

                                        ),
                                        ShadowUnderLine(
                                            color = MaterialTheme.colorScheme.secondary,
                                            alpha = 0.1f,
                                        ),
                                        SelectionHighlightPopUp(
                                            backgroundColor = MaterialTheme.colorScheme.secondaryContainer,
                                            backgroundCornerRadius = CornerRadius(8f),
                                            paddingBetweenPopUpAndPoint = 16.dp,
                                            labelSize = TextUnit(15f, TextUnitType.Sp),
                                            labelColor = MaterialTheme.colorScheme.onSecondaryContainer,
                                            popUpLabel = { x, y ->
                                                val selectedIndex =
                                                    coin.pointsData.indexOfFirst {
                                                        it.y == y
                                                    }
                                                Timber.d("selectedIndex: $selectedIndex, coin.formattedPointsDataPriceList: ${coin.formattedPointsDataPriceList}")
                                                val formattedPrice =
                                                    if (selectedIndex == -1) "$selectedCurrencySymbol$y"
                                                    else try {
                                                        "$selectedCurrencySymbol${coin.formattedPointsDataPriceList[selectedIndex]}"
                                                    } catch (e: Exception) {
                                                        "$selectedCurrencySymbol$y"
                                                    }
                                                "$priceString: $formattedPrice"
                                            }
                                        ),
                                    )
                                ),
                            ),
                            gridLines = GridLines(
                                color = MaterialTheme.colorScheme.secondary.copy(alpha = 0.05f),
                            ),
                            xAxisData = xAxisData,
                            yAxisData = yAxisData,
                            isZoomAllowed = false,
                        )

                        LineChart(
                            modifier = Modifier
                                .fillMaxHeight()
                                .fillMaxWidth()
                                .background(
                                    Color.Transparent,
                                    shape = MaterialTheme.shapes.medium
                                )
                                .constrainAs(chart) {
                                    top.linkTo(parent.top)
                                    start.linkTo(parent.start)
                                    end.linkTo(parent.end)
                                    bottom.linkTo(parent.bottom)
                                },
                            lineChartData = lineChartData
                        )

                        Text(
                            text = coin.formattedPriceMin,
                            color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5f),
                            style = MaterialTheme.typography.bodySmall,
                            maxLines = 1,
                            modifier = Modifier
                                .padding(start = 16.dp, bottom = 8.dp)
                                .constrainAs(bottomPrice) {
                                    start.linkTo(parent.start)
                                    bottom.linkTo(parent.bottom)
                                }
                        )

                        // max price
                        Text(
                            text = coin.formattedPriceMax,
                            color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5f),
                            style = MaterialTheme.typography.bodySmall,
                            maxLines = 1,
                            modifier = Modifier
                                .padding(start = 16.dp, top = 8.dp)
                                .constrainAs(topPrice) {
                                    start.linkTo(parent.start)
                                    top.linkTo(parent.top)
                                }
                        )

                        Box(modifier = Modifier
                            .padding(8.dp)
                            .size(24.dp)
                            .constrainAs(
                                progress
                            ) {
                                end.linkTo(parent.end)
                                top.linkTo(parent.top)
                            }) {
                            if (isRefreshing) {
                                InfinitePieChartProgressIndicator(
                                    size = 24.dp,
                                    strokeWidth = 4.dp
                                )
                            }
                        }
                    }`