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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

0 votes
10 views

Hey There.

I am new to sciChart and i am in ahurry to develop a realtime ECG App which takes data from Bluetooth. Ignore the harware part. Can anyone kindly prove me source code of realtime ecg monitoring or realtime linechart.

Thanx in advance

0 votes
0 answers
9 views

Is there any way to change the y axis values according to the unit?

For example,

I am plotting the resistance value in Y axis, initially the values were in ohm and suddenly it changes to mega ohm since it is a live graph, then the values which we were shown in ohm should be converted to mega ohm and display in the graph.

Is there is any options available in Scichart in this scenario?

0 votes
0 answers
16 views

Hello,

ColumnChart: Autorange is not working if XyDataSeries contains 1 or 2 items.

The SDK example -> 2D Charts -> Column Chart with little modifications (the complete code is attached):

    private void OnClick(object sender, RoutedEventArgs e)
    {
        using (this.sciChart.SuspendUpdates())
        {
            for (int i = 0; i < ARRAY_SIZE; i++)
            {
                var val = _rnd.Next(-100, 100);
                Debug.WriteLine(val);
                _dataSeries.Update(i, val);
            }
        }
        sciChart.ZoomExtents();
    }

If ARRAY_SIZE is 1; any value; after “click me” button pressed (may be needed to press few times to catch this)
enter image description here

If ARRAY_SIZE is 2; the values are [27, 55]

enter image description here

If ARRAY_SIZE is 3 or more – columns are displayed OK for any values.

If I use

AutoRange="Never" VisibleRange="-100, 100"

this example works OK.

Question: please let me know how to make the ColumnChart working properly for one or two columns and AutoRange=”Always”

Thanks!

-Egor

0 votes
0 answers
21 views

Hi All,
I’m using the RubberBandXyZoomModifier and DataPointSelectionModifier together from the left mouse button; enabling and disabling them based on the left CTRL key being pressed (CTRL key down = select).

I’m seeing what I assume to be a focus issue on first mousing over off the chart area in that the chart area doesn’t attract focus, and thus recognise the ctrl key press, until there’s been a mouse button click. I’ve created an app to demonstrate and attached the XAML and code behind for it.

To see the behaviour, run the code and press the “does nothing” button to set focus to it. Mouse over the chart and press the CTRL key – the key press is not recognised. Click the left mouse button and the key press is now recognised. So far so good.
Now if you repeat the process but click and drag – the logic is caught between the two modifiers being enabled/disabled and the zoom selection is shown even though the CTRL key is down. There are other issues e.g. CTRL down and drag outside the chart can leave the selection modifier drag area marked on the chart while the zoom mode is in operation

I was thinking of something like setting focus or forcing a mouse click in response to the mouse over event but so far my attempts have failed – probably from doing the wrong thing in the wrong place – so, as usual, any and all suggestions are most welcome!

/Stuart

0 votes
27 views

Hii !!

I have extracted the ECG Sample Code from your source project and i want to update the same RealTime via Bluetooth. I am getting a nullpoint exception.
Below is my source code too along with exception.

Exception

06-18 15:44:02.708 15813-15813/com.advancetechindia.wirelessecg
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.advancetechindia.wirelessecg, PID: 15813
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.advancetechindia.wirelessecg/com.advancetechindia.wirelessecg.MainActivity}:
java.lang.NullPointerException: Attempt to invoke virtual method
‘com.scichart.extensions.builders.DataSeriesBuilder$XyDataSeriesBuilder
com.scichart.extensions.builders.SciChartBuilder.newXyDataSeries(java.lang.Class,
java.lang.Class)’ on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2561)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method
‘com.scichart.extensions.builders.DataSeriesBuilder$XyDataSeriesBuilder
com.scichart.extensions.builders.SciChartBuilder.newXyDataSeries(java.lang.Class,
java.lang.Class)’ on a null object reference
at com.advancetechindia.wirelessecg.MainActivity.(MainActivity.java:394)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1100)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2551)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6123) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)

Source Code

settingChart() is Called in onCreate() of Activity

//SciChart Work

protected final SciChartBuilder sciChartBuilder =
SciChartBuilder.instance();
private final static long TIME_INTERVAL = 20;

private final IXyDataSeries<Double, Double> series0 = sciChartBuilder.newXyDataSeries(Double.class,
Double.class).withFifoCapacity(3850).build();
private final IXyDataSeries<Double, Double> series1 = sciChartBuilder.newXyDataSeries(Double.class,
Double.class).withFifoCapacity(3850).build();

private ArrayList<Double> sourceData;
  
  private int _currentIndex;
  private int _totalIndex;
  
  private MainActivity.TraceAOrB whichTrace = MainActivity.TraceAOrB.TraceA;
  
  private final ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
  private ScheduledFuture<?> schedule;
  
  private volatile boolean isRunning = true;
  SciChartSurface surface;
  private void settingSciChart() {
      sourceData=new ArrayList<>();
      surface=(SciChartSurface)findViewById(R.id.ecg);
  
      initExample();
  }
  
  private void initExample() {
      UpdateSuspender.using(surface, new Runnable() {
          @Override
          public void run() {
              final IAxis xBottomAxis = sciChartBuilder.newNumericAxis()
                      .withVisibleRange(new DoubleRange(0d, 10d))
                      .withAutoRangeMode(AutoRange.Never)
                      .withAxisTitle("Time (seconds)")
                      .build();
  
              final IAxis yRightAxis = sciChartBuilder.newNumericAxis()
                      .withVisibleRange(new DoubleRange(-0.5d, 1.5d))
                      .withAxisTitle("Voltage (mV)")
                      .build();
  
              final IRenderableSeries rs1 = sciChartBuilder.newLineSeries()
                      .withDataSeries(series0)
                      .build();
  
              final IRenderableSeries rs2 = sciChartBuilder.newLineSeries()
                      .withDataSeries(series1)
                      .build();
  
              Collections.addAll(surface.getXAxes(), xBottomAxis);
              Collections.addAll(surface.getYAxes(), yRightAxis);
              Collections.addAll(surface.getRenderableSeries(), rs1, rs2);
          }
      });
  
      schedule = scheduledExecutorService.scheduleWithFixedDelay(new Runnable() {
          @Override
          public void run() {
              UpdateSuspender.using(surface, appendDataRunnable);
          }
      }, 0, TIME_INTERVAL, TimeUnit.MILLISECONDS);
  }
  
  private final Runnable appendDataRunnable = new Runnable() {
      @Override
      public synchronized void run() {
          if (isRunning) {
              for (int i = 0; i < 10; i++) {
                  appendPoint(400);
              }
          }
      }
  };
  
  private synchronized void appendPoint(double sampleRate) {
      if (_currentIndex >= sourceData.size()) {
          _currentIndex = 0;
      }
  
      // Get the next voltage and time, and append to the chart
      double voltage = sourceData.get(_currentIndex);
      double time = (_totalIndex / sampleRate) % 10;
  
      if (whichTrace == MainActivity.TraceAOrB.TraceA) {
          series0.append(time, voltage);
          series1.append(time, Double.NaN);
      } else {
          series0.append(time, Double.NaN);
          series1.append(time, voltage);
      }
  
      _currentIndex++;
      _totalIndex++;
  
      if (_totalIndex % 4000 == 0) {
          whichTrace = whichTrace == MainActivity.TraceAOrB.TraceA ? MainActivity.TraceAOrB.TraceB : MainActivity.TraceAOrB.TraceA;
      }
  }
  
  enum TraceAOrB {
      TraceA,
      TraceB
  }
  
0 votes
24 views

I would like to dynamically add and remove columns from a ColumnRenderableSeriesViewModel in code behind.

I am using MVVM and the SeriesBinding. I assigned a XyDataSeries<double, double> to the ColumnRenderableSeriesViewModel .DataSeries.

The chart initially draws all the bars for each item in the XYDataSeries, but If I append or remove one of them, the chart does not update and show the new bar or remove the old bar.

Here is my XAML:

        <s:SciChartSurface RenderableSeries="{s:SeriesBinding RenderableSeries}">
            <s:SciChartSurface.XAxis>
                <s:NumericAxis />
            </s:SciChartSurface.XAxis>

            <s:SciChartSurface.YAxis>
                <s:NumericAxis />
            </s:SciChartSurface.YAxis>
        </s:SciChartSurface>

And some of my view model:

using SciChart.Charting.Model.ChartSeries;
using SciChart.Charting.Model.DataSeries;
using System.Collections.ObjectModel;

namespace ChartExample {
    public class ChartViewModel {
        ColumnRenderableSeriesViewModel _seriesViewModel = new ColumnRenderableSeriesViewModel();
        XyDataSeries<double, double> _dataSeries = new XyDataSeries<double, double>();

        public ChartViewModel() {
            RenderableSeries.Add(_seriesViewModel);
            _seriesViewModel.DataSeries = _dataSeries;
        }


        public ObservableCollection<IRenderableSeriesViewModel> RenderableSeries { get; } = new ObservableCollection<IRenderableSeriesViewModel>();


        public void AddSeries() {
            _dataSeries.Append(_dataSeries.Count, _dataSeries.Count);
        }


        public void RemoveSeries(int seriesIndex) {
            _dataSeries.RemoveAt(seriesIndex);
        }
    }
}

Can you please tell me what I might be doing wrong?

  • Doug Witt asked 6 days ago
  • last active 1 day ago
0 votes
0 answers
21 views

Hello,

I’m working at displaying a map using FastNonUniformHeatmapRenderableSeries. I want to make it looks blurry, so there will be smooth transition between inner edges.

How can I do it?

Thanks in advance

0 votes
32 views

Hello,

question about FastColumnRenderableSeries:
assuming the UseUniformWidth is set to True (all columns are same width) and Series already displayed: how I could get the actual width for one (any) column from code?

I.e. I do not want to use GetColumnWidth(IPointSeries points, IRenderPassData renderPassData) to computes the width of the columns to be drawn.

Just need to get the actual width for column already drawn.
From code.

Thanks!

-Egor

1 vote
31 views

Hello,

one more question please;
Please see the pict below (same SDK example: 2D charts-> Column Chart)

[enter image description here

Just added the Legend and Rollover:

            <s:SciChartSurface.ChartModifier>
            <s:ModifierGroup>
                <s:ModifierGroup>
                    <s:LegendModifier x:Name="LegendModifier" 
                                      ShowVisibilityCheckboxes="False" 
                                      ShowLegend="True" 
                                      Orientation="Vertical" Margin="10"
                                      HorizontalAlignment="Right" 
                                      ShowSeriesMarkers="True"  />
                    <s:RolloverModifier x:Name="RolloverModifier" 
                                        ExecuteOn="MouseMove" 
                                        ShowTooltipOn="MouseHover" 
                                        IsEnabled="True" />
                </s:ModifierGroup>
            </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>

I’d like to keep Series Name in one place – on Legend and remove it from Rollover tooltip text.
I.e. tooltip shall be “13.7” in this case.

I found how to format the Legend (LegendModifier.LegendItemTemplate SciChart WPF v5 SDK User Manual)
But didn’t find the similar way for Tooltip.

Could you please let me know how to achieve this?

Thanks!

-Egor

-1 votes
32 views

When the axisX.VisibleRange.Max is 5000 and the axisX.VisibleRange.Min is 4600, now I execute these program statements:
double max = Convert.ToDouble(axisX.VisibleRange.Max);
axisX.VisibleRange.SetMinMax(max-5000, max);
The vertical grid line become like the figure 2.png. How can I solve it?

0 votes
31 views

1) About VerticalLineAnnotation, when I move the vertical line, which event I can use to get real time data?
2) Do the chart lib have the full method to calculate the Fast Fourier Transformation?

0 votes
29 views
  1. How can I make the gap always the same between the two verticalLineAnnotations? In other words, when i move one of the verticalLines, another verticalLine also move follow the previous verticalLine and the gap between them is the same.
  2. When I move the vertical line, which corresponding event of VerticalLineAnnotation the I can use to get realtime data.
0 votes
22 views

I am evaluating the SciChart package and I am trying to show a graph of data. The data changes about every 500ms. I have the code as shown below.

My XAML code is:

                            <s:SciChartSurface  Name="Chart1">
                            <s:SciChartSurface.RenderableSeries>
                                <s:FastLineRenderableSeries DataSeries="{Binding SpectrumDataSciChart}" Name="lineRenderSeries"/>
                            </s:SciChartSurface.RenderableSeries>
                            <s:SciChartSurface.XAxis>
                                <s:NumericAxis ScientificNotation="None" />
                            </s:SciChartSurface.XAxis>
                            <s:SciChartSurface.YAxis>
                                <s:NumericAxis  />
                            </s:SciChartSurface.YAxis>
                        </s:SciChartSurface>

SpectrumDataSciChart is defined in the view model (.cs) as below:

        private XyDataSeries<double, double> _spec2;
    public XyDataSeries<double,double> SpectrumDataSciChart
    {
        get { return _spec2; }
        set { _spec2 = value; NotifyPropertyChanged(); }
    }

I see the correct plot but then the plot is removed (just a blank chart) and then it appears again. Seems like it is when I update the data (setting SpectrumDataSciChart to a new set of values). I don’t see this behavior with other vendors charts and wondering if I need to set something on the chart or bind differently. I tried using “FastLineRenderableSeriesForMvvm” (as I am using MVVM with WPF) also but it does the same thing. Any ideas?

0 votes
31 views

I’m playing with the DatPointSelectionModifier which seems mostly what i need but I have two problems as follows:

1/ I have started a selection operation by dragging over an area containing some points and I decide that I don’t want that area after all and want to cancel the operation (much like file explorer file dragging – hitting escape cancels the operation) – How do I do that?

2/ I have a set of selected points and drag to select another set which overlaps the first set. I would like the any points in the overlap to invert from selected to unselected and vice versa. How would I know which points are encompassed by the drag operation so i can work out the overlap?

Thanks for any suggestions
/Stuart

0 votes
52 views

Hi
Is there a way to just change the values of the pie segments so it get updated on the donut chart.
If I remove and add the pie segments again it works, is this the correct way?

Also I can’t find any documentation around the donut for android/xamarin

regards
Per

0 votes
0 answers
31 views

Hi,
Im tryin to create an effect where I have a static point on the Y Axis and I want to perform zoom in, so what I did is to increase or decrease the Max visible range, what I’m left with is the rubber band effect where my static point isn’t static anymore because the point in “Stretching” in the direction I’m zooming.

-1 votes
0 answers
25 views

The two pictures are part of the same column, but the time is different.
How to solve it?

1 vote
33 views

I think this is a pretty simple question but i am not sure what i am missing.I have a toggle button on my legend that is intended to allow the users to select all the series or deselect all the series.
the button essentially goes through the Renderable series view models and set the IsSelected to either true or false, this approach however, doesn’t work. I looked at the SelectionModifier and i can see that has a protected DeselectAll method and i am thinking to leverage that to solve this use case.

what is the best solution to accomplish this? isn’t this functionality something that perhaps be standard and could just be turned on?

0 votes
37 views

Hello,

one more question.
Same example from your SDK – 2D charts, Column Chart

How could I change the width / color for one line only:
enter image description here

I.e. for X-line (Y = 0).
The rest X lines shall remain the same.

Thanks!

-Egor

0 votes
44 views

Graph type “RangeBar” of Microsoft “MSChart” control and Does the graph type with the same function exist in “SCICHART”?
If it does not exist, is it possible to reproduce “RangeBar”?
I would be happy if you could have a Chart like the image.
Best regards.

1 vote
47 views

To whom this may concern:

I’d like to refer to the “Spline Scatter Line Chart” example in the SciChart Examples package. If I were to make this a CustomRenderableSeriesViewModel that I can set in a ViewModel class, how would I go about doing that?

I am using SciChart v4, and here’s what I know so far:

  1. CustomRenderableSeriesViewModel : BaseRenderableSeriesViewModel
  2. ViewType = typeof(CustomRenderableSeries)

My code so far is:

public class CustomRenderableSeriesViewModel : BaseRenderableSeriesViewModel
{
    public override Type ViewType => typeof(CustomRenderableSeries);
}

How would I go about setting the IsSplineEnabled property of the CustomRenderableSeries through the CustomRenderableSeriesViewModel class?

FYI: I have looked here and the Worked Example – CustomRenderableSeries in MVVM link goes to the SciChart v5 User manual.
Additionally, this is a duplicate of this issue on Stack Overflow (since I thought you were still fielding questions on there). Feel free to answer on either or both.

Can you please advise?

  • Ari Sagiv asked 3 weeks ago
  • last active 2 weeks ago
-1 votes
0 answers
39 views

For every 5 seconds I’m adding 5,00,000 data points to line Series but on zoom and other mouse handler gets hanged on adding data.

2 votes
49 views

Hello, @scichart team,

one question please for Column Chart (2D; WPF).
Based on on the example from your SDK for Column Chart (2D Charts – Column Chart).
No changes to the code at all;

enter image description here

My need is to display each “X” value on X axis;
I.e. right now it is “0, 2, 4, 6 etc”
But I need “0, 1, 2, 3, 4, 5 etc.”
I.e. no changes expect this one.

I played with https://www.scichart.com/documentation/v5.x/SciChart.Charting~SciChart.Charting.Visuals.Axes.AxisCore_members.html and with the custom NumericLabelProvider but didn’t find how to make this.

Please suggest how to achieve this.

Thanks!

-Egor

0 votes
211 views

our app is about Futures. we will buy license for IOS and Android.

we found some question.

so we need show very small values, like Euro exchange’s values will be from 1.1981 to 1.2008.
its Tick Size is 0.0001 .

but we use LogarithmicNumericAxis with OhlcDataSeries<Date, Double> , surface still linear scale.

other question.
how to custom LogarithmicNumericAxis’s “TextFormatting” like “$0.0000”

  • Rey Liang asked 2 months ago
  • last active 2 months ago
0 votes
136 views

In Xamarin.IOS when you set the legend to Horizontal and Top it will create a legend at the top then allow you to scroll horizontally to see all your LineSeries. In Xamarin.Android when you have more Series than can originally fit on the screen, the legend malfunctions and takes up the entire screen. Picture will be attached.

0 votes
0 answers
120 views

Hi All,

I’ve been trying to get SciCharts and the IOS UIScrollview to work together and have been running into a couple of issues.

The main storyboard has 7 SciChart surfaces plotting realtime data embedded inside a single UI scrollview controller.

1) Charts don’t render when scrollview is actively scrolling

Everything works fine during normal operation and we don’t try to scroll.

Once a finger is placed on the screen, the SciCharts surface stops redrawing. This could be due to the fact that the ‘Scroll’ thread is handled in the UITouch thread and perhaps has higher priority. I don’t know if there is anyway to change the priority of the render routine. I can confirm that everything until ‘Update Data’ and Chart.InvalidateElement() is being called during a scroll action.

2) Scrolling is disallowed when Chart surface is as large as scrollview

This may not be exactly due to scichart but if anyone faced this problem before it would help. If you attempt to scroll when the SciChartSurface is as large as the parent UIScrollView, it doesn’t scroll. Almost like the SciChart surface has the priority of touch and doesn’t let the scroll view see the scroll.

I would greatly appreciate if anyone successfully got UIScrollview and Scicharts working well together. I might be doing a bunch of rookie mistakes.

Cheers,
Mithrandir

Adding a quick update,

I could fix (2) by disable User Interactions of the Chart.

Note that you can’t simply disable this in the Main Storyboard, this has to be done programmatically by calling

ChartName.isUserInteractionEnabled = false

So the only real issue is (1), getting the chart to render while scrollview is active.

0 votes
163 views

I have just learned how to use sci-chart framework with tutorials.
And I tried to add values from bluetooth as realtime chart as shown in tutorials.
I have finished receiving data from a Bluetooth connection.
However, using scichart to represent this data in real time is hard to solve by looking at the tutorial alone.
Does anyone have any idea how to use real-time tutorials to teach you how to represent your own data, not the example sine graph?

The code below is what I tried and is wrong.

import UIKit
import CoreBluetooth
import SciChart

let maestroServiceCBUUID = CBUUID(string:”495sdfd3-FE7D-4AE5-8FA9-9FAFD205E455″)
let maestroBrainDataCBUUID = CBUUID(string: “4953sdf3-1E4D-4BD9-BA61-23C647249616”)
class HRMViewController: UIViewController {
var sciChartSurface: SCIChartSurface?

var lineDataSeries: SCIXyDataSeries!
var scatterDataSeries: SCIXyDataSeries!

var lineRenderableSeries: SCIFastLineRenderableSeries!
var scatterRenderableSeries: SCIXyScatterRenderableSeries!

var timer: Timer?
var phase = 0.0
var i = 0

@IBOutlet weak var brainRateLabel: UILabel!

var centralManager: CBCentralManager!
var maestroPeripheral:CBPeripheral!
override func viewDidLoad() {
super.viewDidLoad()

sciChartSurface = SCIChartSurface(frame: self.view.bounds)
sciChartSurface?.autoresizingMask = [.flexibleHeight, .flexibleWidth]
sciChartSurface?.translatesAutoresizingMaskIntoConstraints = true

self.view.addSubview(sciChartSurface!)


let xAxis = SCINumericAxis()
xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))
sciChartSurface?.xAxes.add(xAxis)

let yAxis = SCINumericAxis()
yAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))
sciChartSurface?.yAxes.add(yAxis)

createRenderableSeries()
addModifiers()


centralManager = CBCentralManager(delegate: self , queue: nil)

// Make the digits monospaces to avoid shifting when the numbers change

}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

if nil == timer{
  timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true, block: updatingDataPoints)
}

}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)

if nil != timer{
  timer?.invalidate()
  timer = nil
}

}

func updatingDataPoints(timer:Timer){

i += 1

lineDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(cos(Double(i)*0.1 + phase)))
scatterDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(cos(Double(i)*0.1 + phase)))

phase += 0.01

sciChartSurface?.zoomExtents()
sciChartSurface?.invalidateElement()

}

func createDataSeries(_brainwave2:Double){
// Init line data series
lineDataSeries = SCIXyDataSeries(xType: .double, yType: .double)
lineDataSeries.fifoCapacity = 500
lineDataSeries.seriesName = “line series”

// Init scatter data series

// scatterDataSeries = SCIXyDataSeries(xType: .double, yType: .double)
// scatterDataSeries.fifoCapacity = 500
// scatterDataSeries.seriesName = “scatter series”

for i in 0...500{
  lineDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(_brainwave2))

// scatterDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(cos(Double(i)*0.1)))
}

i = Int(lineDataSeries.count())

}

func createRenderableSeries(){
lineRenderableSeries = SCIFastLineRenderableSeries()
lineRenderableSeries.dataSeries = lineDataSeries

scatterRenderableSeries = SCIXyScatterRenderableSeries()
scatterRenderableSeries.dataSeries = scatterDataSeries

sciChartSurface?.renderableSeries.add(lineRenderableSeries)
sciChartSurface?.renderableSeries.add(scatterRenderableSeries)

}

func addModifiers(){
let xAxisDragmodifier = SCIXAxisDragModifier()
xAxisDragmodifier.dragMode = .pan
xAxisDragmodifier.clipModeX = .none

let yAxisDragmodifier = SCIYAxisDragModifier()
yAxisDragmodifier.dragMode = .pan

let extendZoomModifier = SCIZoomExtentsModifier()
let pinchZoomModifier = SCIPinchZoomModifier()

let rolloverModifier = SCIRolloverModifier()
let legend = SCILegendModifier()

let groupModifier = SCIChartModifierCollection(childModifiers: [xAxisDragmodifier, yAxisDragmodifier, pinchZoomModifier, extendZoomModifier, legend, rolloverModifier])

sciChartSurface?.chartModifiers = groupModifier

}

func brainwaveReceived(_ brainWave:Double){
let brainWave = brainWave * 3.3 / 65536
brainRateLabel.text = String(brainWave)
print(“brainwave: (brainWave)”)
}

}

extension HRMViewController: CBCentralManagerDelegate {
func centralManagerDidUpdateState(_ central: CBCentralManager) {
switch central.state {

case .unknown:
  print("central.state is . unknown")
case .resetting:
  print("central.state is . resetting")
case .unsupported:
  print("central.state is . unsupported")
case .unauthorized:
  print("central.state is . unauthorized")
case .poweredOff:
  print("central.state is . poweredOff")
case .poweredOn:
  print("central.state is . poweredOn")
  centralManager.scanForPeripherals(withServices:nil)
}

}

func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
print(peripheral)
if peripheral.name == “MAESTRO1” {
// maestroPeripheral = peripheral
centralManager.stopScan()
maestroPeripheral = peripheral
maestroPeripheral.delegate = self
central.connect(maestroPeripheral)
}

}
func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) {
print(“Connected!”)
maestroPeripheral.discoverServices([maestroServiceCBUUID])
}
}

extension HRMViewController:CBPeripheralDelegate{
func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) {
guard let services = peripheral.services else {return}
for service in services {
print(service)
peripheral.discoverCharacteristics(nil, for: service)
}
}
func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) {
guard let characteristics = service.characteristics else {return}

for characteristic in characteristics {
  print(characteristic)
  if characteristic.properties.contains(.read){
    print("\(characteristic.uuid): properties contain .read")
  }
  if characteristic.properties.contains(.notify){
    print("\(characteristic.uuid): properties contain .notify")
    peripheral.setNotifyValue(true , for: characteristic)
  }
}

}

func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic,
error: Error?) {
switch characteristic.uuid {
case maestroBrainDataCBUUID:
let wave = Double(brainData(from: characteristic))*3.3/65536
createDataSeries(_brainwave2:wave)

  default:
  print("Unhandled Characteristic UUID: \(characteristic.uuid)")
}

}
private func brainData(from characteristic: CBCharacteristic) -> Int {
guard let characteristicData = characteristic.value else { return -1 }
let byteArray = UInt8

let firstBitValue = byteArray[0] & 0x01
if firstBitValue == 0 {
  // Heart Rate Value Format is in the 2nd byte
  return Int(byteArray[1])
} else {
  // Heart Rate Value Format is in the 2nd and 3rd bytes
  return (Int(byteArray[1]) << 8) + Int(byteArray[2])
}

}

}

-1 votes
0 answers
122 views

When i go to zoom on my YAxis while a YAxis VisibleRangeLimit is baing set, the zoom does not work correctly. Once the zooming is finished it will reset back to the range limit. If i remove the range limit, the zooming then works as expected.

0 votes
0 answers
136 views

I’m using the YAxes property of the chart to data bind to a collection of NumericAxisViewModels. Is there a way to rotate the tick labels in this scenario. I can’t define a style in XAML and then assign it to the Axis because the axis is created in scichart somewhere. All I have is the axis view model. I have a LabelProvider but it doesn’t seem to support rotation unless I access the ParentAxis. Ultimately I would like to rotate some vertical axis and not other but I might be able to live with rotating all of them.

I have tried defining a style in xaml that applies to all numeric axis but it didn’t work:

<Style TargetType="{x:Type s:DefaultTickLabel}">
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <RotateTransform Angle="-90"/>
            </Setter.Value>
        </Setter>
    </Style>

Adding a LabelProvider sort of works but seems a little hacky and doesn’t set the scale appropriately ( I have to zoom to extends to see the labels). Is this the way I am supposed to do it?

public override string FormatLabel(IComparable dataValue) {
        var style = new Style(typeof(DefaultTickLabel));
        style.Setters.Add(new Setter(DefaultTickLabel.LayoutTransformProperty, new  RotateTransform(-90.0)));
        ParentAxis.TickLabelStyle = style;
0 votes
193 views

Hi,

I’m working on the iOS and android version. I’m trying to implemented an animated visible range change on Y axis when zooming/panning X axis.

On iOS, I just have to do:
yAxis.autoRange = .always
yAxis.animateVisibleRangeChanges = true
yAxis.animatedChangeDuration = 0.5

But I can’t find a way to do that on Android, is it hidden somewhere else?

Kind Regards,
Alexis

0 votes
167 views

Hi

I’m trying to use SciChart in my Xamarin Visual Studio Cross platform application. After installing the SciChart package in the Package Manager console I got the dependency reference error:

Package SciChart 5.1.0.11405 was restored using '.NETFramework, Version=v4.6.1' instead of the project target framework 'NETStandard,Version=v2.0'. This papckage may not be fully compatible with your project .

I know that .NET framework 4.6.1 is different from .NETStandard2.0.

I’ve read some articles about how to target multiple .NET versions in the same application by modifying the .csproj file, but I can’t get it work anyway.
https://medium.com/@SicknoteSteve/nuget-targeting-both-net-standard-and-the-net-framework-326a16266ca4
I’ve modified the csproj file like this

<PropertyGroup>
  <TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
  <PackageReference Include="Xamarin.Forms" Version="2.5.0.280555" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
  <PackageReference Include="SciChart" Version="5.1.0.11405" />
  <PackageReference Include="Xamarin.Forms" Version="2.5.0.280555" />
</ItemGroup>

This action removes all dependency errors, but I still can’t use the libraries.

Does anyone know how to solve this issue?

Thanks in advance!

0 votes
0 answers
164 views

Hi!

My goal is to allow the user to mark an x-axis range in the chart. For this, I use BoxAnnotation. The boxes cover the whole chart height and can only be moved/resized in horizontal direction.
The annotation is created via AnnotationCreationModifier.

The problem is that the user cannot select this range everywhere, but only within a certain interval of the x-axis. So it would be necessary to limit the drag range for the AnnotationCreationModifier and for the Annotation resize/move action. With other words, the drawn rectangles should stop following the mouse when the mouse if moved out of the allowed x-axis range.
Is this possible?

Best regards,
ChartIt

0 votes
168 views

When I open activity with chart on real devices chart area for a moment has black color and theh succesfuly displayed chart data.
On emulators I do not see thes behavior.
How can I fix black screen?

0 votes
0 answers
131 views

Hi,
we are using an UICollectionView to display different kinds of views in our application, including charts created with SciChart. We noted that every time a cell with a SciChart is loaded, some memory is allocated and not freed when the cell disappears, which leads to a massive memory leak and eventually crashes the application.
Is there a way to free SciChart resources on demand? Or maybe you suggest another solution to solve this issue?
Regards,
Anna

0 votes
133 views

I am binding my chart to an ObservableCollection that consists of many XYDataSeries. When I create and add the XyDataSeries, I set the SeriesName and Stroke properties. The data shows on the chart. I have the following Legend Template:

    <DataTemplate x:Key="LegendItemTemplate" DataType="s:SeriesInfo">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <CheckBox Grid.Column="0" 
                      Margin="5,0"
                      HorizontalAlignment="Left"
                      VerticalAlignment="Center"        
                      Foreground="{StaticResource BlackBrush}"
                      Content="{Binding SeriesName}"
                      IsChecked="{Binding RenderableSeries.IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                      Visibility="{Binding LegendData.ShowVisibilityCheckboxes, RelativeSource={RelativeSource AncestorType=s:SciChartLegend}, Converter={StaticResource VisibleWhenTrueConverter}}" />


            <xctk:ColorPicker Grid.Column="2"  x:Name="cpPalette" 
                              ColorMode="ColorPalette" VerticalAlignment="Center"
                              SelectedColor="{Binding RenderableSeries.Stroke, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="25" Width="40" />

        </Grid>
    </DataTemplate>

However, when I change the colour using the Colorpicker, my charts series are not updated (ie, changing colour)

0 votes
128 views

Hi

Is it possible to show an axis line like on the image?

/Flemming

0 votes
149 views

Hi

I have attached an image of a chart.

Is it possible to get the first and last date to stand directly under the tick?

/Flemming

0 votes
144 views

Hi

I have tried following your custom DeltaCalculator example:

https://www.scichart.com/documentation/v5.x/Axis%20Ticks%20-%20TickProvider%20and%20DeltaCalculator%20API.html

var axis = new NumericAxis();
axis.DeltaCalculator = new CustomNumericDeltaCalculator();

But there does not seem to be a DeltaCalculator property on the axis object?

/Flemming

0 votes
145 views

Hi,
I want to implement a chart that represent currency changed rate, so that the chart will show a rise with a green point and a fall with a red point.

in the image I’ve uploaded I’ve used Custom PaletteProvider to manipulate the colors accordingly.

what I want to implement is instead of coloring the Point (Ellipse) I want to load an Image.
the closest i’ve got is to load a single image to all the points, without theme changing (red or green) accordingly.

I did managed to implement that exact behavior in iOS.

how could I implement a dynamically changing Sprits in a PaletteProvider ?

Thanks in advance…

0 votes
155 views

I am aware that for performance reasons that SciChart expects data to be sorted in the X direction. But is it possible to have it sorted in a descending order rather than the default ascending order?

  • muh fugen asked 2 months ago
  • last active 2 months ago
0 votes
151 views

Can you help me please!
I was searching forum and see all different questions with dfferent ansvers but no one help for me.

I’m using CategoryDateAxis and whant to show to users vertical lines between days, weeks or month
Its depends from timestamp and visible period.
I need to opportunity to provide themself when to display vertical line.

In chart I display CandlestickSeries from stosk market and users whant to know when one day is ended and new day is begin.

How can I do that?

0 votes
125 views

I want to use a CursorModifier – but is it possible to only show the vertical line?

/Flemming

0 votes
153 views

I have CategoryDateAxis and whant to setup range limit from series size – 50 to series size + 10

mBottomAxis.setVisibleRangeLimit(new DoubleRange(series.size() - 50d, series.size() + 10d));
mBottomAxis.setVisibleRangeLimitMode(RangeClipMode.MinMax);

And this code works but not as I expected
When I scrol chalt and hits the range limit scroll is stopped BUT chart is zooming in

How to disable zooming when I hits the limit?

0 votes
156 views

I’m trying to create a custom overview control as shown in the example with the same name, but all I get is an empty black box. The main chart is working just fine and I have it bound (for now) to the same data series as the main chart. However the only way I can get it to show anything in the overview chart is to bind it’s x and y axes to the same as the main chart, which basically makes it a copy.

            <sc:SciChartSurface x:Name="OverviewSurface" Loaded="OnOverviewSurfaceLoaded" Grid.Row="1" Margin="10,0,0,0" RenderableSeries="{sc:SeriesBinding RenderableSeriesViewModels}" >

            <sc:SciChartSurface.XAxis>
                <sc:NumericAxis DrawMajorGridLines="False" DrawMinorGridLines="False" Visibility="Collapsed"/>
            </sc:SciChartSurface.XAxis>

            <sc:SciChartSurface.YAxis>
                <sc:NumericAxis DrawMajorGridLines="False" DrawMinorGridLines="False" Visibility="Collapsed"/>
            </sc:SciChartSurface.YAxis>
        </sc:SciChartSurface>

That code above just doesn’t work at all. The RenderableSeriesViewModels are the same as bound to the main chart which is working. I’ve tried variations, using AutoRange and and creating all new ViewModels just for the overview axes but the only way I can get it to show anything at all is to bind it to the main chart axis and then I can’t hide them without hiding them on the main chart.

0 votes
0 answers
149 views

Hi!

As I found a decent solution to my previous question for how to create a simple, single vertical line chart modifier, I deleted my previous post; I use the TooltipModifierBase and just added a line where I need it, orientating myself on how the CursorModifier works.

My problem now is, I can’t get the coordinates to show on the axis label when using “UpdateXAxesOverlay(mousePoint)”. The label shows up properly, but it just says “SciChart.Charting.Visuals.RenderableSeries.AxisInfo” on it. I assume I’m missing a binding or such somewhere, but I’ve sadly been unable to figure out where or how to get it work.

0 votes
0 answers
152 views

When there are 2 or more horizontal/vertical axis, how to hide the cursor label for specific axis?

0 votes
158 views

Sir,
I have a dataseries from a music file and displaying it in realtime on the screen. The chart shows only a small portion of the waveforms and on each dispatcher timer tick (10ms) I am adjusting the visible range of the chart as shown below.

        }
       // sciChartZoom.XAxis.VisibleRangeChanged -= TimeSpanAxis_VisibleRangeChanged;

        DateTime dtmp = dtmin;
        TimeSpan drng = new TimeSpan(0, 0, VisCon.zoomRangeIn);
        TimeSpan ttmp = TimeSpan.FromSeconds(VandC.posSeconds);
        TimeSpan dtlo = ttmp.Subtract(drng);
        TimeSpan dthi = ttmp.Add(drng);

        dtmp = dtmp.AddSeconds(VandC.posSeconds);


        double posAxis = (double)sciChartFull.XAxis.GetCoordinate(ttmp);

        Thickness m = posRec.Margin;
        m.Left = posAxis - VisCon.posRectmargin1;
        posRec.Margin = m;

        sciChartZoom.XAxis.VisibleRange = new TimeSpanRange(dtlo, dthi);

        //sciChartZoom.XAxis.VisibleRangeChanged += TimeSpanAxis_VisibleRangeChanged;

    }

My problem is that the chart does not move very smooth and it uses around 50% CPU power(core i5 3.2GHz). Decreasing the timer ticks less than 10ms does not make any improvement.

I am attaching a picture of how the chart looks. The top is the zoom chart while the bottom one is always static.

Can you help please?

Regards
Julian

1 vote
0 answers
145 views

Hi, we are updating our scichart component to version 5. Now we had to change our Series Binding which is obsolete now to RenderableSeries binding.

In the most graphs it works fine but I have also graphs that uses ElementName with paths for the binding and that does not work.

I tried the following versions which all did not work, is there a different way to do it?

<!-- old scichart version which is not allowed anymore-->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       SeriesSource ="{Binding ElementName=GraphRoot, Path=Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

<!-- First try with new version which is not working because we don't use seriesBinding-->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       RenderableSeries ="{Binding ElementName=GraphRoot, Path=Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

<!-- Second try with new version which is also not working -->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       RenderableSeries ="{s:SeriesBinding ElementName=GraphRoot, Path=Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

<!-- Last try with new version which is also not working becaus without ElementName he cannot find the Series-->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       RenderableSeries ="{s:SeriesBinding Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

Please is there any idea how to solve this?

0 votes
134 views

When trying to create a candlestick graph, if I have data with no high low bars with a range of more than 0.00950 then the graph won’t zoom in on initial load. See my code further below. Above 0.00950 and it’s okay. BTW I’ve tried withVisibleRage.

Please help, my trial is going to run out soon. I’m really stuck.

For example:

The following won’t zoom in:

[
    {
        "symbol": "AUDCAD",
        "ctm": "2018-02-10 09:00:00",
        "high": 0.98000,
        "low": 0.97100,
        "open": 0.97900,
        "close": 0.97800,
        "volume": 1238
    } ]

The following does zoom in:

[
    {
        "symbol": "AUDCAD",
        "ctm": "2018-02-10 09:00:00",
        "high": 0.98000,
        "low": 0.97000,
        "open": 0.97900,
        "close": 0.97800,
        "volume": 1238
    }
]

Here’s a screenshots:

enter image description here enter image description here

Here’s the code which produces the charts:

final CategoryDateAxis xAxis = sciChartBuilder.newCategoryDateAxis()
        .withVisibility(isMainPane ? View.VISIBLE : View.GONE)
        .withAutoTicks(true)
        .withGrowBy(new DoubleRange(0d, 0.1d))
        .build();

final NumericAxis yAxis = sciChartBuilder
        .newNumericAxis()
        .withAxisId(PRICES)
        .withAutoRangeMode(AutoRange.Always)
        .withDrawMinorGridLines(true)
        .withDrawMajorGridLines(true)
        .withMinorsPerMajor(10)
        .withMaxAutoTicks(20)
        .withGrowBy(new DoubleRange(0d, 0.1d))
        .build();

surface.getXAxes().add(xAxis);
surface.getYAxes().add(yAxis);

surface.getRenderableSeries().addAll(model.renderableSeries);
Showing 1 - 50 of 2k results