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

0 votes
8 views

Is it possible to remove the number on the bottom left of the chart seen in he attachment?

0 votes
0 answers
16 views

I’m rebuilding a program to adhere to MVVM and so I’m trying to figure out little tricks to do things I did previously in the code-behind.

I’d like to be able to right-click on a selected series and add a point at that location. I’m doing this in my previous application but I’m not too sure the best route to take with the MVVM application.

I’m currently selecting a series with the SeriesSelectionModifier, but I’m also not sure if there’s a “SelectedSeries” property I can get from the modifier either.

Maybe a Trigger that detects a right mouse click on a selected series that calls a command to add the point?

Or is there just not a way to do this with the chart and I need to rely on subscribing to events?

Thanks!

Update: Figured it out.

  • Greg Knox asked 3 days ago
  • last active 3 days ago
0 votes
19 views

Is it possible to get a legend for each z-axis line with a waterfall 3d graph. And show/hide each line via the legends?

1 vote
29 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 days ago
  • last active 4 days ago
0 votes
26 views

I’ve been using this chart for a few months now and yesterday ran into a problem with the Y-axis. I’m sure this is nothing more than my lack of understanding on multiple axes.

I have a need to add a 2nd Y axis and I’m not doing something right. My application is using MVVM to bind series to my chart. So far I have been adding data to my chart using the methods described here…

https://www.scichart.com/documentation/v5.x/webframe.html#Tutorial%2003b%20-%20Adding%20Series%20to%20a%20Chart%20with%20MVVM.html

I’ve read the documentation for adding data on multiple axes and have run into a wall. I have cases where I will need to have data only on one axis and other times when I will have data on both. For now I’m just setting up my 2 series in the XAML but not adding data to the 2nd Y axis yet. When I do this my series doesn’t show on the chart anymore.

Here is what I had when it worked…

            <s:SciChartSurface.YAxes>

            <!-- Dose Axis -->
            <s:NumericAxis AxisTitle="Dose (%)" AutoRange="{Binding Path=YAutoRange}"
                           AxisAlignment="Left"
                           FontFamily="Arial"
                           GrowBy="0.05, 0.05" 
                           Style="{DynamicResource ResourceKey=DoseAxisStyle}"
                           s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
                           s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}" />


        </s:SciChartSurface.YAxes>

And here is what I have now…

            <s:SciChartSurface.YAxes>

            <!-- Dose Axis -->
            <s:NumericAxis AxisTitle="Dose (%)" AutoRange="{Binding Path=YAutoRange}"
                           AxisAlignment="Left"
                           FontFamily="Arial"
                           GrowBy="0.05, 0.05" 
                           Style="{DynamicResource ResourceKey=DoseAxisStyle}"
                           s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
                           s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}" />

            <!-- 2nd Y Axis -->
            <s:NumericAxis AxisTitle="{Binding Path=RightAxisTitle}" 
                           Id="YAxis2"
                           AxisAlignment="Right"
                           Visibility="{Binding Path=RightAxisVisibility}"
                           AutoRange="{Binding Path=YAutoRange}"
                           FontFamily="Arial"
                           GrowBy="0.05, 0.05" 
                           Style="{DynamicResource ResourceKey=DoseAxisStyle}"
                           s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
                           s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}" />

        </s:SciChartSurface.YAxes>

My model includes code such as…

        // data context for the series(s) on the chart
        public ObservableCollection<IRenderableSeriesViewModel> Measurements
        {
            get { return _measurements; }
            set { SetProperty(ref _measurements, value); }
        }

        private void AddMeasurementSync(MeasurementViewModel measurement, bool clear = false)
        {
        if (clear)
            // clear the profiles, we're only showing one at a time.
            Measurements.Clear();

        // add profile points to the data series
        var xyProfile = new XyDataSeries<double, double>();
        var xyLeft = new XyDataSeries<double, double>();
        var xyRight = new XyDataSeries<double, double>();

        xyProfile.AcceptsUnsortedData = true;
        xyLeft.AcceptsUnsortedData = true;
        xyRight.AcceptsUnsortedData = true;

        // loop the measurement points and fill the series
        foreach (MeasurementPointViewModel point in measurement.Points)
        {
            if (null != point)
                // add the point to the series and add IPointMetaData
                // which says whether or not we are in the penumbra
                xyProfile.Append(
                    point.Distance,
                    point.Dose);
        }

        // create series for profile          
        LineRenderableSeriesViewModel series = new LineRenderableSeriesViewModel()
        {
            StrokeThickness = 2,
            Stroke = measurement.MeasurementColor,
            AntiAliasing = true,
            DataSeries = xyProfile,
        };

        // should be showing points?
        if (ShowPoints)
        {
            series.PointMarker = new EllipsePointMarker()
            {
                Stroke = Colors.Black,
                Fill = Colors.White,
                Width = 6,
                Height = 6,
            };
        }

        // bind to the collection
        Measurements.Add(series);
    }
0 votes
20 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
0 answers
17 views

I want to visualize Contour in my application and set the Contour Interval.
But the visualization is not as the expected value.
From your Example application: 3D Charts > Create A Surface Mesh Chart > Surface Mesh 3D With Contours. (Screenshot in attachment)
I have set the Contour Interval property slider to the maximum value (30).
But the result is less than 20, about 10.

How to make the Interval 30, and the visualization is really 30?
Are there any interval scaling property?

0 votes
22 views

I’m trying to create a Modifier for a PieChart Surface. I can not figure out how to get a segment for a point on the screen. With SciChartSurface, you can get the axis, and use its calculator to get a datapoint, or pixel point. Is there something similar in SciPieChartSurface?

0 votes
42 views

Hello. I have a chart with multiple YAxes. One of the YAxis, for example, has an initial range of -10 to 10. I’d like to be able to put my cursor over that axis, scroll the wheel, and have that range increase or decrease depending on which way the user scrolls.

Is there an ability to do that within SciChart’s standard feature, or will something custom need to be written?

  • Greg Knox asked 1 week ago
  • last active 6 days ago
0 votes
84 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
53 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
53 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
57 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
52 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
0 answers
51 views

I’d like to rotate after I finish drawing the chart. So I rotated the chart in the following way. (0, 90, 180, 270 Degrees)

SciChart.LayoutTransform = new System.Windows.Media.RotateTransform(0, 0.5f, 0.5f);
SciChart.LayoutTransform = new System.Windows.Media.RotateTransform(90, 0.5f, 0.5f);
SciChart.LayoutTransform = new System.Windows.Media.RotateTransform(180, 0.5f, 0.5f);
SciChart.LayoutTransform = new System.Windows.Media.RotateTransform(270, 0.5f, 0.5f);

And then “TooltipModifier” was also rotated.
But I don’t want to rotate “TooltipModifier.”
When drawing a chart, use “CustomRenderSeries” to rotate using “AxisAlignment” to break the appearance of the chart.

How can you rotate the chart without rotating the “TooltipModifier”?

0 votes
60 views

Hello,
We would like to have a axis behavior similar to Mathlab. The idea is that for the x axis a common exponent is written only once on the right and for the y axis the common exponent is written once on the top of the chart.
Is this possible ?
How can we implement it ?

Thank you !

See figure attached

0 votes
85 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
73 views

I have high sampling data.

Data’s diff is 1 ~ 5 tick.

If data append on chart, do not display at each tick.

I want to append 1 tick diff data, and right display.

How to do set chart property or what should I do?

1 vote
69 views

In Android we are using initPlacementStrategy with HorizontalLineAnnotations to hide the axis label of annotation when the annotation is scrolled out of the view. So what is the equivalent way in iOS

1 vote
64 views

Hi,

is there any way I can set in the XAML that the walls of the axis cube will be visible independent of how the cube is rotated? I’m rendering a drilling hole in 3D space and want to the ground plane(the top wall) and the two back planes to always be visible even if the user rotates the cube so they are infront of the rendered line. Is that possible?

Kind regards,
Karl-Petter

0 votes
63 views

I’m trying to accomplish 2 things:

First is that I would like to not be able to zoom out past the data, it does no good to zoom out if there is no more data to see. It would also be nice to have a little bounce/spring back if you zoom to far, like when zooming out on an image on an iPhone.

The second is that I only want to be able to pan to the data. If zoomed all the way out, then trying to pan would do nothing. If zoomed in you should be able to scroll around, but only to the end of the data.

I believe I have the first one accomplished by setting the maximalZoomContrain to be the same as the data range, although this doesn’t allow any kind of bounce.

What need to be done to make this work, this seems like a feature that is built into the SciChart Modifiers.

0 votes
68 views

Hi.

I need to know the position of mouse click in axes coordinates. I’ve created a modifier for this:

public class CustomPointSelectionModifier : SeriesSelectionModifier
{
    public override void OnModifierMouseUp(ModifierMouseArgs e)
    {
        base.OnModifierMouseUp(e);
        var xcalc = ParentSurface.XAxes.First().GetCurrentCoordinateCalculator();
        var ycalc = ParentSurface.YAxes.First().GetCurrentCoordinateCalculator();
        var poistionPoint = Mouse.GetPosition((IInputElement)ParentSurface);

        var point = new Point()
        {
            X = xcalc.GetDataValue(poistionPoint.X),
            Y = ycalc.GetDataValue(poistionPoint.Y),
        };
        ((SciChartMvvmBindingsViewModel)DataContext).OnMouseUp(e, point);
    }
}

And it works well if axes width is zero. Otherwise, it provides values shifted by axes width (or height for Y-axis)
In my example, it should add an arrow annotation in a click point. Instead of this, it adds an arrow with shifted coordinates.

What am I doing wrong?
Thanks

1 vote
0 answers
85 views

I wan to have a view that is outside of the chart that is updated whenever the chart modifier selection is changed. Is there a way to get notified when the selection changes?

Also, is it possible to get rid of the data views. I guess I could just add a custom view to the rollover modifier that is empty?

What I want to achieve is that when the user is using the rollover modifier to view datapoint the values for that datapoint is shown above the chart. It should also be possible to drill down by clicking on this information.

1 vote
85 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 3 weeks ago
  • last active 3 weeks ago
0 votes
90 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 3 weeks ago
  • last active 3 weeks ago
1 vote
0 answers
96 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 3 weeks ago
0 votes
68 views

I’m using Vertical Slice Modifier but, I don’t want to show Tooltip where series intersects.

How can I hide it?

0 votes
75 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
76 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
85 views

I am showing a dialog window with a ChartSurface in it. I have a context menu option to export to an image, and on window load I export to an XPS file. The dialog works fine if I do not use either feature, but once I do, I intermittently get an exception when showing the dialog. It appears to regularly take 3 instances of the dialog after the export feature is used to throw the exception, and the exception gets thrown twice the first time, threes times the second time, and so on. Again, if I do not use the export feature (no call to ExportToFile), I do not get any exceptions no matter how many times I show the dialog.

The exception message is “The provided DependencyObject is not a context for this Freezable. Parameter name: context”.

There are no other useful details in the exception from what I can see. Its all pretty abstract WPF stuff. The exported file/image seem to be generated accurately regardless of the exception.

I am using SciChart 4.2.2.9724, Visual Studio 2017 Professional, C#, WPF

Any ideas?

0 votes
95 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
70 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
85 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
111 views

I have a ItemsControl which shows line charts in a vertical uniform grid. Currently they all share the same Annotations collection. The thing I am looking for is if there is a way to control which graph the annotation will show up on. Currently if I add a Text annotation to the collection it shows up on all of the graphs. But it works fine when added a vertical line annotation where I want it to show up on all graphs. I also have the need for a vertical line annotation to show up on only one graph though. If there is not a way to control this what would be the best solution for this?

Thank You

Todd

0 votes
76 views

Hello, dear SciChart!
I try to build one technical indicator (ZigZag) over the market candles.

For candles I use OhlcDataSeries<DateTime, double>;
For indicator I use XyDataSeries<DateTime, double>;

All is good untill I zoom in – my tech indicator disappears. I see, that it happends only when inside the visible range on x-axis remains only 1 point.

All I want is to know, how to always keep zigzag line visible (see my pic #2, please).
For more details, please, see my pictures.

Thanks a lot!

My code to init tech indicator serie:

var cw_zz0 = new XyDataSeries<DateTime, double>() { SeriesName = string.Format("zz") };
        surface.RenderableSeries.Add(new FastLineRenderableSeries()
        {
            Stroke = Colors.Red,
            StrokeThickness = 1,
            DataSeries = cw_zz0,
            IsSelected = true,
            IsVisible = true,
            DrawNaNAs = LineDrawMode.ClosedLines,
            YAxisId = surface.YAxes.First().Id,
            RolloverMarkerTemplate = surface.TryFindResource("MarkerTemplate") as ControlTemplate,
        });

enter image description here
enter image description here

0 votes
87 views

I want to modify SCICursorModifier in such a way that while user is doing pan gesture in x direction the line should always be in the centre of candlestick. How can i achieve this. For example there are 3 candlestick visible while panning from 0th x co-ordinate vertical line should be in the centre of first candlestick on more panning it will go to the centre of 2nd candlestick like rollover modifier

0 votes
85 views

I was able to add multiple y axis and able to fill data on different y axis but the problem is all the y axis are overlapping. What I want is how can I segregate y axes in such a way that they should appear one below the other in the same surface. I tried adding two different surface but then I am not able to add single cursorModifier to both surface. Our android developers had used something called YAxisStackedLayoutStrategy to achieeeve this is there any equivalent class for iOS

0 votes
97 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
115 views

Is it possible?

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

1 vote
117 views

I’m sorry I couldn’t attach images because of security.

Zoom out
VisibleRange X1 min VisibleRange X1 max
    +——————————–+ VisibleRange Y1 min
    |           |
    |           |
    |s=================e|
    |           |
    |           |
    +——————————–+ VisibleRange Y1 max

s : Point Start, e : Point End

In this state, Excute Zoom In Then “s====================e” disappears when the starting point is smaller than min and the end point is greater than max.

Zoom In : “s====================e” disappear
VisibleRange X2 min VisibleRange X2 max
    +——————————–+ VisibleRange Y2 min
    |           |
    |           |
    |           |
    |           |
    |           |
    +——————————–+ VisibleRange Y2 max

I want this chart
VisibleRange X1 min VisibleRange X1 max
    +——————————–+ VisibleRange Y2 min
    |           |
    |           |
    |===================|
    |           |
    |           |
    +——————————–+ VisibleRange Y2 max

How do I draw when a chart is not drawn at the location of a given data using “CustomRenderSeries”?
“====” is a BOX(Rectangle), not a line.

The program source used for coding.
I am currently using
renderableSeries.ResamplingMode = ResamplingMode.None;

// DataInsert.cs

var renderableSeries = new DieRenderableSeries(positionOfDie, _dieLayout);

foreach (var pl in _dieLayout.PlaneLayout._plane)
{
  Plane plane = pl.Value;
  foreach (var ba in plane._bank)
  {
    Bank bank = ba.Value;

    foreach (var matList in bank.NandMat)
    {
      var renderableSeries = new DieRenderableSeries(positionOfDie, _dieLayout);
      List<KeyValuePair<Point, Mat>> matDataList = new List<KeyValuePair<Point, Mat>>();

      foreach (var mat in matList)
      {
        mat.PointType = PointType.Start;
        matDataList.Add(new KeyValuePair<Point, Mat>(new Point(startX + mat.X1, startY + mat.Y1), mat));
      }

      var myList = matDataList.OrderBy(x => x.Key.X)
              .ThenBy(x => x.Key.Y)
               .ToList();

      var dataSeries = new MatDataSeries<double, double> { SeriesName = “Fault” };
      dataSeries.AcceptsUnsortedData = false;
      using (dataSeries.SuspendUpdates())
      {
        for (var i = 0; i < myList.Count(); i++)
        {
          Point myPoint = myList[i].Key;
          dataSeries.Append(myPoint.X, myPoint.Y, myList[i].Value);
        }
      }

      sciChart.RenderableSeries.Add(renderableSeries);
      renderableSeries.DieX = dieX;
      renderableSeries.DieY = dieY;
      renderableSeries.DataSeries = dataSeries;
      renderableSeries.CountOfRenderableSeries = dataSeries.Count;
      renderableSeries.ResamplingMode = ResamplingMode.None;
    }
  }
}

// CustomRenderableSeries.cs

for (var i = 0; i < _series.Count; i++)
{
  var data = renderPassData.PointSeries[i];
  var mat = (Mat)DataSeries.Metadata[data.Index];

  Point point = GetCoordinatesFor(data.X, data.Y);
  Point point2 = GetCoordinatesFor(data.X + mat.Width, data.Y + mat.Height);

  IBrush2D brush = _dicBrush[mat.TypeX];
  var pen = _bgndPens[mat.IsRedun && IsRedunVisibled ? 1 : 0];

  drawingHelper.DrawBox(point, point2, brush, pen, 0);
}

0 votes
106 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).

0 votes
148 views

Hello SciChart team,

How do I serialize custom tick placement and labels, generated by TickProviderAPI and LabelProvider? Actually, the main problem is that I need to export high quality (i.e. higher than actual figure size on screen) PNG images in MVVM application and method ExportToFile(fileName, ExportType.Png, false, new Size(…, …)) produces axis ticks and labels as if they were controled by original MinorDelta and MajorDelta parameters. ExportToFile() without size parameter produces output correctly, so that must be due to not-serialized TickProvider and LabeProvider properties (?), which in exported serialized surface string does not exist.

Thank you!

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
136 views

I am doing SciChart development with MVVM.
I generate RenderableSeries with ViewModel, View uses Bind it and uses it.

TooltipModifier is used for tooltip display.
In this application, I want to customize and display the tooltip.

To customize using the TooltipTemplate of TooltipModifier,
It was described in the following URL.
In this method, TooltipModifier.TooltipTemplate is described in XAML in View resource.
Therefore, it is not possible to specify TooltipModifier.TooltipTemplate from ViewModel.

If you generate RenderableSeries with ViewModel,
How should I specify the TooltipTemplate?

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
140 views

Hi, I want to know buffer structure of 2d fastline.

I use very huge data per line.(maybe about 30,000 points/1 sec are appended to a line.)

But Memory usage is different than expected.

I use fifocapacity, and It is realtime graph.

Appending data, the memory usage increases too much.

Especially, It use more memory when drawing more lines.

For example,
Assuming one line uses 100mb, the five lines use 5000mb not 500mb.

Is it right??

  • CholJin Ko asked 2 months ago
  • last active 3 days ago
0 votes
130 views

I was curious, and had mentioned this in another thread, but verified what I thought. My first SciChart instance is drawing in DirectX and subsequent charts are not. Please see attached. Each chart is being created and placed inside a tabitem.

I used the suggested annotation to show the version being used (from the support forum) and found why my images are not as crisp in most of my charts.

s3d:DirectXHelper.TryApplyDirectXRenderer="True"
s3d:DirectXHelper.FallbackType="{x:Type s:HighQualityRenderSurface}"
Showing 1 - 50 of 2k results