You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CurveLineChart(
modifier =Modifier
.fillMaxWidth()
.padding(vertical =10.dp),
lineData = lineData,
chartColors =listOf(
MaterialTheme.colors.secondary,
MaterialTheme.colors.secondary
),
lineColors =listOf(
MaterialTheme.colors.primary,
MaterialTheme.colors.primary
)
)
// Where lineData is// [LineData(xValue=Oct 27, 2022, yValue=0.0), LineData(xValue=Oct 28, 2022, yValue=0.0), ......]// the other values have yValue equals to 0
When I run the app, I have the following stacktrace
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ola.myapp, PID: 7867
java.lang.IllegalArgumentException
at android.graphics.LinearGradient.nativeCreate(Native Method)
at android.graphics.LinearGradient.createNativeInstance(LinearGradient.java:158)
at android.graphics.Shader.getNativeInstance(Shader.java:191)
at android.graphics.Paint.getNativeInstance(Paint.java:726)
at android.graphics.BaseRecordingCanvas.drawPath(BaseRecordingCanvas.java:292)
at androidx.compose.ui.graphics.AndroidCanvas.drawPath(AndroidCanvas.android.kt:242)
at androidx.compose.ui.graphics.drawscope.CanvasDrawScope.drawPath-GBMwjPU(CanvasDrawScope.kt:473)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawPath-GBMwjPU(Unknown Source:26)
at androidx.compose.ui.graphics.drawscope.DrawScope.drawPath-GBMwjPU$default(DrawScope.kt:800)
at com.himanshoe.charty.line.CurveLineChartKt$CurveLineChart$5.invoke(CurveLineChart.kt:187)
at com.himanshoe.charty.line.CurveLineChartKt$CurveLineChart$5.invoke(CurveLineChart.kt:112)
at androidx.compose.ui.draw.DrawBackgroundModifier.draw(DrawModifier.kt:104)
at androidx.compose.ui.node.DrawEntity.draw(DrawEntity.kt:98)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:46)
at androidx.compose.ui.draw.DrawBackgroundModifier.draw(DrawModifier.kt:105)
at androidx.compose.ui.node.DrawEntity.draw(DrawEntity.kt:98)
at androidx.compose.ui.node.LayoutNodeWrapper.drawContainedDrawModifiers(LayoutNodeWrapper.kt:316)
at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:306)
at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:139)
at androidx.compose.ui.node.LayoutNodeWrapper.drawContainedDrawModifiers(LayoutNodeWrapper.kt:314)
at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:306)
at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:139)
at androidx.compose.ui.node.LayoutNodeWrapper.drawContainedDrawModifiers(LayoutNodeWrapper.kt:314)
at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:306)
at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:139)
at androidx.compose.ui.node.LayoutNodeWrapper.drawContainedDrawModifiers(LayoutNodeWrapper.kt:314)
at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:306)
at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:139)
at androidx.compose.ui.node.LayoutNodeWrapper.drawContainedDrawModifiers(LayoutNodeWrapper.kt:314)
at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:306)
at androidx.compose.ui.node.ModifiedLayoutNode.performDraw(ModifiedLayoutNode.kt:139)
at androidx.compose.ui.node.LayoutNodeWrapper.drawContainedDrawModifiers(LayoutNodeWrapper.kt:314)
at androidx.compose.ui.node.LayoutNodeWrapper.draw(LayoutNodeWrapper.kt:306)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:839)
at androidx.compose.ui.node.InnerPlaceable.performDraw(InnerPlaceable.kt:90)
at androidx.compose.ui.node.LayoutNodeWrapper.drawContainedDrawModifiers(LayoutNodeWrapper.kt:314)
at androidx.compose.ui.node.LayoutNodeWrapper.access$drawContainedDrawModifiers(LayoutNodeWrapper.kt:60)
at androidx.compose.ui.node.LayoutNodeWrapper$invoke$1.invoke(LayoutNodeWrapper.kt:336)
at androidx.compose.ui.node.LayoutNodeWrapper$invoke$1.invoke(LayoutNodeWrapper.kt:335)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2101)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:110)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:78)
at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.kt:335)
at androidx.compose.ui.node.LayoutNodeWrapper.invoke(LayoutNodeWrapper.kt:60)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:180)
It looks like this error is related to the gradient but I get the same error even if I pass one color to the chart when using lineColor and chartColor
The text was updated successfully, but these errors were encountered:
I am using
CurveLineChart
to display some data.Here is the code that displays the chart
When I run the app, I have the following stacktrace
It looks like this error is related to the gradient but I get the same error even if I pass one color to the chart when using
lineColor
andchartColor
The text was updated successfully, but these errors were encountered: