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

1 vote
0 answers
7 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

  • Keith Kirk asked 13 hours ago
  • last active 13 hours ago
0 votes
5 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
9 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
11 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 1 day ago
  • last active 13 hours ago
0 votes
25 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
22 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
11 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 2 days ago
  • last active 2 days ago
1 vote
26 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
31 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
20 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
0 answers
18 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
21 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
32 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
42 views

Is it possible?

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

1 vote
50 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
46 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
62 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
50 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
51 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
63 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
60 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
65 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
64 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 3 weeks ago
  • last active 3 weeks ago
0 votes
72 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}"
1 vote
67 views

In the designer I’m seeing this. It doesn’t seem to affect the application; however, I can’t see any of my XAML in the designer because of this problem. Also, I’m having a strange intermittent issue with multiple instances of the chart in my UI not being as smooth and sharp after adding a few charts.

DllNotFoundException: Unable to load DLL ‘sharpdx_direct3d11_1_effects_x86.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

at SciChart.Drawing.DirectX.Context.D3D11.DirectXHelper.LTC.J(Object D, DXErrorEventArgs I)
at SciChart.Drawing.DirectX.Context.D3D11.Direct3D11RenderSurface.RecreateSurface()
at SciChart.Drawing.Common.RenderSurfaceBase.RenderSurfaceSizeChanged(Object sender, SizeChangedEventArgs sizeChangedEventArgs)
at System.Windows.SizeChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.FrameworkElement.OnRenderSizeChanged(SizeChangedInfo sizeInfo)
at System.Windows.ContextLayoutManager.fireSizeChangedEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.UIElement.UpdateLayout()

Here’s the XAML for my chart

        <!-- Chart  -->
    <s:SciChartSurface Grid.Row="1" Grid.Column="1"                                   
                       Name="DoseChart"
                       s3d:DirectXHelper.TryApplyDirectXRenderer="True"
                       s3d:DirectXHelper.FallbackType="{x:Type s:HighQualityRenderSurface}"
                       RenderableSeries="{s:SeriesBinding Measurements}"
                       Annotations="{s:AnnotationsBinding Annotations}"
                       Style="{StaticResource ResourceKey=SurfaceStyle}"                                                      
                       GridLinesPanelStyle="{StaticResource ResourceKey=GridLinesPanelStyle}">


        <!-- Distance Axis-->
        <s:SciChartSurface.XAxis>
            <s:NumericAxis AxisTitle="Distance (cm)"
                           FontFamily="Arial" FontSize="12"
                               FlipCoordinates="False"
                               GrowBy="0.05, 0.05"
                               ScientificNotation="None" 
                               s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
                               s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}"
                               Style="{DynamicResource ResourceKey=DistanceAxisStyle}" />
        </s:SciChartSurface.XAxis>

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

        <!-- Modifiers (zoom, panning, tooltips, cursor) -->
        <s:SciChartSurface.ChartModifier>
            <s:ModifierGroup>
                <s:RubberBandXyZoomModifier IsAnimated="True" IsXAxisOnly="False" />
                <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
                <s:ZoomPanModifier ExecuteOn="MouseRightButton" />
                <s:MouseWheelZoomModifier ActionType="Zoom" XyDirection="XYDirection" />
                <s:XAxisDragModifier DragMode="Scale" />
                <s:YAxisDragModifier DragMode="Scale" />
                <s:TooltipModifier x:Name="ChartTooltip" IsEnabled="True" />
                <s:CursorModifier x:Name="ChartCursor" IsEnabled="False" ShowAxisLabels="True" Foreground="Red" />
            </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>

    </s:SciChartSurface>
0 votes
80 views

Hi I am trying to create a vertical line annotation with MVVM annotationsbinding – this is due to having a chart group with 2 SciChartSurfaces sharing one X axis.

I have added a VerticalLineAnnotationViewModel to my

ObservableCollection Annotations

I would like the user to be able to create a vertical line with two labels, one with the X1 position and the other with some custom text.

I have tried adding an ObservableCollection AnnotationLabels to the VerticalLineAnnotationViewModel during instantiation however they don’t seem to appear.

As an alternative I tried a CustomAnnotation called CustomVerticalLine which inherited CustomAnnotation and then created a CustomVerticalLineViewModel which inherited CustomAnnotationViewModel and then overrode the ViewType to CustomVerticalLine. This displayed the two labels but then I couldn’t bind to the X1 value or the text property.

What am I doing wrongly, could anyone help please?

Thanks

0 votes
0 answers
57 views

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

0 votes
69 views

I want to display a character string on the X axis.

DataSeries can be realized by using XyDataSeries <sting, double> in ViewModel.

What is used for SciChartSurface.XAxis in View?

0 votes
67 views

I have a DateTime X Axis, to which I have added a custom label provider – namely to convert UTC display time to LocalTime.

This works just fine for the AxisLabels, but I also have vertical line annotations and they are NOT using the label provider and are thus showing UTC times.

Is there any way to make the vertical line annotations use the same label provider? Or some way to override the vertical line annotation label function to set the time to local?

Picture Attached.

0 votes
61 views

I want to display the entire chart from ViewModel with MVVM.

I am developing it with MVVM.
In View, if you want to display the whole chart by double clicking the mouse, it can be realized by using ZoomExtentsModifier.

I want to realize the same thing from ViewModel.

How can I do it?

0 votes
64 views

I have several BandRenderableSeriesViewModel in my chart that the user can click on to select. The issue is that they pop up into the foreground when selected and hide everything else that is now behind them. Is there a way to keep them where they are upon selection?

0 votes
58 views

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

0 votes
68 views

I’m trying to add annotations on a chart but they are rendering above my legend.

Initially (similar to most of the demo code I’ve seen), I setup my modifiers, then created my series and animated them in — then added my annotations (adding to annotationGroup). This created a timeline of blank chart surface with legend (good so far), annotations popping in before the chart series animated in (weird / not good) and on TOP of the legend (really bad), then the animation of the series after that.

I’ve tried about everything I can think of and the best I’ve been able to do is use a completion block of the animation rendering the series — and moved my chart modifiers (and legend) into that completion block. If I put the annotations in the completion block, they will render after the chart modifier and I have the same problem (even if placed after the chart modifiers). I have to set the annotations before the animation, and then the chart modifier in the completion block will work and the legend will be above the . Of course, this is a bit odd too — as first my annotations pop up by themselves on the blank surface, followed by my series animating in, then at the end of the 2 second animation, the legend just pops in.

I really would like my legend to be rendered first on the blank surface and the annotations and chart series to animate in together under my legend. I’m gathering that’s unlikely (at least the animation part) — but is there anyway I can place my legend first and still have the annotations go under it? It feels like the layers should be: modifiers > annotations > rendered series. I also I’ve read this order before in some WPF docs I believe, but doesn’t seem to be respected on iOS?

UPDATE: My current work around isn’t sufficient because I really need access to the renderable series to create the annotations which means I really can’t defer my chart modifiers (i.e. legend) until after the annotations. Additionally, if I need to update (remove / re-add) an annotation due to a series being deactivated in the legend, now my annotations are on top of the legend again.

0 votes
65 views

I am placing annotations at the top of every bar in a stacked bar graph (and a standard bar graph on another screen) showing the total of all the stacked bars by iterating through my data, generating the sum, and placing it at the correct x,y (an incredibly manual process that seems like there should be much easier to do but I found no other way to do it – if there is a better way, I would love to hear it, but that’s a secondary issue and not my current problem).

I also have a legend where the user can select / deselect series.

When the user selects/deselects a series from the legend, I need to hide all my annotations and then recreate them because the sums of the stacked bars has changed (or if no bars are showing, remove my annotation completely). My assumption is I could reiterate through my data and check series to see if they are visible (isVisible) and recalculate the sums and recreate the annotations (another very manual process but I can probably work it out).

My primary problem is I see no way for me to intercept that this legend event occurred. The series get hidden internally and I never have a chance to do anything with the annotations. It seems like this may be doable on other platforms but I’m at a loss on iOS. There is no delegate / block event handler / etc.

Any thoughts?

0 votes
73 views

Hi!

I’ve tried to access the values to print them in a different view, but I cant reach them. So my question is there a specific way to reach them?

0 votes
0 answers
87 views

I have a simple chart using a an SCIDateTimeAxis to display dates along the x-axis. In some situations, the labels displayed along this x-axis are way too close together. Please see attached screenshot. I was wondering whether there is a property somewhere I can configure to increase the required “culling” space between labels? Or, failing that, what would I need to implement myself to somehow drop some of the displayed labels in order to make them more readable?

0 votes
89 views

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

Here is my code:

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

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

Help please!

0 votes
95 views

Hello everyone.

I have 2 stacked horizontally charts with

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

so they drag and zoom in same way.

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

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

Edit:

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



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

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

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

Thank you,
Wavely

0 votes
76 views

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

1 vote
92 views

I’m trying to update to the latest nuget package and getting

Severity Code Description Project File Line Suppression State
Error Failed to fetch results from V2 feed at ‘https://nuget.telerik.com/nuget/Packages(Id=’SciChart’,Version=’5.2.2.11833′)’ with following message : Response status code does not indicate success: 401 (Logon failed.).
Response status code does not indicate success: 401 (Logon failed.).

I haven’t changed anything that I’m aware of. Ideas?

0 votes
78 views

Hi,

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

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

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

0 votes
84 views

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

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

0 votes
98 views
      <s:SciChartSurface.Annotations>
            <s:BoxAnnotation X1="25" X2="75" Y1="0" Y2="100" Background="#33FFFFFF" 
                BorderBrush="#55FFFFFF" BorderThickness="3" Padding="5">

                <s:BoxAnnotation.Template>

                    <ControlTemplate TargetType="s:BoxAnnotation">


                        <Border x:Name="PART_BoxAnnotationRoot" 
           Margin="{TemplateBinding Margin}"
           Background="{TemplateBinding Background}"
           BorderBrush="{TemplateBinding BorderBrush}"
           BorderThickness="{TemplateBinding BorderThickness}"
           CornerRadius="{TemplateBinding CornerRadius}">
                            <Viewbox Margin="{TemplateBinding Padding}" >
                                <TextBlock Text="Hello CustomAnnotation World!"></TextBlock>

                            </Viewbox>
                        </Border>

                    </ControlTemplate>
                </s:BoxAnnotation.Template>
            </s:BoxAnnotation>
        </s:SciChartSurface.Annotations>

by below tag or a code?

  • bar asked 4 weeks ago
  • last active 4 weeks ago
1 vote
90 views

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

1 vote
96 views

Hello everyone.

I have chart with adding data every second.

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

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

My setup:

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

                long addTime = 30_000 * currentTimeframe;

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

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

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

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

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

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

Hello everyone.

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

Once i have below crash:

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

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

0 votes
110 views

I want to put one vertical line to chart, when mouse left button click inside the chart.
And, I want to put vertical line where nearest plotted X value to mouse cursor location in the chart.
No interpolation.

  • Also, I’m using RubberBandXyZoomModifier ExecuteOn=”MouseLeftButton”
    and

  • ZoomPanModifier ExecuteOn=”MouseRigthButton”

What is the best Modifier to use?
And how can it set like that?

0 votes
0 answers
77 views

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

1 vote
89 views

enter image description here

we want z axis up but when we draw Y axis come up hot to solve this

        short[] shortArrayz;
        int lengthz;
        short[,] shortArray = new short[100, 15];
        using (BinaryReader b = new BinaryReader(
                    File.Open("F971-181223-10.MNZ", FileMode.Open)))
        {
            // 2.
            // Position and length variables.
            int pos = 0;
            // 2A.
            // Use BaseStream.

            //    pos += sizeof(int);
            //  pos += sizeof(int);
            lengthz = (int)b.BaseStream.Length;
            shortArrayz = new short[lengthz];


            //    Console.WriteLine(length);
            while (pos < lengthz)
            {
                // 3.
                // Read integer.

                /*

                for (int i = 0; i < 100; i++)
                {
                    for (int j = 0; j < 15; j++)
                    {

                        shortArray[i, j] = b.ReadInt16();
                        Console.WriteLine(shortArray[i, j]);
                    }
                }
                */

                shortArrayz[pos] = b.ReadInt16();


                // 4.
                // Advance our position variable.
                pos += sizeof(short);
            }
        }


        //100x15 lik dosya için        
        int xSize = 15;
        int ySize = 100;


        var meshDataSeries = new UniformGridDataSeries3D<double>(xSize, ySize)
        {
            SeriesName = "Uniform Surface Mesh",
        };




        int h = 0;

        for (int x = 0; x <xSize; x++)
            for (int y = 0; y < ySize; y++)
        {             
            {
                double z =(double) shortArrayz[h];
            meshDataSeries[y, x] = z;

                h += sizeof(short);               
            }
        }


        // Assign the DataSeries to the char
        surfaceMeshRenderableSeries.DataSeries =meshDataSeries;

2) In contour graph values is coorect but seems like it is sliced how to solve this?

Codes are attached

  • bar asked 1 month ago
  • last active 1 month ago
Showing 1 - 50 of 2k results