SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Answered
0
0

I’m not sure what is going on, but I am consistently getting an error about my trial license key not being valid (it has 28 days left)

Error msg: “Sorry! You have not set a License Key. You can request a free trial key from http://www.scichart.com...”

Code (trial key partially snipped):

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    // Set this code once in MainActivity or application startup
    SciChartSurface.setRuntimeLicenseKey("w2q0iyS8UeR2HKF...uqUbxqjprSIvXJPibCSl1g6ag==")

    // Get the scichartsurface
    val surface = findViewById<com.scichart.charting.visuals.SciChartSurface>(R.id.id_scichartsurface)
    // Initialize the SciChartBuilder
    SciChartBuilder.init(this)
    // Obtain the SciChartBuilder instance
    val sciChartBuilder = SciChartBuilder.instance()
    // Create a numeric X axis
    val xAxis: IAxis = sciChartBuilder.newNumericAxis()
        .withAxisTitle("X Axis Title")
        .withVisibleRange(-5.0, 15.0)
        .build()
    // Create a numeric Y axis
    val yAxis: IAxis = sciChartBuilder.newNumericAxis()
        .withAxisTitle("Y Axis Title").withVisibleRange(0.0, 100.0).build()
    // Create a TextAnnotation and specify the inscription and position for it
    val textAnnotation = sciChartBuilder.newTextAnnotation()
        .withX1(5.0)
        .withY1(55.0)
        .withText("Hello World!")
        .withHorizontalAnchorPoint(HorizontalAnchorPoint.Center)
        .withVerticalAnchorPoint(VerticalAnchorPoint.Center)
        .withFontStyle(20f, ColorUtil.White)
        .build()
    // Create interactivity modifiers
    val chartModifiers = sciChartBuilder.newModifierGroup()
        .withPinchZoomModifier().withReceiveHandledEvents(true).build()
        .withZoomPanModifier().withReceiveHandledEvents(true).build()
        .build()
    // Add the Y axis to the YAxes collection of the surface
    Collections.addAll(surface.yAxes, yAxis)
    // Add the X axis to the XAxes collection of the surface
    Collections.addAll(surface.xAxes, xAxis)
    // Add the annotation to the Annotations collection of the surface
    Collections.addAll(surface.annotations, textAnnotation)
    // Add the interactions to the ChartModifiers collection of the surface
    Collections.addAll(surface.chartModifiers, chartModifiers)
}

Any assistance appreciated. Thank you.

Version
3.0.0.4253
Images
  • You must to post comments
Best Answer
0
0

Hi there,

You need to set license before any SciChart related stuff is used. That’s why in this article we create custom Application class. In your case I belive SciChartSurface is defined in XML layout which is inflated durin setContentView() call. This means that chart is created before license is set. Please try to move setRuntimeLicenseKey() before that call:

// Set this code once in MainActivity or application startup
SciChartSurface.setRuntimeLicenseKey("w2q0iyS8UeR2HKF...uqUbxqjprSIvXJPibCSl1g6ag==") 

setContentView(R.layout.activity_main)

Hope this will help you!

Best regards,
Yura

  • You must to post comments
0
0

Thank you.

  • You must to post comments
0
0

If it’s not working maybe a good idea will be find some other key on the net. Anyway, I can help you with it I like it more than education in my university ( just use https://essayontime.com.au/thesis-writing to get good marks) so I think that I know some sites that have trial keys.

  • You must to post comments
0
0

Thank you so much for sharing that information.
I faced the same problem and your tip helped me solve it!
I also want to say that it is important to before use essay writing service, you need to check before using whether professional writers are available and what kind of support service. This is important if you want to achieve excellent results. I am using two paper writing service EssayService.com and WritePaper.com. Now I don’t spend a lot of time to write my paper.

  • You must to post comments
0
0

Yes, I understand what you mean. I have been using the college paper writing service PaperWritingService for a long time. Thanks to the collaboration with experienced writers, my writing skill has grown a lot.

  • You must to post comments
0
0

I also want to advise a unique blog that reveals interesting writing techniques for example how to write a cause and effect essay DoMyEssay This is a unique resource. After spending only 5 minutes reading the article, you can become an expert using interesting techniques for writing.

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.