Pre loader

How to Preview SciChartSurface in Compose?

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi, 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()
}
Version
4.4.1.4804
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies