How to Preview SciChartSurface in Compose?

63 Views Asked by At

I’d like to preview SciChartSurface in Compose using @Preview annotation.

I am getting error

java.lang.NoClassDefFoundError: Could not initialize class com.scichart.drawing.canvas.RenderSurface$d

@Composable
fun MyAndroidViewPreview() {
    val context = LocalContext.current
    AndroidView(
        factory = { context ->
            // Create Android View with SciChartSurface
            SciChartSurface(context)
        },
        update = { view ->
            // Update Android View here
        }
    )
}

@Preview
@Composable
fun MyAndroidViewPreviewWrapper() {
    MyAndroidViewPreview()
}
0

There are 0 best solutions below