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

0 votes
39 views

Hi! I’ve purchased your products including source code. I need to modify some of your code and have tried in many ways, but I have not compiled your source codes successfully. I am working on it on my Mac Osx, using android studio version of Android Gradle Plugin Version 3.1.0 and Gradle Version 4.4. I’ve got these errors, but I could not find any hints to solve this problem from your QnA site and google. The messages are following. Please let me know how to compile your source code properly. The source codes I have is SciChart_Android_v2.5.0.2540_SDK. Thank you for your good products and service.

Build command failed.

Error while executing process /Users/shiwansung/Library/Android/sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/Android.mk NDK_APPLICATION_MK=/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/Application.mk APP_ABI=x86_64 NDK_ALL_ABIS=x86_64 NDK_DEBUG=1 APP_PLATFORM=android-19 NDK_OUT=/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/build/intermediates/ndkBuild/debug/lib -j4 /Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/build/intermediates/ndkBuild/debug/obj/local/x86_64/libdata.so}

[x86_64] Compile++ : data <= SciListUtil.cpp

[x86_64] Compile++ : data <= arrayOperations.cpp

[x86_64] Compile++ : data <= NativePointResamplerFactory.cpp

[x86_64] Compile++ : data <= resampling.cpp

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

MAKE_NATIVE(double, double)

^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: variable has incomplete type ‘void’

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:16: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

           ^

:359:1: note: expanded from here

Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double

^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: expected ‘;’ after top level declarator

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:98: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

                                                                                             ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:28:104: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void JNICALL Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleWithoutReduction(JNIEnv *env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jboolean isCategoryData)\

                                                                                                   ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:33:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:38:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMin(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:43:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMid(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:48:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMaxUnevenlySpaced(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jdouble minXInclusive, jdouble maxXInclusive, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:59:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:53:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleInClusterMode(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

MAKE_NATIVE(double, float)

^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:28:104: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void JNICALL Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleWithoutReduction(JNIEnv *env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jboolean isCategoryData)\

                                                                                                   ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:33:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:38:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMin(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:43:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMid(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:48:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMaxUnevenlySpaced(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jdouble minXInclusive, jdouble maxXInclusive, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:60:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:53:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleInClusterMode(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:61:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

MAKE_NATIVE(double, short)

^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:23:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMinMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex,jint viewportWidth, jboolean isCategoryData)\

                                                                                           ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:61:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:28:104: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void JNICALL Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ResampleWithoutReduction(JNIEnv *env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jboolean isCategoryData)\

                                                                                                   ^

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:61:1: error: pasting formed ‘Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_double##’, an invalid preprocessing token

/Users/shiwansung/Downloads/SciChart_Android_v2.5.0.2540_Source/data/src/main/jni/NativePointResamplerFactory.cpp:33:96: note: expanded from macro ‘MAKE_NATIVE’

JNIEXPORT void Java_com_scichart_data_numerics_pointresamplers_NativePointResamplerFactory_##TX####TY##ReducePointsMax(JNIEnv* env, jclass, jobject resampledSeries, j##TX##Array xColumn, j##TY##Array yColumn, jint startIndex, jint endIndex, jint viewportWidth, jboolean isCategoryData)\

0 votes
0 answers
23 views

hello

0 votes
39 views

Hi,
so I want ask about the gradient color does the latest version of scichart support using gradient color in charts for both xamrin.android and Xamarin.ios

0 votes
34 views

Does Sci chart has any framework to support UI Automation in Android/iOS? Also I came across some screenshot based test for verification, Is this available for licensed user to test in Android/iOS?

0 votes
34 views

Hi, if I have multiple graphs stacking on top of one another, is there any way for me to align them by the Y axis on the left?

I noticed that padding is applied to the most outer edge drawn item, so in many cases that would be the label, not the axis.

  • Sen Lin asked 2 weeks ago
  • last active 2 weeks ago
0 votes
43 views

Today is my first day using SciChart and I’m following along with this hello world demo –

https://www.scichart.com/documentation/android/v2.x/webframe.html#Tutorial%2002%20-%20Creating%20a%20Chart.html

For some reason Android Studio won’t recognize ‘SciChartBuilder.init(this)’. Am I missing a file? I can create an instance of SciChartSurface with no problem but the builder line is a no-go. I have imported and referenced the 4 correct .aar files in my gradle.build file so I’m not sure what else I’d be missing. Any help for a newbie would be appreciated!!

  • Cory Giem asked 3 weeks ago
  • last active 2 weeks ago
0 votes
52 views

There is a problem with annotation drag listeners. OnDragEnded and in fact also OnDragStarted are called all the time (just like onDragDelta) instead of only on those particular events

Steps to reproduce
just add a listener to annotation (in my case CustomAnnotation)

.withAnnotationDragListener(object : OnAnnotationDragListener {
            override fun onDragDelta(annotation: IAnnotation, x: Float, y: Float) {
                //whatever
            }

            override fun onDragStarted(p0: IAnnotation?) {
                "onDRAGSTARTED".log()
            }
            override fun onDragEnded(p0: IAnnotation?) {
                "ONDRAGENDED".log()
            }
        })

Is there a solution?

0 votes
92 views

When I yAxis.setVisibleRange(0.d,10.d) then add a series, it triggers AutoRange to resize the graph.

If the VisibleRange is ANYTHING other than 0,10 (even 0,10.001) then it doesn’t resize the graph.

during my search, I found that setting Axis.AutoRange to .NEVER will stop the issue from happening.

https://support.scichart.com/index.php?/Knowledgebase/Article/View/17203/31

I still wanted to post this here because this is a notable bug that others will come across, and I wanted to show what solution I found.

0 votes
119 views

How to set the background, font color and font size of the text label on the map;

Source as this:

PenStyle penStyle = new SolidPenStyle(getColor(R.color.baselineColor), false, 1, new float[]{7, 3, 3});
for (int i = 0; i < baseValues.size(); i++) {
baseLines.add(sciChartBuilder.newHorizontalLineAnnotation()
.withY1(baseValues.get(i))
.withStroke(penStyle)
.withAnnotationLabel()
.withHorizontalGravity(Gravity.FILL_HORIZONTAL)
.build());
}

0 votes
116 views

I want to remove the place occupied by the axis when the axis is invisible. currently when the axis is invisible it hides the axis, but the place occupied by the axis remains there. It should work as android visibility set to Gone.

0 votes
113 views

Has anyone ever encountered this problem?
Could you give me a help? How to solve this problem?
The app didn’t run in the method of ‘getStrokeColors()’, when I debugged.

public class BubbleChartFragment extends ExampleBaseFragment {
    ...

    {
    ...
    FastBubbleRenderableSeries mRSeries = sciChartBuilder.newBubbleSeries()
                    .withDataSeries(dataSeries)
                    .withZScaleFactor(zScaleFactor / 10f)
                    .withBubbleBrushStyle(new SolidBrushStyle(0xffff0000))
                    .withAutoZRange(false)
                    .withStrokeStyle(0xff00ff00, 20f)
                    .withPaletteProvider(new StrokePaletteProvider())
                    .build();
    }

    private class StrokePaletteProvider extends PaletteProviderBase<FastBubbleRenderableSeries> implements IStrokePaletteProvider {
            private final IntegerValues colors = new IntegerValues();
            private final int[] desiredColors = new int[]{0xFF00FF00, 0xFF0000FF};

            protected StrokePaletteProvider() {
                super(FastBubbleRenderableSeries.class);
            }

            @Override
            public void update() {
                final BubbleRenderPassData currentRenderPassData = (BubbleRenderPassData) renderableSeries.getCurrentRenderPassData();

                final int size = currentRenderPassData.pointsCount();
                colors.setSize(size);

                final int[] colorsArray = colors.getItemsArray();
                final int[] indices = currentRenderPassData.indices.getItemsArray();
                for (int i = 0; i < size; i++) {
                    final int index = indices[i];
                    colorsArray[i] = desiredColors[index % 2];
                }

            }

            @Override
            public IntegerValues getStrokeColors() {
                return colors;
            }
        }
    }
  • SiYuan Ou asked 1 month ago
  • last active 1 month ago
1 vote
147 views

How to create the order book depth chart with SciChart?

enter image description here

0 votes
114 views

Can Annotation in editing state set the editing style, or the background of editing state?

0 votes
146 views

Hi,

I’m trying to write an app which dynamically hides/shows (Visible/Gone) scichart surface without losing the data rendering. I’ve been trying to drive this via android visiblity and observable fields (MVVM design). An example of how our surfaces look is as follows:

<com.scichart.charting.visuals.SciChartSurface
android:id=”@+id/temperature_chart”
android:layout_width=”match_parent”
android:layout_height=”0dp”
android:layout_weight=”.99″
android:visibility=”@{graphViewModel.displayChartTemp ? View.VISIBLE : View.GONE}”
android:paddingTop=”@dimen/potrero_gap”
android:paddingBottom=”@dimen/potrero_gap”
scichart:verticalGroup=”@{graphViewModel.sharedVG}”
scichart:renderableSeries=”@{graphViewModel.tempRenderableSeries}”
scichart:xAxes=”@{graphViewModel.xTempAxes}”
scichart:yAxes=”@{graphViewModel.yTempAxes}”/>

and in the view model:

declaration:
var displayChartTemp = ObservableBoolean()

and to set the visibility….
displayChartTemp.set(true)
displayChartTemp.set(false)

I saw that historically, one solution was to
rsiChart.setRenderSurface(null);
rsiChart.setRenderSurface(new RenderSurfaceGL(getActivity()));

but I was wondering if there would be a good way to do this with MVVM architecture, and drive it similarly with observables?

Thanks,
-Andy

0 votes
139 views

Hello there,

I’m trying to implement adding line annotation on touch, but this causes crash.

I’m watching example android app in fragment CreateAnnotationsDynamicallyFragment.

I guess, it should be very easy, but example uses data binding and part of code is hidden somewhere + source code is obfuscated, so it’s hard for me to understand what is wrong.

Can someone give a short example of how to add annotation on touch?

Thanks

Exception:

 Process: process_name, PID: 24978
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Comparable com.scichart.charting.visuals.axes.IAxis.getDataValue(float)' on a null object reference
    at com.scichart.charting.modifiers.AnnotationCreationModifier.a(SourceFile:203)
    at com.scichart.charting.modifiers.AnnotationCreationModifier.onTouchDown(SourceFile:155)
0 votes
120 views

https://www.dropbox.com/s/6f20scl1nyug1t7/chart_3.png?dl=0

Please see the link image. Can we have multiple y axis and one x-axis on android Line charts.. any example link will be useful and ready to purchase if supports these type of charts in Android

  • soujanya asked 2 months ago
  • last active 2 months ago
0 votes
0 answers
159 views

Hi All,

I tried to do android oscilloscope example. But I cannot the line series data. I could see the data xValues, related yValues. and I cannot find any cause. Could you me know what the problem is?

0 votes
179 views

EDIT 3:

I figured out the problem. The reason why I did not see them was two-fold. The annotation view for some reason cannot infere the height of the parent (the chart) so setting match_parent as height doesn’t work and the view doesn’t have height. Second problem was that I have set .withPosition() with Y value as 0, and that would draw the view under the visible area of the chart.

So let me now ask new questions

1 Is there a possibility to move the annotation just by grabbing it, without first selecting it?
2 How can I change the red border when selecting the annotation?
3 How to set the annotation to return X value of it’s position from the center of its view and not from the start of its view
4 How do I restrict movement of the annotation to only X axis?

/// original question
Hello.

I have a problem with annotations. What I need to achieve, is to draw custom view (it’s fairly simple) on my chart, and this view should have always the height of the chart.

I can’t make it work, I am adding the annotation in exact same way as in example android project, and I even copied annotation code from your example project to mine, but for some reason it doesn’t work in my project.

this is the drawable:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="40dp">
<color android:color="@color/secondary_18"/>
</item>
<item android:gravity="center_horizontal" android:width="4dp">
<color android:color="@color/secondary"/>
</item>
</layer-list>

EDIT: There is no < br > in this code ^

what I already tried:
1. Wrapping the drawable into layout consisting of <ImageView> with src= set to drawable
2. Creating a class extending View() class and then setting the imageResource there
3. inflating my layout first and then putting it inside .withContent()
4. using .withContent() directly with R.layout.some_layout_view
5. using it with .withBackgroundDrawableId()
6. various combinations with setting different widths and heights and .withPosition() and whatever you can think of

I managed to display the CustomAnnotation once (don’t remember with which combination of settings) but it wouldn’t move anyway despite the .withIsEditable(true) and despite it was “selected” (red border around it appeared on click)

my axes:

        val xAxis = sciChartBuilder.newNumericAxis()
        .withAxisId(X_AXIS_ID)
        .withDrawMajorBands(false)
        .withDrawMajorGridLines(false)
        .withDrawLabels(false)
        .withIsCenterAxis(true)
        .withDrawMinorTicks(false)
        .withDrawMinorGridLines(false)
        .withDrawMajorTicks(false)
        .build()

    val yAxis = sciChartBuilder.newNumericAxis()
        .withAutoRangeMode(AutoRange.Always)
        .withAxisId(Y_AXIS_ID)
        .withDrawMajorBands(false)
        .withDrawMajorGridLines(false)
        .withDrawMinorGridLines(false)
        .withDrawLabels(false)
        .withIsCenterAxis(true)
        .withDrawMajorTicks(false)
        .withDrawMinorTicks(false)
        .build()

    chartSurface.xAxes.add(xAxis)
    chartSurface.yAxes.add(yAxis)

my series:

 chartSurface.renderableSeriesAreaFillStyle = SolidBrushStyle(chartBackgroundColor)
    chartSurface.renderableSeriesAreaBorderStyle = SolidPenStyle(0x0, false, 0f, null)

    val mountainSeries = sciChartBuilder.newMountainSeries()
        .withDataSeries(dataSeries)
        .withStrokeStyle(SolidPenStyle(-0x1, true, 0f, null))
        .withAreaFillLinearGradientColors(-0x1, -0xed7422)
        .withXAxisId(X_AXIS_ID)
        .withYAxisId(Y_AXIS_ID)
        .build()

    chartSurface.renderableSeries.add(mountainSeries)

my control modifiers:

   val chartModifiers = sciChartBuilder.newModifierGroup()
        .withPinchZoomModifier()
        .withXyDirection(Direction2D.XDirection)
        .withReceiveHandledEvents(true)
        .withScaleFactor(0.8f)
        .build()
        .withZoomPanModifier()
        .withXyDirection(Direction2D.XDirection)
        .withClipModeX(ClipMode.ClipAtExtents)
        .withZoomExtentsY(true)
        .withReceiveHandledEvents(true)
        .build()
        .withZoomExtentsModifier()
        .withReceiveHandledEvents(true)
        .withXyDirection(Direction2D.XyDirection)
        .build()
        .build()

    chartSurface.chartModifiers.add(chartModifiers)

one example of many of how I tried to add the annotations:

        chartSurface.annotations.add(
        sciChartBuilder.newBoxAnnotation()
            .withContent(CustomView(context))
            .withXAxisId(X_AXIS_ID)
            .withYAxisId(Y_AXIS_ID)
            .withIsEditable(true)
            .build()
    )

ofc I also tried the same with CustomAnnotation and like I said with various other settings I could think of like .withPosition() and withResizingGrip. Curious thing is that VerticalLineAnnotation works with no problems really.

EDIT2:

Alternatively I could go with two VerticalLineAnnotations on top of each other moving together but I would have to be able to move them instantly, without selecting them first, because those circular handles look really bad and I have to disable them.

But later on I need to have box annotation working anyway, there will be X values selecting feature

0 votes
172 views

Hello
I have animated line renderable series – when new point added, whole x-axes moves to the right a little.

Everything is smooth until pinch zoom appears.
I think it’s conflict with animated viewport move and zooming.

Is there a way to know, when zooming appears?

E.g. if i know, when zoom started and finished – i can solve this.
Thanks

0 votes
153 views

We are working on line charts in Xamarin forms. We have a requirement to zoom in only one direction at one time. Once the user is done with zooming in one direction (say horizontal) and he reaches that place through scrolling, he should be able to zoom in another direction(vertical). Can you please assist this for the same

  • george asked 2 months ago
  • last active 2 months ago
0 votes
201 views

I am Using ECG Chart In Android. How To Make The ECG Moves Automatically in Horizontal.

0 votes
226 views

Good morning,

I would like to ask you about the solution contained in the title. Is it possible to create realtime charts (for example 7-10) in a list (RecyclerView)? I have studied your example but there were none with a list.

The fragment in the example called createMultiPaneStockChartsFragment contains 4 charts. But unfortunately, it is not a list.
I made a simple activity with 5 charts in a RecyclerView, but charts are stucking a bit.
I do not call notify methods. There is only update LineData method:

oneChartClass.getLineData().append(oneChartClass.getLineData().getCount(), trendPoint.getValue());

Thanking you in advance…
Hubert

0 votes
0 answers
266 views

I have a simple app where the main activity has a FrameLayout that I use to load fragments in to. All fragments all loaded at the same time and I use hide/show to select what fragment to view.

However, when I add a chart to one of the fragments, then it loads fine initially, but if I hide it and then show it again, the app just stops. There isn’t any errors, it just stops responding.

If I remove the graph, everything works fine. Any ideas?

private void addAllFragments()
{
    getSupportFragmentManager().beginTransaction()
            .add(R.id.mainView, mainScreen, "MainScreen")
            .add(R.id.mainView, alarmScreen, "AlarmsScreen")
            .hide(alarmScreen)
            .commit();
}

private void loadFragment(String id)
{
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

    for(Fragment f : getSupportFragmentManager().getFragments())
    {
        if(f.getTag() != id)
        {
            ft.hide(f);
        }
        else
        {
            ft.show(f);
        }
    }

    ft.commit();
}

private void loadMainScreen() {
    loadFragment("MainScreen");
}

private void loadAlarmsScreen() {
    loadFragment("AlarmsScreen");
}
0 votes
342 views

chart screenshot

So I am trying to set paddings on the chart, so that the data series do not touch chart edges

I can’t do it with View’s method setPadding because then the black background is present (screenshot shows padding on all sides but I need just left and right)

Also, I managed to achieve no labels, axes, grids etc. but in totally hacky way; I set .withIsCenterAxis and then all other things to false

 .withAxisId(Y_AXIS_ID)
        .withDrawMajorBands(false)
        .withDrawMajorGridLines(false)
        .withDrawMinorGridLines(false)
        .withDrawLabels(false)
        .withIsCenterAxis(true)
        .withDrawMajorTicks(false)
        .withDrawMinorTicks(false)

Is there a normal way of doing this?

thanks

0 votes
314 views

Hi Everybody,

I use a FastLineRenderableSeries with an XyDataSeries,

when I append data with a negative incrementation of X value,
nothing seems to be drawn

for example:

 Clear();
 for (int i = 0; i < 100; i++)
 {
      Append(100-i, i);
 }
 ZoomExtents();

but this example is working

 Clear();
 for (int i = 0; i < 100; i++)
 {
      Append(i, i);
 }
 ZoomExtents();

Is there a way to get this working? In my application data comes in real time, so I can’t sort them.

Thanks in advance for your help.

0 votes
315 views

Hello everybody.

What is the best way to pass 3 y-values to single x-value?

Currently i’m using XyyDataSeries + XyDataSeries

Don’t know, if it’s best approach?

0 votes
283 views

Hi all,

Why the API’s for iOS, Android and WPF are not identically?
I have seen many samples on the forum, but to adapt it to a different platform is very hard.
A lot of classes are different for each platform.

  • Is there any “comparison” for the different platforms?
  • Is this planned to unify the API’s?

Regards
Urs

  • Urs Geser asked 4 months ago
  • last active 4 months ago
1 vote
371 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 4 months ago
  • last active 4 months ago
0 votes
363 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
427 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
392 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
527 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
427 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
402 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
433 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 5 months ago
  • last active 4 months ago
1 vote
591 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 5 months ago
  • last active 5 months ago
0 votes
405 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 5 months ago
  • last active 5 months ago
1 vote
0 answers
474 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 5 months ago
  • last active 5 months ago
0 votes
426 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
536 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 5 months ago
  • last active 5 months ago
0 votes
625 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
367 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 5 months ago
  • last active 5 months ago
1 vote
441 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
425 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
451 views

Is it possible?

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

0 votes
442 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
415 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
474 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
628 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
478 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.

Showing 1 - 50 of 262 results