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

1 vote
30 views

Hi,

3d Surface Chart
I have read the announcement for 3d charts on iOS and Android. That’s exactly me requirement.
Is a release date already planned or is a beta version available?
What are the limitations for a 3d chart on Android (number of points, memory consumption, time to create the view).
We need a 3d surface chart with x=400 points and y= ~1000point (400’000 points).

  • Is this possible?
  • Can this chart be rotated fluid?

2d Chart
I have a requirement for a 2d chart on Android.
The user must be able to move some points in a line chart. Like “design” a set curve.

  • Is this possible?
  • Exist’s some codes samples?

Best regards
Urs

  • Urs Geser asked 5 days ago
  • last active 4 days ago
0 votes
21 views

Hello everybody.
Library is really great, but rarely crashes and stack trace is not telling something useful to me.
May be somebody meet that exception and know the reasons?
Thanks.

03-14 12:29:27.390 15937-15937/com.test.livedataperformance E/InputEventReceiver: Exception dispatching input event.
03-14 12:29:27.390 15937-15937/com.test.livedataperformance D/AndroidRuntime: Shutting down VM
03-14 12:29:27.390 15937-15937/com.test.livedataperformance E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.test.livedataperformance, PID: 15937
java.lang.NullPointerException: Attempt to invoke interface method ‘java.lang.Comparable com.scichart.data.model.IRange.getMin()’ on a null object reference
at com.scichart.data.model.RangeBase.clipTo(SourceFile:235)
at com.scichart.charting.visuals.axes.a.clipRange(SourceFile:96)
at com.scichart.charting.visuals.axes.AxisBase.scroll(SourceFile:1019)
at com.scichart.charting.visuals.axes.AxisBase.scroll(SourceFile:992)
at com.scichart.charting.modifiers.ZoomPanModifier.a(SourceFile:196)
at com.scichart.charting.modifiers.ZoomPanModifier.onScroll(SourceFile:176)
at android.view.GestureDetector.onTouchEvent(GestureDetector.java:607)
at com.scichart.charting.modifiers.GestureModifierBase.onTouch(SourceFile:80)
at com.scichart.charting.modifiers.ModifierGroup.onTouch(SourceFile:189)
at com.scichart.core.utility.touch.MotionEventManager.c(SourceFile:140)
at com.scichart.core.utility.touch.MotionEventManager.a(SourceFile:39)
at com.scichart.core.utility.touch.MotionEventManager$a$1.a(SourceFile:224)
at com.scichart.core.utility.touch.MotionEventManager$a$1.execute(SourceFile:221)
at com.scichart.core.utility.touch.MotionEventManager$a.a(SourceFile:211)
at com.scichart.core.utility.touch.MotionEventManager$a.onTouchEvent(SourceFile:183)
at com.scichart.charting.visuals.SciChartSurface.onTouchEvent(SourceFile:1251)
at android.view.View.dispatchTouchEvent(View.java:9300)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2547)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2240)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
at android.app.Activity.dispatchTouchEvent(Activity.java:2812)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
at android.view.View.dispatchPointerEvent(View.java:9520)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4242)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4095)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3641)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3694)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3660)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3786)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3668)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3843)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3641)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3694)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3660)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3668)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3641)
at android.view.ViewRootImpl.deliverInputEvent(ViewRo – ***Here stack trace ends in console, so i can’t find where its called

0 votes
85 views

I have created a SciChartSurface with the width of 200 px. I have created a data series with data that corresponds to four vertical lines at 0 %, 25 %, 50 % and 75 % of width. When I set the data series’ width to 115 points all four vertical lines are clearly visible. However when I set the width to 116 points or more, the first line (at x == 0) disappears. Data series is still smaller than the renderable series width in px, so there is no reason for any of the vertical lines to go missing. Is this a bug, or did I configure something wrong?

Here is the xml layout:

<com.scichart.charting.visuals.SciChartSurface
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/chart"
    android:layout_width="200px"
    android:layout_height="match_parent"/>

Here is the code for MainActivity:

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.scichart.charting.model.dataSeries.UniformHeatmapDataSeries
import com.scichart.charting.visuals.SciChartSurface
import com.scichart.charting.visuals.renderableSeries.ColorMap
import com.scichart.drawing.utility.ColorUtil
import com.scichart.extensions.builders.SciChartBuilder
import kotlin.math.roundToInt

const val WIDTH = 116
const val HEIGHT = 50

class MainActivity : AppCompatActivity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)

        SciChartSurface.setRuntimeLicenseKey(getString(R.string.sciChart_license))
        SciChartBuilder.init(this)

        setContentView(R.layout.activity_main)

        val chartSurface = findViewById<SciChartSurface>(R.id.chart)
        val chartBuilder = SciChartBuilder.instance()

        val xAxis = chartBuilder.newNumericAxis().build()
        val yAxis = chartBuilder.newNumericAxis().build()

        val dataSeries = UniformHeatmapDataSeries<Int, Int, Int>(Int::class.javaObjectType, Int::class.javaObjectType, Int::class.javaObjectType, WIDTH, HEIGHT)
        for (x in 0 until WIDTH)
        {
            for (y in 0 until HEIGHT)
            {
                val value = when (x)
                {
                    0,
                    (0.25 * WIDTH).roundToInt(),
                    (0.5 * WIDTH).roundToInt(),
                    (0.75 * WIDTH).roundToInt() -> 50
                    else                        -> 0
                }
                dataSeries.updateZAt(x, y, value)
            }
        }

        val series = chartBuilder.newUniformHeatmap()
            .withColorMap(ColorMap(intArrayOf(ColorUtil.DarkBlue, ColorUtil.CornflowerBlue, ColorUtil.DarkGreen, ColorUtil.Chartreuse, ColorUtil.Yellow, ColorUtil.Red), floatArrayOf(0f, 0.2f, 0.4f, 0.6f, 0.8f, 1f)))
            .withDataSeries(dataSeries)
            .build()

        chartSurface.suspendUpdates().use {
            chartSurface.xAxes.add(xAxis)
            chartSurface.yAxes.add(yAxis)
            chartSurface.renderableSeries.add(series)
        }
    }
}
0 votes
54 views

Hello, for my bottom graph on my screenshot below, is it possible to dynamically change the black background to red? Indeed, when the microphone saturates like on the screenshot below I want to change the black background to red for 2 seconds, so I need to do it programmatically.

https://i.ibb.co/7XCLDwf/sature.png

I init my bottom graph like this :

 @Override
    public void initGraph(Context context) {
        Log.d(TAG, "initGraphs");
        SciChartSurface audioStreamSciChart = new SciChartSurface(context);
        mAudiostream.addView(audioStreamSciChart);
        xAxis = new NumericAxis(context);
        xAxis.setVisibleRange(new DoubleRange(startAudioStreamRange, endAudioStreamRange));
        xAxis.setDrawLabels(false);
        xAxis.setDrawMinorTicks(false);
        xAxis.setDrawMajorBands(false);
        xAxis.setDrawMinorGridLines(false);
        audioStreamSciChart.getXAxes().add(xAxis);

        NumericAxis yAxis = new NumericAxis(context);
        yAxis.setVisibleRange(new DoubleRange(-1.0, 1.0));
        yAxis.setDrawLabels(true);
        yAxis.setDrawMinorTicks(false);
        yAxis.setDrawMajorBands(false);
        yAxis.setDrawMinorGridLines(false);
        yAxis.setAxisAlignment(AxisAlignment.Left);

        audioStreamSciChart.getYAxes().add(yAxis);

        float lineThickness = SciChartExtensionsKt.dip(context, 1.0F);

        FastLineRenderableSeries f = new FastLineRenderableSeries();
        f.setDataSeries(scichartTools.getAudioDS());
        f.setStrokeStyle(new SolidPenStyle(ColorUtil.Grey, true, lineThickness, null));
        audioStreamSciChart.getRenderableSeries().add(f);
        scichartLayout = mAudiostream.getChildAt(0);
    }

I can keep a reference of my FastLineRenderableSeries to do it but i didn’t find any method to change his backgroud color.
Can i ?

Thanks,
Wavely

0 votes
54 views

I have created a heatmap chart with values for the data series with four vertical lines of width 1. When the width of data series is smaller than width of SciChartSurface in pixels the four lines are clearly visible. However when I increase the width of data series to be bigger than the width in pixels, then some lines disappear, even though I’ve set the re-sampling mode to ResamplingMode.Max.

I wasn’t able to attach images to the post (got a Forbidden error), so I’ve uploaded them to Imagur:
Missing Lines
Visible lines

Here is the code from which the screen shots were made:

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.scichart.charting.model.dataSeries.UniformHeatmapDataSeries
import com.scichart.charting.visuals.SciChartSurface
import com.scichart.charting.visuals.renderableSeries.ColorMap
import com.scichart.data.numerics.ResamplingMode
import com.scichart.drawing.utility.ColorUtil
import com.scichart.extensions.builders.SciChartBuilder
import kotlin.math.roundToInt

const val WIDTH = 2000
const val HEIGHT = 50

class MainActivity : AppCompatActivity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)

        SciChartSurface.setRuntimeLicenseKey(getString(R.string.sciChart_license))
        SciChartBuilder.init(this)

        setContentView(R.layout.activity_main)

        val chartSurface = findViewById<SciChartSurface>(R.id.chart)
        val chartBuilder = SciChartBuilder.instance()

        val xAxis = chartBuilder.newNumericAxis().build()
        val yAxis = chartBuilder.newNumericAxis().build()

        val dataSeries = UniformHeatmapDataSeries<Int, Int, Int>(Int::class.javaObjectType, Int::class.javaObjectType, Int::class.javaObjectType, WIDTH, HEIGHT)
        for (x in 0 until WIDTH)
        {
            for (y in 0 until HEIGHT)
            {
                val value = when (x)
                {
                    0,
                    (0.25 * WIDTH).roundToInt(),
                    (0.5 * WIDTH).roundToInt(),
                    (0.75 * WIDTH).roundToInt() -> 50
                    else                        -> 0
                }
                dataSeries.updateZAt(x, y, value)
            }
        }

        val series = chartBuilder.newUniformHeatmap()
            .withDataSeries(dataSeries)
            .withColorMap(ColorMap(intArrayOf(ColorUtil.DarkBlue, ColorUtil.CornflowerBlue, ColorUtil.DarkGreen, ColorUtil.Chartreuse, ColorUtil.Yellow, ColorUtil.Red), floatArrayOf(0f, 0.2f, 0.4f, 0.6f, 0.8f, 1f)))
            .withResamplingMode(ResamplingMode.Max)
            .build()

        chartSurface.suspendUpdates().use {
            chartSurface.xAxes.add(xAxis)
            chartSurface.yAxes.add(yAxis)
            chartSurface.renderableSeries.add(series)
        }
    }
}
1 vote
58 views

I am using a PinchZoomModifier with my chart and I would like to execute some code when the user stops the zooming action (stops touching the screen). Is it possible to do? Are there any listeners I could attach to the PinchZoomModifier? I couldn’t find any in the docs.

1 vote
53 views

Hi all,

Bit of a weird question here again – sorry.

I’m not sure if this is possible, but I’m looking to have an android device take pictures every x minutes, and I’d like to display them in a chart with a shared axis with a few other charts. A user will ideally be able to see each of these snapshots associated with the time that they’re taken, and on press expand them into a carousel view with the selected image as the current.

The on press and carousel bit will be straight android code, but I was wondering about displaying images on charts – is it possible? I poked around a little bit, and for WPF, I saw

https://www.scichart.com/questions/question/rendering-2d-camera-images

I was wondering if the android libraries can do similar, and if so, do you have any examples/code snippets?

The other potential approach I found was using the Sprite point marker API, although I’m not sure the scope of images it can render?

Would either of these approaches be feasible, and do you have any examples/tips? Attached is the current status of my charts, and I’m hoping to put images in the red boxes on the second chart (I just put a column chart as a placeholder there for the moment).

Also, I just wanted to say thanks for all the fantastic support your team has provided.

Thanks,
-Andy

0 votes
86 views

We published an update with SciChart included and just got 2 crash reports with “UnsatisfiedLinkError”. It happened on Doogee Shoot_ 1 (Shoot_1), Android 6.0. What is happening here and how do I fix it? The crash ocurs when we try to set runtime license key:

java.lang.UnsatisfiedLinkError: 
  at java.lang.Runtime.loadLibrary (Runtime.java:367)
  at java.lang.System.loadLibrary (System.java:1076)
  at com.scichart.core.utility.NativeLibraryHelper.tryLoadLibrary (SourceFile:39)
  at com.scichart.core.licensing.LibsodiumNativeWrapper.<clinit> (SourceFile:29)
  at com.scichart.core.licensing.Decoder.<init> (SourceFile:159)
  at com.scichart.core.licensing.Credentials.setRuntimeLicenseKey (SourceFile:55)
  at com.scichart.charting.visuals.SciChartSurface.setRuntimeLicenseKey (SourceFile:247)
  at com.my.app.MainApplication.activateSciChart (MainApplication.java:158)
  at com.my.app.MainApplication.onCreate (MainApplication.java:76)
  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1018)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4969)
  at android.app.ActivityThread.-wrap1 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1559)
  at android.os.Handler.dispatchMessage (Handler.java:111)
  at android.os.Looper.loop (Looper.java:207)
  at android.app.ActivityThread.main (ActivityThread.java:5750)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)

Second report (Huawei P20, Android 9):

java.lang.UnsatisfiedLinkError: 
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1012)
  at java.lang.System.loadLibrary (System.java:1672)
  at com.scichart.core.utility.NativeLibraryHelper.tryLoadLibrary (SourceFile:39)
  at com.scichart.core.licensing.LibsodiumNativeWrapper.<clinit> (SourceFile:29)
  at com.scichart.core.licensing.LibsodiumNativeWrapper.a (SourceFile:41)
  at com.scichart.core.licensing.Decoder.<init> (SourceFile:159)
  at com.scichart.core.licensing.Credentials.setRuntimeLicenseKey (SourceFile:55)
  at com.scichart.charting.visuals.SciChartSurface.setRuntimeLicenseKey (SourceFile:247)
  at com.my.app.MainApplication.activateSciChart (MainApplication.java:158)
  at com.my.app.MainApplication.onCreate (MainApplication.java:76)
  • Primoz asked 2 weeks ago
  • last active 4 days ago
1 vote
86 views

This is the last problem that I have and can’t solve it after days of debugging and reading the documentation. The problem is that when you leave the app and then reopen it, some things from chart disappear but some stay there. Not sure what is the key, best to check this gif I recorded (it is on the loop that’s why it seems the data re-appears):

enter image description here

Also this exception occurs which is the cause I think:

2019-02-22 13:18:47.994 7216-14171/xx.yy E/Exception: null
    java.lang.NullPointerException: Attempt to read from field 'int com.scichart.drawing.opengl.ac.a' on a null object reference
        at com.scichart.drawing.opengl.MyGLRenderer.g(SourceFile:575)
        at com.scichart.drawing.opengl.MyGLRenderer.b(SourceFile:371)
        at com.scichart.drawing.opengl.aw.drawLinesStrip(SourceFile:167)
        at com.scichart.drawing.common.RegionRenderContextWrapper.drawLinesStrip(SourceFile:201)
        at com.scichart.drawing.common.RegionRenderContextWrapper.drawLinesStrip(SourceFile:201)
        at com.scichart.drawing.common.d.draw(SourceFile:36)
        at com.scichart.charting.visuals.renderableSeries.SeriesDrawingManager.a(SourceFile:125)
        at com.scichart.charting.visuals.renderableSeries.SeriesDrawingManager.iterateLines(SourceFile:107)
        at com.scichart.charting.visuals.renderableSeries.FastBandRenderableSeries.internalDraw(SourceFile:227)
        at com.scichart.charting.visuals.renderableSeries.BaseRenderableSeries.onDraw(SourceFile:701)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.f(SourceFile:469)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.d(SourceFile:394)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.c(SourceFile:374)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.a(SourceFile:358)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.a(SourceFile:134)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDraw(SourceFile:123)
        at com.scichart.drawing.opengl.RenderSurfaceGL$a.onDraw(SourceFile:243)
        at com.scichart.drawing.opengl.MyGLRenderer.b(SourceFile:262)
        at com.scichart.drawing.opengl.MyGLRenderer.onDrawFrame(SourceFile:246)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
2019-02-22 13:18:48.017 7216-14171/xx.yy E/Exception: null
    java.lang.NullPointerException: Attempt to read from field 'int com.scichart.drawing.opengl.ac.a' on a null object reference
        at com.scichart.drawing.opengl.MyGLRenderer.g(SourceFile:575)
        at com.scichart.drawing.opengl.MyGLRenderer.b(SourceFile:371)
        at com.scichart.drawing.opengl.aw.drawLinesStrip(SourceFile:167)
        at com.scichart.drawing.common.RegionRenderContextWrapper.drawLinesStrip(SourceFile:201)
        at com.scichart.drawing.common.RegionRenderContextWrapper.drawLinesStrip(SourceFile:201)
        at com.scichart.drawing.common.d.draw(SourceFile:36)
        at com.scichart.charting.visuals.renderableSeries.SeriesDrawingManager.a(SourceFile:125)
        at com.scichart.charting.visuals.renderableSeries.SeriesDrawingManager.iterateLines(SourceFile:107)
        at com.scichart.charting.visuals.renderableSeries.FastBandRenderableSeries.internalDraw(SourceFile:227)
        at com.scichart.charting.visuals.renderableSeries.BaseRenderableSeries.onDraw(SourceFile:701)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.f(SourceFile:469)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.d(SourceFile:394)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.c(SourceFile:374)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.a(SourceFile:358)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.a(SourceFile:134)
        at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDraw(SourceFile:123)
        at com.scichart.drawing.opengl.RenderSurfaceGL$a.onDraw(SourceFile:243)
        at com.scichart.drawing.opengl.MyGLRenderer.b(SourceFile:262)
        at com.scichart.drawing.opengl.MyGLRenderer.onDrawFrame(SourceFile:246)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
  • Primoz asked 4 weeks ago
  • last active 3 weeks ago
0 votes
91 views

enter image description here

There is a problem with cursor axis label – it is completely wrong (always too big). I don’t have any custom label provider set for this axis.
It is funny that on cursor tooltip the value is correct (here I use CustomXYSeriesInfoProvider).

The same thing happens on Volume, but here I have a custom NumericLabelProviderVolume and I have debugged formatCursorLabel() in it and found out that there are always two subsequent calls of this function. With first call the incoming parameter (Comparable dataValue) is correct, but then in the second call this value is wrong and it overwrites previous right formatted value. I don’t now where does this value come from.

  • Primoz asked 4 weeks ago
  • last active 3 weeks ago
1 vote
0 answers
97 views

Hey,

I’ve swapped out application from using the OpenGLRenderer to use the android CanvasRenderer. This was done to get around the black background appearing for the chart while redrawing. Referenced here.

This works and at the moment we’ve yet to experience any performance issues. However every time we add data to the chart we get an exception printed into the log:

java.lang.IllegalArgumentException: width and height must be > 0
    at android.graphics.Bitmap.createBitmap(Bitmap.java:829)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:775)
    at com.scichart.drawing.canvas.CanvasTexture.<init>(CanvasTexture.java:33)
    at com.scichart.drawing.canvas.CanvasAssetManager.createCanvasTexture(CanvasAssetManager.java:106)
    at com.scichart.charting.visuals.axes.AxisTitleRendererComponent.onDraw(AxisTitleRendererComponent.java:93)
    at com.scichart.charting.visuals.axes.AxisTitleRendererComponent$VerticalAxisTitleRendererComponent.onDraw(AxisTitleRendererComponent.java:123)
    at com.scichart.charting.visuals.axes.DefaultAxisTitleRenderer.onDraw(DefaultAxisTitleRenderer.java:112)
    at com.scichart.charting.visuals.axes.AxisBase.onDraw(AxisBase.java:838)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDrawAxes(RenderSurfaceRenderer.java:510)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDrawAxes(RenderSurfaceRenderer.java:505)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.draw(RenderSurfaceRenderer.java:378)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.renderLoop(RenderSurfaceRenderer.java:150)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDraw(RenderSurfaceRenderer.java:137)
    at com.scichart.drawing.canvas.RenderSurface.onDraw(RenderSurface.java:121)
    at android.view.View.draw(View.java:16195)
    at android.view.View.buildDrawingCacheImpl(View.java:15492)
    at android.view.View.buildDrawingCache(View.java:15353)
    at android.view.View.updateDisplayListIfDirty(View.java:15173)
    at android.view.View.draw(View.java:15965)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
    at android.view.View.draw(View.java:16198)
    at android.view.View.updateDisplayListIfDirty(View.java:15192)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.jav

The graph seems to be working fine however I’m looking to see if there is a reason for this exception that I can resolve for peace of mind and to reduce the amount of stracktraces in the log (our chart redraws at least every 5 seconds.)

Thanks,
Keith

Update:

I’ve attached the sample project as requested.

I also believe I’ve found the cause.

Line 43 of the GraphAdapter sets the yAxis title to be “”. It seems that the canvas renderer must try and draw this empty string as a label which then fails as it has dimensions of 0 x 0.

  • Keith Kirk asked 4 weeks ago
  • last active 4 weeks ago
0 votes
76 views

Hi all,

Upfront apologies – I suspect this is a bit of a complicated set of information I’m looking for, as the UI specs are rather strict on what we’re looking for.

I’m getting to the last few functionalities I need to test, and I believe I’ve proof of concepted nearly everything I need. and I suspect I know what needs to be customized for my requirements. I wasn’t exactly sure how to implement some parts though, and the documentation for the android tick provider suggested that I look for assistance.

https://www.scichart.com/documentation/android/v2.x/webframe.html#Axis%20Ticks%20-%20TickProvider%20and%20DeltaCalculator%20API.html

My remaining goals are to have an X-axis that is…

  1. X-axis is above and below the top and bottom charts. I figure I can handle this dynamically by setting the axis visibility to true depending on which charts are visible – should be easy.

  2. X-axis needs to be on 1 hour ticks (on the hour). The zoom range will go from 3 hours to 72 hours, and I will limit the pan to the nearest hour prior and after the current data. I assume I need to override tick provider. The x axis should look like 12:00 AM, 1:00 AM, 2:00 AM, 3:00 AM, and so forth. If the zoom is at 72 hours, it’ll show something like 12:00AM, 3:00AM, etc. I don’t think this part needs to be customized, and will automatically be handled by the default delta provider (Unless I’m mistaken, I can just specify max number of ticks on screen somewhere, and it’ll handle accordingly). – This one seems rather complicated.

  3. I’d like to display the date on the 12:00AM entries of the x axis. As such, each “12:00 AM” tick will have “Jan 1” below it or the like. -Not sure how feasible this one is, and may push back on this requirement and skip it if it’s not doable.

Do you have an example of how to implement a custom tick provider/have any suggestions (also – please let me know if I’m barking up the wrong tree and I should be taking an entirely different approach).

Thanks!
-Andy

0 votes
77 views

I am working on CreateMultiPaneStockChartFragment example. Sometimes after I refresh data and call surface.zoomExtents(), the chart does not zoom to fit but stays the same. Why is this? I can then manually zoom to extents by double tapping the chart.

This is my (simplified) fragment code (stemming from the example but optimized for my case of regular updating) below. updateChart() is called periodically every 10 sec.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    SciChartBuilder.init(getActivity());
    sciChartBuilder = SciChartBuilder.instance();
}

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    surface = view.findViewById(R.id.priceChart);
    initChart();
}

private void initChart(){
    final DefaultLayoutManager layoutManager = new DefaultLayoutManager.Builder().setRightOuterAxesLayoutStrategy(new RightAlignedOuterVerticallyStackedYAxisLayoutStrategy()).build();
    surface.setLayoutManager(layoutManager);

    final CategoryDateAxis xAxis = sciChartBuilder.newCategoryDateAxis()
        .withLabelProvider(new TradeChartAxisLabelProviderDateTime())
        .withAutoRangeMode(AutoRange.Once)
        .build();
    xAxis.setMinimalZoomConstrain(10d); // minimum data points

    surface.getXAxes().add(xAxis);

    final NumericAxis yAxisPrice = sciChartBuilder.newNumericAxis()
        .withAxisId(PRICES)
        .withAutoRangeMode(AutoRange.Always)
        .withGrowBy(new DoubleRange(0.01d, 0.01d))
        .withLabelProvider(new NumericLabelProviderPrice(coinCurrency))
        .build();
    yAxisPrice.setMinimalZoomConstrain(0d);
    surface.getYAxes().add(yAxisPrice);

    // add axes for MACD, RSI, VOL..


    legendModifier = sciChartBuilder.newModifierGroup()
        .withLegendModifier().withShowCheckBoxes(false).withShowSeriesMarkers(false).build()
        .build();
    // surface.getChartModifiers().add(legendModifier); // this causes crash; add it after series are present

    interactionModifiers = sciChartBuilder.newModifierGroup()
        .withPinchZoomModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build()
        .withZoomPanModifier().withReceiveHandledEvents(true).withClipModeX(ClipMode.ClipAtExtents).build()
        .withZoomExtentsModifier().withReceiveHandledEvents(true).build()
        .build();
    surface.getChartModifiers().add(interactionModifiers);

    cursorModifier = sciChartBuilder.newModifierGroup()
        .withCursorModifier().build()
        .build();
    cursorModifier.setIsEnabled(false);
    surface.getChartModifiers().add(cursorModifier);
}

private void updateChart(int daysToShow) {
    final PriceSeries priceData = getData(daysToShow);

    surface.getRenderableSeries().clear();
    surface.getAnnotations().clear();

    // price chart
    final OhlcDataSeries<Date, Double> stockPrices = sciChartBuilder.newOhlcDataSeries(Date.class, Double.class).withSeriesName(getString(R.string.price)).build();
    stockPrices.append(series.getDateData(), series.getOpenData(), series.getHighData(), series.getLowData(), series.getCloseData());
    final BaseRenderableSeries seriesOHLCV = sciChartBuilder.newCandlestickSeries().withDataSeries(stockPrices).withSeriesInfoProvider(new CustomOHLCSeriesInfoProvider()).withYAxisId(PRICES).build();
    surface.getRenderableSeries().add(seriesOHLCV);

    surface.getAnnotations().add(sciChartBuilder.newAxisMarkerAnnotation().withY1(stockPrices.getYValues().get(stockPrices.getCount()-1)).withBackgroundColor(Color.WHITE).withFontStyle(12, Color.BLACK).withYAxisId(PRICES).build());

    // do the same for MACD, RSI, VOL ...

    if(!surface.getChartModifiers().contains(legendModifier))
        surface.getChartModifiers().add(legendModifier); // this causes crash if added before any series is present

    if(!silent) {
        Log.d("debug", "surface.zoomExtents()");
        surface.zoomExtents(); // sometimes this does not work
    }
}
  • Primoz asked 4 weeks ago
  • last active 4 weeks ago
0 votes
96 views

Hi, i want to make something like that : https://i.ibb.co/617TmD2/screenshot-line.png

I have tried HorizontalLineAnnotation but i successed to have it only on bottom graph : https://i.ibb.co/qsCjjGd/screen-bot-graph.png

Here how i initialize my top graph :

@Override
public void initGraph(Context context) {
    Log.d(TAG, "initGraphs");
    SciChartSurface spectogramSciChart = new SciChartSurface(context);
    spectogram.addView(spectogramSciChart);

    xAxis = new NumericAxis(context);
    xAxis.setAutoRange(AutoRange.Always);
    xAxis.setDrawMinorTicks(false);
    xAxis.setDrawMajorBands(false);
    xAxis.setDrawMinorGridLines(false);
    xAxis.setAxisAlignment(AxisAlignment.Left);
    xAxis.setFlipCoordinates(true);
    xAxis.setAxisTitle("Frequences (KHz)");
    xAxis.setAxisTitleOrientation(AxisTitleOrientation.VerticalFlipped);
    spectogramSciChart.getXAxes().add(xAxis);


    yAxis = new NumericAxis(context);
    yAxis.setVisibleRange(new DoubleRange(startSpectrogramRange, endSpectrogramRange));
    yAxis.setDrawLabels(false);
    yAxis.setDrawMinorTicks(false);
    yAxis.setDrawMajorBands(false);
    yAxis.setDrawMinorGridLines(false);
    yAxis.setAxisAlignment(AxisAlignment.Bottom);
    yAxis.setFlipCoordinates(true);
    yAxis.setAxisTitleOrientation(AxisTitleOrientation.Horizontal);
    spectogramSciChart.getYAxes().add(yAxis);

    FastUniformHeatmapRenderableSeries f = new FastUniformHeatmapRenderableSeries();
    scichartTools.getSpectrogramDS().setStartX(0f);
    scichartTools.getSpectrogramDS().setStepX(0.9f);
    f.setDataSeries(scichartTools.getSpectrogramDS());
    f.setMaximum(100);
    f.setMinimum(-30.0);
    f.setColorMap(new ColorMap(
            new int[]{ColorUtil.Transparent, ColorUtil.DarkBlue, ColorUtil.Purple, ColorUtil.Red, ColorUtil.Yellow, ColorUtil.White},
            new float[]{0f, 0.0001f, 0.25f, 0.50f, 0.75f, 1f}
    ));

    spectogramSciChart.getRenderableSeries().add(f);
    scichartTools.getSpectrogramValues().setSize(scichartTools.getFftSize() * scichartTools.getBatchSize() * 2);

    // I add the line but it's not displayed
    HorizontalLineAnnotation horizontalLine = new HorizontalLineAnnotation(context);
    horizontalLine.setHorizontalGravity(Gravity.FILL_HORIZONTAL);
    horizontalLine.setY1(5f);
    horizontalLine.setLabelValue("Label");
    spectogramSciChart.getAnnotations().add(horizontalLine);
}

You can see at the bottom of the function that i added it, but it doesn’t work on this graph. Why ? Maybe the graph is drawing over my line ?

Thanks,
Best regards

0 votes
0 answers
71 views

I am working on the CreateMultiPaneStockChartFragment example. I modified the example, like showing legend checkboxes and some other stuff. I am getting the following exception, but just sometimes (like 30% of time). It happens as soon as I open the fragment.

2019-02-19 12:32:59.551 12534-12534/com.yyyyy.xxxE/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.yyyyy.xxxE, PID: 12534
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.get(ArrayList.java:437)
        at com.scichart.charting.visuals.legend.SciChartLegend$d.a(SourceFile:278)
        at com.scichart.charting.visuals.legend.SciChartLegend$c.run(SourceFile:338)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Obviously there is some problem with get() on an empty ArrayList, but I am having a hard time to debug where exactly this happens.

I have reviewed my source code multiple times and can not find the cause. What could be the problem?

I am using v2.2.1.2391.

  • Primoz asked 4 weeks ago
  • last active 4 weeks ago
1 vote
86 views

Hello,

I have this app : https://i.ibb.co/sPXMbf1/screenshot-framed-1.png

I would like the graph below (the XyDataSeries) to be drawn from right to left (currently it is drawn from left to right)

I have this function to draw :

val audioDS = XyDataSeries<Int, Short>().apply { fifoCapacity = audioStreamBufferSize }
fun generateAudioStream(buffer: ShortValues) {
           val longs = IntegerValues(buffer.size())
           longs.setSize(buffer.size())
           for (i in 0 until buffer.size()) {
               longs[i] = time++
           }
           audioDS.append(longs, buffer)
        }

And my graph is initialized like this :

 @Override
public void initGraph(Context context) {
    Log.d(TAG, "initGraphs");
    SciChartSurface audioStreamSciChart = new SciChartSurface(context);
    mAudiostream.addView(audioStreamSciChart);
    xAxis = new NumericAxis(context);
    xAxis.setVisibleRange(new DoubleRange(startAudioStreamRange, endAudioStreamRange));
    xAxis.setDrawLabels(false);
    xAxis.setDrawMinorTicks(false);
    xAxis.setDrawMajorBands(false);
    xAxis.setDrawMinorGridLines(false);
    audioStreamSciChart.getXAxes().add(xAxis);

    NumericAxis yAxis = new NumericAxis(context);
    yAxis.setVisibleRange(new DoubleRange(new DoubleRange((double) Short.MIN_VALUE, (double) Short.MAX_VALUE)));
    yAxis.setDrawLabels(true);
    yAxis.setDrawMinorTicks(false);
    yAxis.setDrawMajorBands(false);
    yAxis.setDrawMinorGridLines(false);
    yAxis.setAxisAlignment(AxisAlignment.Left);

    audioStreamSciChart.getYAxes().add(yAxis);

    float lineThickness = SciChartExtensionsKt.dip(context, 1.0F);

    FastLineRenderableSeries f = new FastLineRenderableSeries();
    f.setDataSeries(scichartTools.getAudioDS());
    f.setStrokeStyle(new SolidPenStyle(ColorUtil.Grey, true, lineThickness, null));
    audioStreamSciChart.getRenderableSeries().add(f);
    scichartLayout = mAudiostream.getChildAt(0);
}

I understand that, currently it’s drawn from left to right because i append data on my audioDS, is it possible to make it draw from right to left instead ?

Best regards,
Wavely

0 votes
98 views

Hi,

I was trying to get the max value on the y axis for the visible window, so that I can manually scale the y axis visible range (so I can control the increments and the y axis maximum). To get the max y data in the window, I’ve written in Kotlin:

var coordinateCalc = xUoAxes[0].createCoordinateCalculatorFrom(xUoAxes[0].visibleRange) //get visible range of coordinates
var coordMin = coordinateCalc.minAsDouble //debug var
var coordMax = coordinateCalc.maxAsDouble //debug var
var dataRange = yUoAxes.getAxisById("uoId").dataRange //debug var
var test = mapOf("test" to coordinateCalc)  //create map for getWindowedYRange, providing the coordinateCalculator
var windowedYRangeUo = yUoAxes.getAxisById("uoId").getWindowedYRange(test)  //I think this should pass back the same value as dataRange?

However, the getWindowedYRange result is significantly different from dataRange, and while debugging, there is only a single data point in yUoAxes.

I wasn’t sure if I’m using the right function, or if I’m using it incorrectly (or if this is even the correct approach to this problem)?

Thanks,
-Andy

0 votes
116 views

Is it possible?

Or make box annotations fit screen height?
(even when zooming)

0 votes
107 views

I would like to be able to have a Pie Chart go to the very edge of the layout it’s inside. Currently it appears as though there is some default built-in padding around Pie Charts that cannot be overridden. I’ve tried manually specifying padding and margins both programmatically (on the SciChartSurface object itself) and in the layout XML, but that default padding still exists.

I’ve included a screenshot of the sample app to show the padding I’m talking about (circled in red).

1 vote
113 views

Hello,

I am currently developing an application of this type (spectrogram + audiostream) :
https://i.ibb.co/sPXMbf1/screenshot-framed-1.png

But i have one problem and one question :

Problem :

I generate the spectrum with this function :

    @JvmStatic
    fun generateSpectrum(shortArray: ShortArray) {
        val sw = Stopwatch()
        sw.start()
        val buffer = ShortValues(shortArray)

        val fft = Radix2FFT(buffer.size())
        val fftData = DoubleValues()

        fft.run(buffer, fftData)
        fftData.setSize(fftSize)
        val spectrogramItems = spectrogramValues.itemsArray
        val fftItems = fftData.itemsArray

        val spectrogramSize = spectrogramValues.size()
        val fftSize = fftData.size()
        val offset = spectrogramSize - fftSize

        System.arraycopy(spectrogramItems, fftSize, spectrogramItems, 0, offset)
        System.arraycopy(fftItems, 0, spectrogramItems, offset, fftSize)

        spectrogramDS.updateZValues(spectrogramValues)
        sw.stop()
        Log.v(TAG, "SPECTRUM : " + sw.elapsedTime.toString())
    }

It works very well to generate data from a shortarray (from microphone or saved shortarray). Except that, sometime when I launch replays, on average 1 in 10 replays will be very slow. As you can see, I put stopwatch to isolate the problems and it comes from this function. This function takes an average of 2 to 3 milliseconds in normal time to perform. When a replay is slow, this function takes on average between 6 and 8 milliseconds to execute.

Why? Do you have any ideas?

Question :

I can read data from a microphone as shown on the screenshot. I also know how to replay them by cleaning spectrogramDS and sending back the read data.

Now, let’s say I want to replay but in the form of :
What is not yet played is drawn in grey (so i don’t clean) and as the dataset plays back, it takes the same color as the recording. Basically, we see in advance the sound template that is being replayed but also where we are currently in the replay.
Is it possible ?

Thanks for you answer,
Wavely

0 votes
124 views

Hi,

In Android MVVM architecture, I am trying to @Inject ISuspendable through ViewModelModule, as I cannot pass this to my VMModel constructor.

@Module
abstract class ViewModelModule {

    @Singleton
    @Binds
    abstract fun getSuspendable(aSuspendable: ACMSuspendableImpl): ISuspendable

@Binds
    @IntoMap
    @ViewModelKey(MonitorViewModel::class)
    abstract fun bindsMonitorViewModell(monitorViewModel: MonitorViewModel): ViewModel
}


@Singleton
class ACMSuspendableImpl @Inject constructor() : ISuspendable {


    override fun decrementSuspend() {
    }

    override fun suspendUpdates(): IUpdateSuspender {
        TODO("not implemented")
    }

    override fun getIsSuspended(): Boolean {
        TODO("not implemented")
    }

    override fun resumeUpdates(p0: IUpdateSuspender?) {
    }
}

whereas my MonitorViewModel class as,

class MonitorViewModel @Inject constructor(context: Context) : BaseViewModel()  {

    @Inject
    lateinit var acmSuspend: ISuspendable


private fun loadMonitorData() {

        UpdateSuspender.using(acmSuspend) { //<! NULL ->
            iapDataSeries.append(Timestamp.valueOf(mData100Hz.getRtcTimeStamp().toString()), mData100Hz.emr.iap)
            uoColumnDataSeries.append(
                Timestamp.valueOf(mData100Hz.getRtcTimeStamp().toString()),
                mData100Hz.emr.totalVolume
            )
      }
}

How should I @Inject ISuspendable so that it should not be NULL. Please provide me some example snipped to work.
FYI,

I tried to follow the ECGViewModel but this sample used some custom solution and there is no use of DI.

BR,

Praween

0 votes
153 views

Hi,

I have medical data displaying every 1s with Date as XAxis and ml/hr as YAxis. I want to control the display to let say, 6hr window in the current display by default whereas zoom-in can go to precisely 1hr and not below that and zoom-out reset to 6hr. How can I achieve this?

FYI, my data retention is for 72hrs.

BR,
Praween K.

0 votes
137 views

I have at most ten of sciChart in an layout which populated by programming. I want to screenshot by programming that layout with each chart zoom or change view by user. However, the screenshot doesn’t show graphs rather than black rectangle. Is there any option to show graph on screenshot.

0 votes
0 answers
116 views

Turn off the phone permission, the chart shows the error, why, can you solve it?
Only when this permission is opened does it appear normal

0 votes
124 views

Or say, how can I prevent movement of HorizontalLineAnnotation when dragging the grip of X1(typically the left grip)?

0 votes
161 views

Hello, I have added YAxisDragModifier and ZoomPanModifier to my surface and when I try to drag on Y axis I can move the X axis too and that is not the behavior that I was trying to get. I want when I drag/move YAxis not to move on the YAxis also.

Here is my code:

Surface.ChartModifiers.Add(new PinchZoomModifier());
Surface.ChartModifiers.Add(new ZoomExtentsModifier());
Surface.ChartModifiers.Add(new YAxisDragModifier { DragMode = AxisDragModifierBase.AxisDragMode.Pan });
Surface.ChartModifiers.Add(new XAxisDragModifier { DragMode = AxisDragModifierBase.AxisDragMode.Pan, ClipModeX = ClipMode.None });
Surface.ChartModifiers.Add(new ZoomPanModifier
{
Direction = Direction2D.XDirection,
ZoomExtentsY = false
});

Here is the video with the behavior:
VIDEO: https://drive.google.com/file/d/1kbYi2voKNvHD5J7D6-XDw7OJx4IwlEqr/view

Help please!

0 votes
152 views

Hello everyone.

I have 2 stacked horizontally charts with

 .withMotionEventsGroup("ModifiersSharedEventsGroup").withReceiveHandledEvents(true)

so they drag and zoom in same way.

But when i put one finger on first chart, second finger on second chart – then total apocalypse happens.
Is it possible to zoom it, like two fingers on one chart or disable zoom in that situation, so charts will have no conflict?

(I think both chart just dragging in different directions in my case, but because they are linked – everything just shakes)

Edit:

Collections.addAll(mSciChartMainSurface.getChartModifiers(), sciChartBuilder.newModifierGroup()
                        .withPinchZoomModifier().withXyDirection(Direction2D.XDirection).withScaleFactor(SCALE_FACTOR_X_AXIS).build()
                        .withZoomPanModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build()
                        .withMotionEventsGroup(MODIFIER_SHARED_EVENTS_GROUP_NAME).withReceiveHandledEvents(true)
                        .withXAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Pan).build()
                        .build());



Collections.addAll(mSciChartBotIndicatorSurface.getChartModifiers(), sciChartBuilder.newModifierGroup()
                    .withMotionEventsGroup(MODIFIER_SHARED_EVENTS_GROUP_NAME).withReceiveHandledEvents(true)
                    .withPinchZoomModifier().withXyDirection(Direction2D.XDirection).withScaleFactor(SCALE_FACTOR_X_AXIS).build()
                    .withZoomPanModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build()
                    .withXAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Pan).build()
                    .build());
0 votes
162 views

Hi, i am developping a spectogram, screenshot : https://i.ibb.co/7CPTZbg/screenshot-framed.png

I get the same result from your showcase, now there is some things i want to change but can’t resolve to know how to :
– How can i change data direction to spread from left to right ? (currently right to left)
– How can i clear FastUniformHeatmapRenderableSeries ? Method clear doesn’t work
– How can we set width of FastUniformHeatmapRenderableSeries’s layout to be fixed to a specific seconds number ? (example : there is 10 seconds of data between left and right)

Thank you,
Wavely

0 votes
136 views

I am developing an application which can receive the data from an ECG circuit, then transmit that data through Bluetooth into my phone application. My phone application would then display the ECG graph. I tried downloading the ECG demo example and it works find on its own. I am trying to incorporate that into my own project and see if it works. However I have been getting errors. Please help me out! Thank you!

0 votes
138 views

Hi,

I am currently using SciChartDebugLogger to enable logging but I am not sure what information the vararg provides

     public void logInfo(String tag, String stringFormat, Object... args) {  }

what does the arg object provide? can it be converted to a readable string format? what does the string format mean?

0 votes
146 views

I have many users who have been sending crash reports with this stack trace and I can’t figure out what part of our code would be triggering this since the stack trace doesn’t mention any classes that are we’ve coded. Any idea what could be triggering this based on the stack trace?

java.lang.ArrayIndexOutOfBoundsException: index
at com.scichart.core.model.IntegerValues.get(IntegerValues.java:164)
at com.scichart.charting.visuals.layout.CanvasLayout.getChildDrawingOrder(CanvasLayout.java:75)
at android.view.View.populateAccessibilityNodeInfoDrawingOrderInParent(View.java:7053)
at android.view.View.onInitializeAccessibilityNodeInfoInternal(View.java:7006)
at android.view.ViewGroup.onInitializeAccessibilityNodeInfoInternal(ViewGroup.java:3232)
at android.view.View.onInitializeAccessibilityNodeInfo(View.java:6622)
at android.view.View.createAccessibilityNodeInfoInternal(View.java:6581)
at android.view.View.createAccessibilityNodeInfo(View.java:6566)
at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:145)
at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:119)
at android.view.View.onInitializeAccessibilityEventInternal(View.java:6518)
at android.view.View.onInitializeAccessibilityEvent(View.java:6506)
at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:6371)
at android.view.View.sendAccessibilityEventUnchecked(View.java:6356)
at android.view.View$SendViewStateChangedAccessibilityEvent.run(View.java:23903)
at android.view.View$SendViewStateChangedAccessibilityEvent.runOrPost(View.java:23936)
at android.view.View.notifyViewAccessibilityStateChangedIfNeeded(View.java:9488)
at android.view.View.setFlags(View.java:11685)
at android.view.View.setVisibility(View.java:8082)
at com.scichart.charting.visuals.annotations.AnnotationBase$17.run(AnnotationBase.java:268)
at android.os.Handler.handleCallback(Handler.java:836)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:208)
at android.app.ActivityThread.main(ActivityThread.java:6267)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)

1 vote
153 views

Hi, I’m a software engineer. My organization is ready to purchase your solution for our project(Android, IOS), but I have some questions:
1. Can I get a callback when the visible area on the x axis changes? This is necessary to dynamically upload data to the end of the graph when the user scrolls back.
2. Change the position of the tooltip and place in the upper corner of the chart?
Thank you for your time and hope for further cooperation.
Evgeniy Grishko, software engineer.

1 vote
168 views

Hello everyone.

I have chart with adding data every second.

What i want to do:
– by dragging finger left, right – chart scrolls left and right (can go to past data, etc)
– by two fingers zoom gesture – it zooms (only horizontally with autorange by Y axis)
– i set a visible range limit to the right in this way: user can scroll to the right xMax to be in the middle (currently this part not working – and axis zooming, when i continue scrolling to the right)

I tried a lot of different modifiers, but none of them was ok.

My setup:

lineDataSeries.addObserver(new IDataSeriesObserver() {
            @Override
            public void onDataSeriesChanged(IDataSeries<?, ?> iDataSeries, int i) {

                long addTime = 30_000 * currentTimeframe;

                runOnUiThread(() -> {
                    DateRange dateRange = new DateRange();

                    dateRange.setMinMax(new Date(0), new Date(lineDataSeries.getXRange().getMax().getTime() + addTime));

                    mSciChartSurface.getXAxes().getDefault().setVisibleRangeLimit(dateRange);
                });
            }
        });

final DateAxis dateAxis = sciChartBuilder.newDateAxis()
            .withAutoRangeMode(AutoRange.Never)
            .withDrawMajorTicks(true)
            .withDrawMinorTicks(false)
            .withDrawMinorGridLines(false)
            .withAutoFitMarginalLabels(false)
            .withTextFormatting("HH:mm:ss")
            .build();
    dateAxis.setMinimalZoomConstrain(25_000L * currentTimeframe); // 25 - 300 points
    dateAxis.setMaximumZoomConstrain(300_000L * currentTimeframe);

final NumericAxis yAxis = sciChartBuilder.newNumericAxis()
            .withAutoRangeMode(AutoRange.Always)
            .withGrowBy(new DoubleRange(0.1d, 0.1d))
            .withTextFormatting("#.000000")
            .withAutoFitMarginalLabels(false)
            .withDrawMinorTicks(false)
            .withDrawMinorGridLines(false)
            .build();
    yAxis.setMinimalZoomConstrain(0d);

ModifierGroup additionalModifiers = sciChartBuilder.newModifierGroup()
            .withPinchZoomModifier().withXyDirection(Direction2D.XDirection).withScaleFactor(2).build()
            .withZoomPanModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).withClipModeX(ClipMode.ClipAtMax).build()
            //.withZoomExtentsModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build()
           //
            .withXAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Pan).withClipModeX(ClipMode.ClipAtMax).build()
            //.withYAxisDragModifier().withReceiveHandledEvents(false).withDragMode(AxisDragModifierBase.AxisDragMode.Scale).build()
            .build();
0 votes
148 views

Hello everyone.

I have a candlestick chart with date x-axis and double y-axis.
While scrolling to the left im loading past history and showing it – everything works fine.

Once i have below crash:

What can cause it?
Can not find anything in google.

01-22 10:23:31.490 28770-28770/com.test.livedataperformance E/InputEventReceiver: Exception dispatching input event.
01-22 10:23:31.490 28770-28770/com.test.livedataperformance D/AndroidRuntime: Shutting down VM
01-22 10:23:31.490 28770-28770/com.test.livedataperformance E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.test.livedataperformance, PID: 28770
java.lang.UnsupportedOperationException: Unsupported search mode
at com.scichart.data.model.SciListUtil.longFindIndex(Native Method)
at com.scichart.data.model.SciListUtil.a(SourceFile:39)
at com.scichart.data.model.SciListUtil$b.findIndex(SourceFile:3044)
at com.scichart.data.model.SciListFactory$i.a(SourceFile:3141)
at com.scichart.data.model.SciListFactory$i.findIndex(SourceFile:3126)
at com.scichart.charting.model.dataSeries.XDataSeries.a(SourceFile:273)
at com.scichart.charting.model.dataSeries.XDataSeries.getIndicesXRange(SourceFile:241)
at com.scichart.charting.model.dataSeries.XDataSeries.getWindowedYRange(SourceFile:208)
at com.scichart.charting.visuals.renderableSeries.BaseRenderableSeries.getYRange(SourceFile:1027)
at com.scichart.charting.visuals.axes.rangeCalculators.RangeCalculationHelperBase.getWindowedYRange(SourceFile:225)
at com.scichart.charting.visuals.axes.AxisBase.getWindowedYRange(SourceFile:1098)
at com.scichart.charting.visuals.SciChartSurface.a(SourceFile:1116)
at com.scichart.charting.visuals.SciChartSurface.zoomExtentsY(SourceFile:1167)
at com.scichart.charting.modifiers.ZoomPanModifier.a(SourceFile:202)
at com.scichart.charting.modifiers.ZoomPanModifier.onScroll(SourceFile:176)
at android.view.GestureDetector.onTouchEvent(GestureDetector.java:619)
at com.scichart.charting.modifiers.GestureModifierBase.onTouch(SourceFile:80)
at com.scichart.charting.modifiers.ModifierGroup.onTouch(SourceFile:189)
at com.scichart.core.utility.touch.MotionEventManager.c(SourceFile:140)
at com.scichart.core.utility.touch.MotionEventManager.a(SourceFile:39)
at com.scichart.core.utility.touch.MotionEventManager$a$1.a(SourceFile:224)
at com.scichart.core.utility.touch.MotionEventManager$a$1.execute(SourceFile:221)
at com.scichart.core.utility.touch.MotionEventManager$a.a(SourceFile:211)
at com.scichart.core.utility.touch.MotionEventManager$a.onTouchEvent(SourceFile:183)
at com.scichart.charting.visuals.SciChartSurface.onTouchEvent(SourceFile:1251)
at android.view.View.dispatchTouchEvent(View.java:9300)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2547)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2240)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
at android.app.Activity.dispatchTouchEvent(Activity.java:2812)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
at android.view.View.dispatchPointerEvent(View.java:9520)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4242)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4095)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3641)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3694)
at android.view.ViewRootImpl$InputStage.forward(ViewRoo

0 votes
0 answers
134 views

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.view.GestureDetector.onTouchEvent(android.view.MotionEvent)' on a null object reference
at com.scichart.charting.modifiers.GestureModifierBase.onTouch(SourceFile:80)
at com.scichart.core.utility.touch.MotionEventManager.c(SourceFile:140)
at com.scichart.core.utility.touch.MotionEventManager.a(SourceFile:39)
at com.scichart.core.utility.touch.MotionEventManager$a$1.a(SourceFile:224)
at com.scichart.core.utility.touch.MotionEventManager$a$1.execute(SourceFile:221)
at com.scichart.core.utility.touch.MotionEventManager$a.a(SourceFile:211)
at com.scichart.core.utility.touch.MotionEventManager$a.onTouchEvent(SourceFile:183)
at com.scichart.charting.visuals.SciChartSurface.onTouchEvent(SourceFile:1237)
at android.view.View.dispatchTouchEvent(View.java:12533)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3026)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2705)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3032)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2662)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:461)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1830)
at android.app.Activity.dispatchTouchEvent(Activity.java:3453)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:419)
at android.view.View.dispatchPointerEvent(View.java:12774)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5263)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5063)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4578)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4631)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4597)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4737)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4605)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4794)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4578)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4631)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4597)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4605)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4578)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7304)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7273)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7234)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7410)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:247)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:165)
at android.app.ActivityThread.main(ActivityThread.java:6806)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

1 vote
143 views

If you set limit on range of axis, the pinch gesture will not work correctly.
Pinch the chart and hold for a while (about less than 1 sec), the chart will resize to the limit value you set on the axis.

You can change code of OscilloscopeFragment.java#106 in Examples to below to reproduce this problem.

final IAxis xBottomAxis = sciChartBuilder.newNumericAxis()
                    .withAutoRangeMode(AutoRange.Never)
                    .withAxisTitle("Time (ms)")
                    .withVisibleRange(new DoubleRange(2.5, 4.5))
                    .withVisibleRangeLimit(0,20)   // this will help reproduce the problem
                    .build();
0 votes
0 answers
156 views

When I run the LegendModifier example from tutorial, I just got an error

FATAL EXCEPTION: main
Process: br.cta.ipev.scicharttutorial, PID: 16941
java.lang.NoClassDefFoundError: com.scichart.charting.visuals.legend.SciChartLegend$LegendItemViewHolderAdapter*

ModifierGroup legendModifier = sciChartBuilder.newModifierGroup()
.withLegendModifier().withOrientation(Orientation.HORIZONTAL).withPosition(Gravity.TOP | Gravity.START, 16).build()
.build();
surface.getChartModifiers().add(legendModifier);
0 votes
173 views

Hey everyone,

Im using scichart in a data intensive application and have hit a problem that I haven’t been able to find a solution to.

The scope for feature is that the chart must be able to render a real time list of data points (double & timestamp) as they come in from a web service. However the chart must also be able to filter to show points that ocurred in a configurable window eg. all points within the last 5 minutes or 15 minutes or no filter.

I have business logic which generates the list of points the chart should show for the desired window. I also have an adapter that generates a diff of the old data aginst the new data to dispatch commands to the XyDataSeries.

The diff generates add, remove and update patches which the adapter applies to the XyDataSeries in the following form:
Add -> append() if data is at end of series, insertAt otherwise
Remove -> removeAt()
Update -> updateAt()

This is where I hit a problem. The removes do not happen, the only command that I can see modifying the chart is the append. I’ve tried using removeRange as well since removes often occur together but still no success.

The only way I’ve managed to get it to work is to clear all the rendered lines and redrew them which I imagine is hugely inefficient.

I’m using the UpdateSuspender to ensure that all operations complete as one.

At the moment I’m seeing no messages in Logcat and haven’t experienced any crashes and debugging with breakpoints show that the methods are being called.

Does it sound like I’m doing something wrong?

Also just to check my understanding of modifying the XyDataSeries, does it only apply updates at the end? I’ve been modifying my indices as I go so if I remove at index 1 I then assume that the series has shrunk by 1, is this the case?

Thanks for any assistance you can provide.

Edit:

A sample project that demonstrates this is attached. The provided ReadMe briefly covers the expected behaviour for the app and a run down of the classes included.

  • Keith Kirk asked 2 months ago
  • last active 2 months ago
0 votes
148 views

Hello

Currently trying this:

final NumericAxis yAxis = sciChartBuilder.newNumericAxis()
            .withAutoRangeMode(AutoRange.Never)
            .withTextFormatting("#.0000")
            .withVisibleRangeLimit(1.143, 1.146)
            .build();

Works perfectly with values .withVisibleRangeLimit(1.14, 1.15), but every time i go for more precision – range is default 0-10

Please help

Edit:
Also works fine with

.withVisibleRangeLimit(1.1433, 1.1566)

Question 2.
Is there a way to determine that live chart was scrolled by finger or by animation (when adding new point)?

0 votes
187 views

I have a ViewPager which switches between Fragments that have a SciChartSurface in their layout. I have two problems with this.

  1. When swiping the ViewPager the SciChartSurface shows a black bar on its side (see attached image).

  2. When swiping I cannot achieve 60 fps on my device. Upon inspecting systrace I see scheduling delay for each frame. Upon inspecting Android profiler’s flame chart I see that SurfaceView calls android.os.BinderProxy.transact() which takes most of the time. If I change the layout of the Fragments used in ViewPager to a normal View, then android.os.MessageQueue.nativePollOnce() takes about 80% of the time, which means most of the time the CPU is idling because drawing takes up so little time.

My question is how can I solve both problems. Have I configured the SciChartSurface wrongly to get the black bars. Can I do anything to speed up changing tabs in ViewPager with SciChartSurfaces in the Fragments?


Edit 14. 1. 2019

I have attached a sample project to reproduce the problem.

1 vote
190 views

Hi,

Good day!

We would like to inquire if there have been updates with project “Spaceship” – cross platform chart initiative (https://www.scichart.com/scichart-2017-vision-market-leader-cross-platform-charts/).

We are currently interested in accessing the scichart’s libraries though Web platforms.

We have just started studying the sample code in git (https://github.com/ABTSoftware/SciChart.NativeScript.Examples).
Though the last updates were 2 years ago.

Hoping for your response.

Best regards,
Jerwine

0 votes
178 views

final IAxis yAxis = sciChartBuilder.newNumericAxis()
.withAxisAlignment(AxisAlignment.Bottom)
.withFlipCoordinates(true)
.build();
final IAxis xAxis = sciChartBuilder.newNumericAxis()
.withAxisAlignment(AxisAlignment.Left)
.withFlipCoordinates(true)
.build();
Collections.addAll(surface.getYAxes(), yAxis);
Collections.addAll(surface.getXAxes(), xAxis);
surface.getChartModifiers().add(new RolloverModifier());

In this case rollover modifier will only catch the very first point of line series.

0 votes
268 views

enter image description hereHi,

I have 3 separate line series and 1 column bar series. Whenever I switch between activities, Column bar data and range persist but not for the line series.

Whenever I return back from activityB to ActivityA it never calls restoreInstanceState. How can I persist the states of these graph?

Snap short attached for reference.

—–code,

initChartUI() {

    SciChartBuilder.init(mContext)
    sciChartBuilder = SciChartBuilder.instance()

    xyIapDataSeries =
            sciChartBuilder.newXyDataSeries(Date::class.javaObjectType, Short::class.javaObjectType)
                .withSeriesName(getString(R.string.label_iap)).build()

    xyTempDataSeries =
            sciChartBuilder.newXyDataSeries(Date::class.javaObjectType, Short::class.javaObjectType)
                .withSeriesName(getString(R.string.label_temperature)).build()

    xyUoDataSeries =
            sciChartBuilder.newXyDataSeries(Date::class.javaObjectType, Short::class.javaObjectType)
                .withSeriesName(getString(R.string.label_uo)).build()

    xyRrDataSeries =
            sciChartBuilder.newXyDataSeries(Date::class.javaObjectType, Short::class.javaObjectType)
                .withSeriesName(getString(R.string.label_respiratory_rate)).build()

    initChartIap(iap_chart)
    initChartUo(uo_chart)
    initChartTemp(temperature_chart)
    initChartRR(resp_rate_chart)

}

private fun initChartIap(surface: SciChartSurface) {
val xAxis = sciChartBuilder.newCategoryDateAxis()
.withBarTimeFrame(SECONDS_IN_FIVE_MINUTES.toDouble())
.withDrawMinorGridLines(false)
.withGrowBy(0.0, 0.5)
.build()
val yAxis = sciChartBuilder.newNumericAxis().withAutoRangeMode(AutoRange.Always).build()

    val line = sciChartBuilder.newLineSeries().withStrokeStyle(R.color.accuryn_blue, STROKE_THICKNESS)
        .withDataSeries(xyIapDataSeries).build()

    // Create a Stroke Pen and assign it
    val strokePen = SolidPenStyle(resources.getColor(R.color.accuryn_blue, null), true, 2f, null)
    line.strokeStyle = strokePen

    UpdateSuspender.using(surface) {
        Collections.addAll(surface.xAxes, xAxis)
        Collections.addAll(surface.yAxes, yAxis)
        Collections.addAll<BaseRenderableSeries>(surface.renderableSeries, line)
        Collections.addAll<AxisMarkerAnnotation>(surface.annotations, iapAxisMarker)
        Collections.addAll(
            surface.chartModifiers, sciChartBuilder.newModifierGroup()
                .withXAxisDragModifier().build()
                .withZoomPanModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build()
                .withPinchZoomModifier().build()
                .build()
        )
    }

……
rest 3 other types….
…..
override fun onSaveInstanceState(outState: Bundle) {

    outState.run {
        putInt("count", xyIapDataSeries.count)
        putInt("uoCount", xyUoDataSeries.count)
        putInt("tempCount", xyTempDataSeries.count)
        putInt("rrCount", xyRrDataSeries.count)

        val iapRange = iap_chart.xAxes[0].visibleRange
        val uoRange = uo_chart.xAxes[0].visibleRange
        val tempRange = temperature_chart.xAxes[0].visibleRange
        val rrRange = resp_rate_chart.xAxes[0].visibleRange

        putDouble("rangeIapMin", iapRange.getMinAsDouble())
        putDouble("rangeIapMax", iapRange.getMaxAsDouble())
        putDouble("rangeUoMin", uoRange.getMinAsDouble())
        putDouble("rangeUoMax", uoRange.getMaxAsDouble())
        putDouble("rangeTempMin", tempRange.getMinAsDouble())
        putDouble("rangeTempMax", tempRange.getMaxAsDouble())
        putDouble("rangeRrMin", rrRange.getMinAsDouble())
        putDouble("rangeRrMax", rrRange.getMaxAsDouble())
    }
    super.onSaveInstanceState(outState)
}

override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)

    updateIapData(savedInstanceState)
    updateUoData(savedInstanceState)
    updateTempData(savedInstanceState)
    updateRRData(savedInstanceState)
}

override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
    super.onRestoreInstanceState(savedInstanceState)
     updateIapData(savedInstanceState)
    updateUoData(savedInstanceState)
    updateTempData(savedInstanceState)
    updateRRData(savedInstanceState)
}

private fun updateIapData(savedInstanceState: Bundle?) {
UpdateSuspender.using(iap_chart) {
var count = DEFAULT_POINT_COUNT
if (savedInstanceState != null) {
count = savedInstanceState.getInt(“count”)

            val rangeMin = savedInstanceState.getDouble("rangeIapMin")
            val rangeMax = savedInstanceState.getDouble("rangeIapMax")

            iap_chart.xAxes[0].visibleRange.setMinMaxDouble(rangeMin, rangeMax)
        }

        val iap = mutableListOf<Short>()
        val date = mutableListOf<Date>()
        for (entry in mSimplifiedDataList) {
            if (entry.emr.iap > 0) {
                iap.add(entry.emr.iap)
                date.add(Date(DateTimeUtils.toEpochMilli(entry.getRtcTimeStamp())))
            } else {
                iap.add(0)
                date.add(Date(DateTimeUtils.toEpochMilli(entry.getRtcTimeStamp())))
            }
        }
        tv_iap_input_data.text = iap[iap.size.minus(1)].toString()
        xyIapDataSeries.append(date, iap)
    }
}

……rest other for updating data over UI.

0 votes
236 views

Legend

I have graphs on two adjacent fragments, and when I select one, then swap to the other, the legend draws like this.
I believe it is because I am setting up & drawing the graph when it is off screen. As when you are viewing a fragment it loads the ones to either side for smooth operation, but is there any way to fix this? Maybe I’m doing something wrong and that’s why I’m getting the weird check boxes.

To be clear, these are all checked, but they look weird to our end-users

0 votes
265 views

I have stock charts and want to prevent the user to go beyond the Min/Max datetimes (left, right). I tried applying setVisibleRangeLimitMode() to XAxis but it has no effect:

private final DoubleRange sharedXRange = new DoubleRange();

//sharedXRange.setMinMax(0d, response.body().getData().size()-1d); // not helping
...
final CategoryDateAxis xAxis = sciChartBuilder.newCategoryDateAxis()
        .withVisibility(isMainPane ? View.VISIBLE : View.GONE)
        .withVisibleRange(sharedXRange)
        .withGrowBy(0.1d, 0.1d)
        .build();

xAxis.setMinimalZoomConstrain(10d); // minimum 10 points
xAxis.setVisibleRangeLimitMode(RangeClipMode.MinMax); // not working
//xAxis.setVisibleRangeLimit(new DoubleRange(-5d,5d));
...

I am thinking that maybe I should set Min and Max to sharedXRange, but couldn’t find in the docs what value to put into (tried with index, and Date without luck).

  • Primoz asked 3 months ago
  • last active 3 months ago
1 vote
0 answers
200 views

I want to reference javadocs for the library in Android Studio. According to the tutorial, “You can find javadoc files in \Libs\Docs folder:”. But I haven’t installed anything, just added the libraries using Maven. I searched for Docs folder, but could not find it.

Where are javadocs located or where do we download them?

0 votes
221 views

I am using Android charts and would like to know more about how to customize the YAxis. In the tutorials, there is ussualy something like

builder.newNumericAxis()
.withMinorsPerMajor(4)
.withMaxAutoTicks(8)
.withGrowBy(new DoubleRange(0.1, 0.1))
.build();

In the documentation, I can’t find any explanation for withGrowBy(). What is it used for and are there any examples? What does it mean to have DoubleRange(0.1, 0.1) or DoubleRange(0.01, 0.01)?

  • Primoz asked 3 months ago
  • last active 3 months ago
0 votes
199 views

hi everyone
when i use utf8 string such as ‘محور’ = axis in persian sciChart lookLike this .
i tried different fonts but did not work .

 SciChartBuilder.init(this@Main2Activity)

    // Obtain the SciChartBuilder instance
    val sciChartBuilder = SciChartBuilder.instance()

    val myCustomFont: Typeface? = ResourcesCompat.getFont(this, R.font.maryam)
    val fontStyle = FontStyle(myCustomFont, 50f, Color.RED)

    val s = String("محور".toByteArray(Charsets.UTF_8))

    xAxis = sciChartBuilder.newNumericAxis().withAxisTitleStyle(fontStyle).withAxisTitle(s).withGrowBy(DoubleRange(0.1, 0.1)).build()
    yAxis = sciChartBuilder.newNumericAxis().withAxisTitle("this is y").withGrowBy(DoubleRange(0.1, 0.1)).build()

    val dataSeries = XyDataSeries(Double::class.javaObjectType, Double::class.javaObjectType)
    dataSeries.append(arrayOf(0.0, 2.0, 4.0, 6.0, 8.0, 10.0), arrayOf(1.0, 5.0, -5.0, -10.0, 10.0, 3.0))

    rs = sciChartBuilder.newColumnSeries()
            .withDataSeries(dataSeries)
            .withStrokeStyle(ColorUtil.White, 3f, false)
            .build()

    surface.chartModifiers.add(sciChartBuilder.newModifierGroupWithDefaultModifiers().build())

    UpdateSuspender.using(surface) {
        Collections.addAll<IAxis>(surface.xAxes, xAxis)
        Collections.addAll<IAxis>(surface.yAxes, yAxis)
        Collections.addAll<FastColumnRenderableSeries>(surface.renderableSeries, rs)

    }

and the result :

result image

0 votes
230 views

I have created a SciChartSurface with a ColumnSeries. I update the series data every second with new values. I have turned on GPU profiling in Android developer options. After running the application I get the image shown in the attachment “SciChart_noCursor”. There are no new columns from the profiler drawn on each update of the chart’s data series. However when I add a VerticalLineAnnonation (which I use as a cursor) I get the image shown in the attachment “SciChart_withCursor”. On every update of the chart’s data series, the SciChartSurface is remeasured and redrawn and a lot of the frames take longer than 16.6 ms to redraw. I have also attached the source code of my example project.

My question is, is there a way to have a cursor line that won’t cause the whole surface to redraw on every update? In my production code I update the chart’s data 5 times per second and I have a much more complex layout. And causing layout measure on SciChartSurface is causing lots of janky frames. The reason I used a vertical line annotation as cursor is because I have have cursor info drawn outside of the SciChartSurface in my own TextView and with the built in cursor I wasn’t able to achieve that.

0 votes
227 views

We’d like to customize the look of our legends. We have 4 legends displaying different data, but right now the only thing we can change is the Theme. Is there any way to customize the legend items, like add some icons, change the point marker shape and size, change the check box icon etc…

P.S.: I’m not a trial user. We have an iOS, Android and WPF licenses purchased.

Project info:
Xamarin.Android
SciChart.Android 2.2.2.854

Version
2.2.2.854

Showing 1 - 50 of 235 results