Pre loader

Tag: XyDataSeries

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1 vote
0 answers
262 views

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

1 vote
2k views

The scichart y axis is displayed as undefined after updating the data in timed interval. The y axis initially shows the value,but after the data is appended to the source, the y axis is shown as undefined in the chart.

I have attached the final scichart image with yaxis as undefined.

  • Leo Leslin asked 11 months ago
  • last active 11 months ago
1 vote
4k views

I have XyDataSeries with 50 data points and I’m trying to insert another 50 data points to index 5. The same values can be inserted as a range to the beginning of the data series or inserted one by one starting from index 5. But they fail with “RuntimeError: memory access out of bounds” whenever I try to insert them as a range from index 5.

Code snippet:

const { xValues, yValues } = generateData(50);
const dataSeries = new XyDataSeries(wasmContext, { xValues, yValues, isSorted: false });
sciChartSurface.renderableSeries.add(new FastLineRenderableSeries(wasmContext, { dataSeries }));

// this works
dataSeries.insertRange(0, xValues, yValues);
// this works
for (let i = 0; i < xValues.length; i++) {
  dataSeries.insert(i + 5, xValues[i], yValues[i]);
}
// this fails
dataSeries.insertRange(5, xValues, yValues);

Codesandbox link: https://codesandbox.io/s/scichart-js-boilerplate-forked-hokfcn

I wonder if I’m doing something wrong or if this is an actual issue?

Side note: Index 5 is just an example, because it seems I can use the insertRange method when inserting to index 0-2, but it fails when inserting to index 3+ (in case of a chart with 50 existing data points)

1 vote
8k views

Requirements:

  • Main graph updates based on the data from the selected Item.
  • The data and styling is independent and the style is dynamic global style for all Items.
  • The data for the graphing that is Data Series is binded to DataSet which is of type XYDataSeries<DateTime, double>.
  • DataSeries data is obtained from the datacontext which implements INotifyPropertyChanged

Problem:

  • The databinding is not dynamic and the data series is not updated when the selection changes.
  • The initial data selection is reflected but any subsequent data changes are not reflected on the sci chart surface.
  • This behavior was only for the Dataseries binding and it was verified using a textbox which binds to the count of the DataSet and this updates as the selection changes but not the dataseries.

Please suggest a work around or an alternative solution so that I can predefine axes and series but swap out the data based on the selected Item. Please see the attached xaml code below.

        <Grid>
        <Grid DockPanel.Dock="Top">
            <chart:SciChartSurface x:Name="mainView"
                                   OnRenderException="MainView_OnRenderException"
                                   Loaded="MainView_Loaded">
                <chart:SciChartSurface.YAxes>
                    <chart:NumericAxis x:Name="AxisOne"
                                       Id="Id1"
                                       AxisAlignment="Left"/>

                    <chart:NumericAxis x:Name="AxisTwo"
                                       Id="Id2"
                                       AxisAlignment="Left"/>

                </chart:SciChartSurface.YAxes>
                <chart:SciChartSurface.XAxis>
                    <chart:DateTimeAxis x:Name="DateTimeAxis"/>
                </chart:SciChartSurface.XAxis>
                <chart:SciChartSurface.RenderableSeries>
                    <chart:FastLineRenderableSeries x:Name="DataSet1FS"
                                                    DataSeries="{Binding DataSet1}"
                                                    YAxisId="Id1"
                                                    Stroke="Yellow"/>
                </chart:SciChartSurface.RenderableSeries>
            </chart:SciChartSurface>
        </Grid>
        <TextBlock Text="{Binding Path=DataSet1.Count}"
                            Margin="0 -20 0 0"
                            HorizontalAlignment="Right"
                            VerticalAlignment="Top"
                            Height="20"
                            Width="200"
                            Background="White"
                            Foreground="Black"/>
    </Grid>
1 vote
2k views

Hi,

I have added a data series and also a custom box annotation which is overlapping the data series.
But the question is I am trying to move the box annotation which drag and drop but have to clip on the data series as well.
May I know if is scichart js able to do so? Or best if I just convert it into svg and make it drag and drop will do?

  • eva yeoh asked 1 year ago
  • last active 1 year ago
0 votes
0 answers
5k views

Hello Andrew & Co.

I need some guidance in an attempt to add some required functionality to my SciChart application.

A requirement has been brought to my attention where a user wants to do a graph over lay from a different time snap shot . This is useful for comparison reasons, where the engineer wants to compare a previous successful execution of a process with a current running one.

  • One part of the solution is to save the dataseries info from a finite
    time period in the past.
  • Second part is that the overlaid trend (dataseries) need to be time
    XAxis independent but YAxis relative.

I am looking at two different scenarios let me see what you guys think:

  1. Overlaid historic static trend on existing chart surface
  2. Historic static trend in a new chart surface (smaller format) on the
    bottom of the current chart surface being displayed

How should I best approach such an implementation ? The application is using the MVVM pattern. I have adhered to the pattern pretty religiously so far

Hopefully that makes sense to describe what I am trying to accomplish.
Appreciate your support and expert guidance in this matter

Thanks
Anders

0 votes
16k views

I want to build a column chart but I got the following error:

ERROR TypeError: Cannot read property ‘append’ of undefined

The error happened in line #42.

My code:

export class OutputAmplitudeComponent implements OnInit, OnDestroy {

constructor(@Inject(SETTING_SERVICE) private settingService: SettingService, private cdr: ChangeDetectorRef) {}

ngOnInit() {        
                this.settingService.registerSetting(HarmonicAmpSetting).pipe(takeUntil(this.ngUnsubHarmonicData)).subscribe(setting => {
                    const OutputAmplitudeData = setting.value;

                    for (let x = 1; x < this.numberOfOutput; x++) {
                        if (this.OutputMode === 'Voltage') {
                            if (phaseNum === 1) {
                                this.ampSource.data[x-1].voltage1 = OutputAmplitudeData[x];
                            } else if (phaseNum === 2) {
                                this.ampSource.data[x-1].voltage2 = OutputAmplitudeData[x];
                            } else if (phaseNum === 3) {
                                this.ampSource.data[x-1].voltage3 = OutputAmplitudeData[x]; 
                            }
                        } else if (this.OutputMode === 'Current') {
                            if (phaseNum === 1) {
                                this.ampSource.data[x-1].current1 = OutputAmplitudeData[x];
                            } else if (phaseNum === 2) {
                                this.ampSource.data[x-1].current2 = OutputAmplitudeData[x];
                            } else if (phaseNum === 3) {
                                this.ampSource.data[x-1].current3 = OutputAmplitudeData[x];
                            }
                        }

                    }   
                    this.updateData();
                });
                this.sciChartInit();
            }   

updateData(){
    var phaseNum1 = [];
    var xData = [];
    for (let x = 1; x < this.numberOfOutput; x++) {
        if (this.ampSource.data != null && this.ampSource.data[x-1] != null) {
            phaseNum1[x - 1] = parseFloat(this.ampSource.data[x - 1].voltage1);
            xData[x - 1] = x;
            if (!isNaN(phaseNum1[x - 1])) {
                this.dataSeries1.append(x,x);
            } else {
                console.log("No num");
            }
        }
    }
}       

async sciChartInit() {

    const { wasmContext, sciChartSurface } = await SciChartSurface.create("chart");

    var phaseNum1 = [];
    var xData = [];
    this.dataSeries1 = new XyDataSeries(wasmContext);
    for (let x = 1; x < this.numberOfOutput; x++) {
        this.dataSeries1.append(x, x);
    }

    const xAxis = new NumericAxis(wasmContext);
    sciChartSurface.xAxes.add(xAxis);
    const yAxis = new NumericAxis(wasmContext);
    sciChartSurface.yAxes.add(yAxis);

    const rendSeries1 = new StackedColumnRenderableSeries(wasmContext);
    rendSeries1.fill = "#dc443f";
    rendSeries1.stroke = "green";
    rendSeries1.strokeThickness = 1;
    rendSeries1.dataSeries = this.dataSeries1;
    rendSeries1.stackedGroupId = "one";

    const verticallyStackedColumnCollection = new StackedColumnCollection(wasmContext);
    verticallyStackedColumnCollection.dataPointWidth = 0.5;
    verticallyStackedColumnCollection.add(rendSeries1);
    verticallyStackedColumnCollection.animation = new ScaleAnimation({ duration: 1000, fadeEffect: true });

    sciChartSurface.renderableSeries.add(verticallyStackedColumnCollection);
    sciChartSurface.chartModifiers.add(new ZoomExtentsModifier(), new ZoomPanModifier(), new MouseWheelZoomModifier());
    sciChartSurface.zoomExtents();

    sciChartSurface.chartModifiers.add(
        new LegendModifier({
            placement: ELegendPlacement.TopRight,
            orientation: ELegendOrientation.Horizontal,
            showLegend: true,
            showCheckboxes: true,
            showSeriesMarkers: true
        })
    );
    return { wasmContext, sciChartSurface };
}}

I don’t understand what is undefined and why.

Thank you.

  • ETS Ong asked 3 years ago
  • last active 3 years ago
0 votes
12k views

I want to build a Stacked Column Side by Side Chart by referring to the reference here.

However, the program could not enter line #41. It just stuck there and the column chart could not be shown.

My code:

export class OutputAmplitudeComponent implements OnInit, OnDestroy {

constructor(@Inject(SETTING_SERVICE) private settingService: SettingService, private cdr: ChangeDetectorRef) {}

ngOnInit() {        
                this.settingService.registerSetting(HarmonicAmpSetting).pipe(takeUntil(this.ngUnsubHarmonicData)).subscribe(setting => {
                    const OutputAmplitudeData = setting.value;

                    for (let x = 1; x < this.numberOfOutput; x++) {
                        if (this.OutputMode === 'Voltage') {
                            if (phaseNum === 1) {
                                this.ampSource.data[x-1].voltage1 = OutputAmplitudeData[x];
                            } else if (phaseNum === 2) {
                                this.ampSource.data[x-1].voltage2 = OutputAmplitudeData[x];
                            } else if (phaseNum === 3) {
                                this.ampSource.data[x-1].voltage3 = OutputAmplitudeData[x]; 
                            }
                        } else if (this.OutputMode === 'Current') {
                            if (phaseNum === 1) {
                                this.ampSource.data[x-1].current1 = OutputAmplitudeData[x];
                            } else if (phaseNum === 2) {
                                this.ampSource.data[x-1].current2 = OutputAmplitudeData[x];
                            } else if (phaseNum === 3) {
                                this.ampSource.data[x-1].current3 = OutputAmplitudeData[x];
                            }
                        }
                        this.sciChartInit(x);
                    }   
                });
            }   


async sciChartInit(x:number) {

    var phase1 = parseFloat(this.ampSource.data[x-1].voltage1);
    var phase2 = parseFloat(this.ampSource.data[x-1].voltage2);
    var phase3 = parseFloat(this.ampSource.data[x-1].voltage3);

    //stuck here

    const { wasmContext, sciChartSurface } = await SciChartSurface.create("chart");

    const xAxis = new NumericAxis(wasmContext);
    sciChartSurface.xAxes.add(xAxis);
    const yAxis = new NumericAxis(wasmContext);
    sciChartSurface.yAxes.add(yAxis);

    const dataSeries1 = new XyDataSeries(wasmContext, { xValues:[x], yValues:[phase1], dataSeriesName: "Phase 1" });
    const dataSeries2 = new XyDataSeries(wasmContext, { xValues:[x], yValues:[phase2], dataSeriesName: "Phase 2" });
    const dataSeries3 = new XyDataSeries(wasmContext, { xValues:[x], yValues:[phase3], dataSeriesName: "Phase 3" });

    const rendSeries1 = new StackedColumnRenderableSeries(wasmContext);
    rendSeries1.fill = "#dc443f";
    rendSeries1.stroke = "black";
    rendSeries1.strokeThickness = 1;
    rendSeries1.dataSeries = dataSeries1;
    rendSeries1.rolloverModifierProps.markerColor = "#b83735";
    rendSeries1.rolloverModifierProps.tooltipColor = "#dc443f";
    rendSeries1.rolloverModifierProps.tooltipTextColor = "#fff";
    rendSeries1.stackedGroupId = "one";

    const rendSeries2 = new StackedColumnRenderableSeries(wasmContext);
    rendSeries2.fill = "#aad34f";
    rendSeries2.stroke = "black";
    rendSeries2.strokeThickness = 1;
    rendSeries2.dataSeries = dataSeries2;
    rendSeries2.rolloverModifierProps.markerColor = "#87a73e";
    rendSeries2.rolloverModifierProps.tooltipColor = "#aad34f";
    rendSeries2.rolloverModifierProps.tooltipTextColor = "#000";
    rendSeries2.stackedGroupId = "two";

    const rendSeries3 = new StackedColumnRenderableSeries(wasmContext);
    rendSeries3.fill = "#8562b4";
    rendSeries3.stroke = "black";
    rendSeries3.strokeThickness = 1;
    rendSeries3.dataSeries = dataSeries3;
    rendSeries3.rolloverModifierProps.markerColor = "#715195";
    rendSeries3.rolloverModifierProps.tooltipColor = "#8562b4";
    rendSeries3.rolloverModifierProps.tooltipTextColor = "#fff";
    rendSeries3.stackedGroupId = "three";

    const verticallyStackedColumnCollection = new StackedColumnCollection(wasmContext);
    verticallyStackedColumnCollection.dataPointWidth = 0.5;
    verticallyStackedColumnCollection.add(rendSeries1, rendSeries2, rendSeries3);
    verticallyStackedColumnCollection.animation = new ScaleAnimation({ duration: 1000, fadeEffect: true });

    sciChartSurface.renderableSeries.add(verticallyStackedColumnCollection);

    sciChartSurface.chartModifiers.add(new ZoomExtentsModifier(), new ZoomPanModifier(), new MouseWheelZoomModifier());

    sciChartSurface.zoomExtents();

    sciChartSurface.chartModifiers.add(new RolloverModifier({ rolloverLineStroke: "#228B22" }));
    sciChartSurface.chartModifiers.add(
        new LegendModifier({
            placement: ELegendPlacement.TopRight,
            orientation: ELegendOrientation.Horizontal,
            showLegend: true,
            showCheckboxes: true,
            showSeriesMarkers: true
        })
    );
    return { wasmContext, sciChartSurface };
} }

.
.
The data needed in the chart is identified and no error is shown.
Any idea on the solution?

Thank you.

  • ETS Ong asked 3 years ago
  • last active 3 years ago
0 votes
6k views

I want to build a Stacked Column Side by Side Chart by referring to the reference here.

My code:

export class OutputAmplitudeComponent implements OnInit, OnDestroy {

yValues:any;
x:any;

constructor(@Inject(SETTING_SERVICE) private settingService: SettingService, private cdr: ChangeDetectorRef) {}

ngOnInit() {        
                this.settingService.registerSetting(OutputAmpSetting).pipe(takeUntil(this.ngUnsubAmplitudeData)).subscribe(setting => {
                    const OutputAmplitudeData = setting.value;

                    for (let x = 1; x < this.numberOfOutput; x++) {
                        if (this.OutputMode === 'Voltage') {
                            if (phaseNum === 1) {
                                this.ampSource.data[x-1].voltage1 = OutputAmplitudeData[x];
                            } else if (phaseNum === 2) {
                                this.ampSource.data[x-1].voltage2 = OutputAmplitudeData[x];
                            } else if (phaseNum === 3) {
                                this.ampSource.data[x-1].voltage3 = OutputAmplitudeData[x]; 
                            }
                        } else if (this.OutputMode === 'Current') {
                            if (phaseNum === 1) {
                                this.ampSource.data[x-1].current1 = OutputAmplitudeData[x];
                            } else if (phaseNum === 2) {
                                this.ampSource.data[x-1].current2 = OutputAmplitudeData[x];
                            } else if (phaseNum === 3) {
                                this.ampSource.data[x-1].current3 = OutputAmplitudeData[x];
                            }
                        }
        this.sciChartInit();
                    }   
                });
            }   

xValues = this.x;

phase1:number = parseFloat(this.ampSource.data[this.x-1].voltage1);
phase2:number = parseFloat(this.ampSource.data[this.x-1].voltage2);
phase3:number = parseFloat(this.ampSource.data[this.x-1].voltage3);

async sciChartInit() {

    const { wasmContext, sciChartSurface } = await SciChartSurface.create("chart");
    const xAxis = new NumericAxis(wasmContext);
    xAxis.labelProvider.numericFormat = ENumericFormat.Decimal_0;
    sciChartSurface.xAxes.add(xAxis);
    const yAxis = new NumericAxis(wasmContext);
    sciChartSurface.yAxes.add(yAxis);

    const dataSeries1 = new XyDataSeries(wasmContext, { xValues:this.x, yValues:this.phase1, dataSeriesName: "Phase 1" });
    const dataSeries2 = new XyDataSeries(wasmContext, { xValues:this.x, yValues:this.phase2, dataSeriesName: "Phase 2" });
    const dataSeries3 = new XyDataSeries(wasmContext, { xValues:this.x, yValues:this.phase3, dataSeriesName: "Phase 3" });

    const rendSeries1 = new StackedColumnRenderableSeries(wasmContext);
    rendSeries1.fill = "#dc443f";
    rendSeries1.stroke = "black";
    rendSeries1.strokeThickness = 1;
    rendSeries1.dataSeries = dataSeries1;
    rendSeries1.rolloverModifierProps.markerColor = "#b83735";
    rendSeries1.rolloverModifierProps.tooltipColor = "#dc443f";
    rendSeries1.rolloverModifierProps.tooltipTextColor = "#fff";
    rendSeries1.stackedGroupId = "one";

    const rendSeries2 = new StackedColumnRenderableSeries(wasmContext);
    rendSeries2.fill = "#aad34f";
    rendSeries2.stroke = "black";
    rendSeries2.strokeThickness = 1;
    rendSeries2.dataSeries = dataSeries2;
    rendSeries2.rolloverModifierProps.markerColor = "#87a73e";
    rendSeries2.rolloverModifierProps.tooltipColor = "#aad34f";
    rendSeries2.rolloverModifierProps.tooltipTextColor = "#000";
    rendSeries2.stackedGroupId = "two";

    const rendSeries3 = new StackedColumnRenderableSeries(wasmContext);
    rendSeries3.fill = "#8562b4";
    rendSeries3.stroke = "black";
    rendSeries3.strokeThickness = 1;
    rendSeries3.dataSeries = dataSeries3;
    rendSeries3.rolloverModifierProps.markerColor = "#715195";
    rendSeries3.rolloverModifierProps.tooltipColor = "#8562b4";
    rendSeries3.rolloverModifierProps.tooltipTextColor = "#fff";
    rendSeries3.stackedGroupId = "three";

    const verticallyStackedColumnCollection = new StackedColumnCollection(wasmContext);
    verticallyStackedColumnCollection.dataPointWidth = 0.5;
    verticallyStackedColumnCollection.add(rendSeries1, rendSeries2, rendSeries3);
    verticallyStackedColumnCollection.animation = new ScaleAnimation({ duration: 1000, fadeEffect: true });

    sciChartSurface.renderableSeries.add(verticallyStackedColumnCollection);

    sciChartSurface.chartModifiers.add(new ZoomExtentsModifier(), new ZoomPanModifier(), new MouseWheelZoomModifier());

    sciChartSurface.zoomExtents();

    sciChartSurface.chartModifiers.add(new RolloverModifier({ rolloverLineStroke: "#228B22" }));
    sciChartSurface.chartModifiers.add(
        new LegendModifier({
            placement: ELegendPlacement.TopRight,
            orientation: ELegendOrientation.Horizontal,
            showLegend: true,
            showCheckboxes: true,
            showSeriesMarkers: true
        })
    );
    return { wasmContext, sciChartSurface };
} }

.
Error:

ERROR in output-amplitude.component.ts: - error TS2322: Type 'number' is not assignable to type 'number[]'.
const dataSeries1 = new XyDataSeries(wasmContext, { xValues:this.x, yValues:this.phase1, dataSeriesName: "Phase 1" });                                                                     
node_modules/scichart/Charting/Model/XyDataSeries.d.ts:
yValues?: number[]; 
The expected type comes from property 'yValues' which is declared here on type 'IXyDataSeriesOptions'

.
.
I tried to parse the variables to numbers by using parseFloat in phase1 to phase3 but it did not solve error in yValues.
Any idea on the solution?

  • ETS Ong asked 3 years ago
  • last active 3 years ago
0 votes
0 answers
10k views

I am creating a chart to represent certain vitals. The code is almost identical to the Vitals Monitoring Demo application, the difference being
I added some Line and text annotations. I am appending points to the data series every 100ms. I have verified that the anomalous behavior is not caused due to wrong data being provided,
leading me to believe it must be a bug within SciChart. I have attached screenshots of this anomalous behavior. Any help would be greatly appreciated. Thank you.

Edit: This happens randomly, ie it performs normally without glitches on application startup but misbehaves after left running for a while.
I also observed that when I call .clear() on the XyDataSeries objects, the graph returns to normalcy, but only until FIFO_CAPACITY is reached. It then goes back to wreaking havoc.
I have added sample data (data.txt) to the question for reference, and screenshots of Expected behavior and the abnormal behavior in question.

Gif of the problem is here: https://imgur.com/7SO4DFb

Code used for setting up the chart:

     `SciChartBuilder sciChartBuilder;
     static ISciChartSurface chart;
     public final static XyDataSeries<Double, Double> pressureDataSeries = newDataSeries(FIFO_CAPACITY);
     public final static XyDataSeries<Double, Double> pressureSweepDataSeries = newDataSeries(FIFO_CAPACITY);
     public final static XyDataSeries<Double, Double> flowDataSeries = newDataSeries(FIFO_CAPACITY);
     public final static XyDataSeries<Double, Double> flowSweepDataSeries = newDataSeries(FIFO_CAPACITY);
     public final static XyDataSeries<Double, Double> volumeDataSeries = newDataSeries(FIFO_CAPACITY);
     public final static XyDataSeries<Double, Double> volumeSweepDataSeries = newDataSeries(FIFO_CAPACITY);
     public final static XyDataSeries<Double, Double> lastPressureSweepDataSeries = newDataSeries(1);
     public final static XyDataSeries<Double, Double> lastFlowDataSeries = newDataSeries(1);
     public final static XyDataSeries<Double, Double> lastVolumeDataSeries = newDataSeries(1);
     private static XyDataSeries<Double, Double> newDataSeries(int fifoCapacity) {
    final XyDataSeries<Double, Double> ds = new XyDataSeries<>(Double.class, Double.class);
    ds.setFifoCapacity(fifoCapacity);
    return ds;
}
 private void setUpChart() {                          // Called from onCreate()
    try {
        SciChartSurface.setRuntimeLicenseKey("");
    } catch (Exception e) {
        e.printStackTrace();
    }
    final String pressureId = "pressureId";
    final String flowId = "flowId";
    final String volumeId = "volumeId";
    SciChartBuilder.init(this);
    sciChartBuilder = SciChartBuilder.instance();
    chart = new SciChartSurface(this);
    LinearLayout chartLayout = findViewById(R.id.charts);
    chartLayout.addView((View) chart, 0);
    final NumericAxis xAxis = sciChartBuilder.newNumericAxis()
            .withVisibleRange(0, 10)
            .withAutoRangeMode(AutoRange.Never)
            .withAxisBandsFill(5)
            .withDrawMajorBands(true)
            .withAxisId("XAxis")
            .build();

    DoubleValues pressureRange = new DoubleValues(); pressureRange.add(-10); pressureRange.add(65);
    DoubleValues flowRange = new DoubleValues(); flowRange.add(-150); flowRange.add(+250);
    DoubleValues volumeRange = new DoubleValues(); volumeRange.add(-500); volumeRange.add(1000);

    final NumericAxis yAxisPressure = generateYAxis(pressureId, getMinMaxRange(pressureRange));
    final NumericAxis yAxisFlow = generateYAxis(flowId, getMinMaxRange(flowRange));
    final NumericAxis yAxisVolume = generateYAxis(volumeId, getMinMaxRange(volumeRange));

    UpdateSuspender.using(chart, new Runnable() {
        @Override
        public void run() {
            Collections.addAll(chart.getAnnotations(),
                    sciChartBuilder.newTextAnnotation()
                            .withXAxisId("XAxis")
                            .withYAxisId(pressureId)
                            .withY1(0d)
                            .withFontStyle(18, ColorUtil.White)
                            .withText(" Pressure (cm H2O)")
                            .build(),
                    generateBaseLines(pressureId),
                    sciChartBuilder.newTextAnnotation()
                            .withXAxisId("XAxis")
                            .withYAxisId(flowId)
                            .withY1(0d)
                            .withFontStyle(18, ColorUtil.White)
                            .withText(" Flow (lpm)")
                            .build(),
                    generateBaseLines(flowId),
                    sciChartBuilder.newTextAnnotation()
                            .withXAxisId("XAxis")
                            .withYAxisId(volumeId)
                            .withY1(0d)
                            .withFontStyle(18, ColorUtil.White)
                            .withText(" Volume (ml)")
                            .build(),
                    generateBaseLines(volumeId)
            );
            Collections.addAll(chart.getXAxes(), xAxis);
            Collections.addAll(chart.getYAxes(), yAxisPressure, yAxisFlow, yAxisVolume);
            Collections.addAll(chart.getRenderableSeries(),
                    MainActivity.this.generateLineSeries(pressureId, pressureDataSeries, sciChartBuilder.newPen().withColor(Color.parseColor("#00ff00")).withThickness(1.5f).build()),
                    MainActivity.this.generateLineSeries(pressureId, pressureSweepDataSeries, sciChartBuilder.newPen().withColor(Color.parseColor("#00ff00")).withThickness(1.5f).build()),
                    MainActivity.this.generateScatterForLastAppendedPoint(pressureId, lastPressureSweepDataSeries),

                    MainActivity.this.generateLineSeries(flowId, flowDataSeries, sciChartBuilder.newPen().withColor(Color.parseColor("#ff6600")).withThickness(1.5f).build()),
                    MainActivity.this.generateLineSeries(flowId, flowSweepDataSeries, sciChartBuilder.newPen().withColor(Color.parseColor("#ff6600")).withThickness(1.5f).build()),
                    MainActivity.this.generateScatterForLastAppendedPoint(flowId, lastFlowDataSeries),

                    MainActivity.this.generateLineSeries(volumeId, volumeDataSeries, sciChartBuilder.newPen().withColor(Color.parseColor("#FFEA00")).withThickness(1.5f).build()),
                    MainActivity.this.generateLineSeries(volumeId, volumeSweepDataSeries, sciChartBuilder.newPen().withColor(Color.parseColor("#FFEA00")).withThickness(1.5f).build()),
                    MainActivity.this.generateScatterForLastAppendedPoint(volumeId, lastVolumeDataSeries)
            );
            chart.setLayoutManager(new DefaultLayoutManager.Builder().setRightOuterAxesLayoutStrategy(new RightAlignedOuterVerticallyStackedYAxisLayoutStrategy()).build());
        }
    });
}

private HorizontalLineAnnotation generateBaseLines(String yAxisId) {
    return sciChartBuilder.newHorizontalLineAnnotation().withStroke(1, ColorUtil.White).withHorizontalGravity(Gravity.FILL_HORIZONTAL).withXAxisId("XAxis").withYAxisId(yAxisId).withY1(0d).build();
}

private NumericAxis generateYAxis(String id, DoubleRange visibleRange) {
    return sciChartBuilder.newNumericAxis().withAxisId(id).withVisibleRange(visibleRange).withAutoRangeMode(AutoRange.Never).withDrawMajorBands(false).withDrawMinorGridLines(true).withDrawMajorGridLines(true).build();
}
private FastLineRenderableSeries generateLineSeries(String yAxisId, IDataSeries ds, PenStyle strokeStyle) {
    FastLineRenderableSeries lineSeries = new FastLineRenderableSeries();
    lineSeries.setDataSeries(ds);
    lineSeries.setPaletteProvider(new DimTracePaletteProvider());
    lineSeries.setStrokeStyle(strokeStyle);
    lineSeries.setXAxisId("XAxis");
    lineSeries.setYAxisId(yAxisId);
    return lineSeries;
}
private IRenderableSeries generateScatterForLastAppendedPoint(String yAxisId, IDataSeries ds) {
    final EllipsePointMarker pm = sciChartBuilder.newPointMarker(new EllipsePointMarker())
            .withSize(4)
            .withFill(ColorUtil.White)
            .withStroke(ColorUtil.White, 1f)
            .build();

    return sciChartBuilder.newScatterSeries()
            .withDataSeries(ds)
            .withYAxisId(yAxisId)
            .withXAxisId("XAxis")
            .withPointMarker(pm)
            .build();
}

private static DoubleRange getMinMaxRange(DoubleValues values) {
    final DoubleRange range = new DoubleRange();
    SciListUtil.instance().minMax(values.getItemsArray(), 0, values.size(), range);
    range.growBy(0.1, 0.1);
    return range;
}

   // Appending to data series with:
    UpdateSuspender.using(MainActivity.chart, new Runnable() {
        @Override
        public void run() {
            MainActivity.pressureDataSeries.append(x, ppA);
            MainActivity.pressureSweepDataSeries.append(x, ppB);

            MainActivity.flowDataSeries.append(x, vFlowA);
            MainActivity.flowSweepDataSeries.append(x, vFlowB);

            MainActivity.volumeDataSeries.append(x, vtfA);
            MainActivity.volumeSweepDataSeries.append(x, vtfB);

            MainActivity.lastPressureSweepDataSeries.append(x, pp);
            MainActivity.lastFlowDataSeries.append(x, vFlow);
            MainActivity.lastVolumeDataSeries.append(x, vtf);
        }
    });

`

0 votes
8k views

Hello, I am trying to use the default DataPointSelectionModifier on a line chart with a DataSeries of type XyDataSeries<‘DateTime, double’> as in the example suite HERE . It seems to work fine out of the box if the DataSeries is of type XyDataSeries<‘double, double’>. Am I missing something as to why this modifier is not working with the former data type?

Relevent code is:

CustomChart.xaml:

<sci:SciChartSurface x:Name="customChart"
                         Grid.Column="0">
        <sci:SciChartSurface.RenderableSeries>

            <sci:FastLineRenderableSeries Name="lineRenderableSeries"
                                          Stroke="#4AB748"
                                          StrokeThickness="1">
                <sci:FastLineRenderableSeries.PointMarker>
                    <sci:EllipsePointMarker Fill="#138A43" />
                </sci:FastLineRenderableSeries.PointMarker>
                <sci:FastLineRenderableSeries.SelectedPointMarker>
                    <sci:EllipsePointMarker Fill="#C4ECA0"
                                            Width="12"
                                            Height="12" />
                </sci:FastLineRenderableSeries.SelectedPointMarker>
            </sci:FastLineRenderableSeries>
        </sci:SciChartSurface.RenderableSeries>

        <!--  Create an X Axis with GrowBy  -->
        <sci:SciChartSurface.XAxes>
            <sci:CategoryDateTimeAxis DrawMajorBands="True"
                                      GrowBy="0.1, 0.1"
                                      AxisAlignment="Bottom" />
        </sci:SciChartSurface.XAxes>

        <!--  Create a Y Axis with GrowBy.-->
        <sci:SciChartSurface.YAxis>
            <sci:NumericAxis DrawMajorBands="False"
                             GrowBy="0.5, 0.5"
                             CursorTextFormatting="$0.00"
                             TextFormatting="$0.00" />
        </sci:SciChartSurface.YAxis>

        <!-- Setting IsEnabled enables or disables a modifier in the Toolbar -->
        <sci:SciChartSurface.ChartModifier>
            <sci:ModifierGroup>

                <sci:DataPointSelectionModifier Name="PointMarkersSelectionModifier"
                                                IsEnabled="True"
                                                SelectionFill="#B1B5B2B2"
                                                SelectionStroke="#009E9C9C" />
            </sci:ModifierGroup>
        </sci:SciChartSurface.ChartModifier>


    </sci:SciChartSurface>

CustomChart.xaml.cs:

private void OnDataSeriesChanged(DependencyPropertyChangedEventArgs e)
    {
      var inputDataSeries = e.NewValue as XyDataSeries<DateTime, double>;

        var dataSeries = new XyDataSeries<DateTime, double>();

        dataSeries.Append(inputDataSeries.XValues, inputDataSeries.YValues, dataSeries.YValues.Select((x) => new MyMetadata { IsSelected = false }));

        lineRenderableSeries.DataSeries = dataSeries;

    }

MyMetaData.cs:

public class MyMetadata : IPointMetadata
{
    public event PropertyChangedEventHandler PropertyChanged;
    public bool IsSelected { get; set; }
}

With this implementation I am able to individually select datapoints and select multiple datapoints with ctrl/shift but am unable to drag select multiple datapoints.

If, as in the example suite, I change the default XAxis to:

<sci:SciChartSurface.XAxis>
            <sci:NumericAxis 
                             DrawMajorBands="True"
                             GrowBy="0.1, 0.1"
                             CursorTextFormatting="0" />
        </sci:SciChartSurface.XAxis>-->

and of course change all the relevant datatypes in CustomChart.xaml.cs from XyDataSeries<‘DateTime, double’> to XyDataSeries<‘double, double’> everything behaves as expected.

Am I missing something to make the DragSelection work out of the box with the former data type without having to make a custom modifier?

Thank you in advance for your help.

  • Leland asked 4 years ago
  • last active 4 years ago
0 votes
5k views

Hello

I have an XyDataSeries<DateTime, double> series, and it has filled some data. In runtime I would like to change a DateTime value on X axis (olddatetime to newdatetime). How can I do that?
Now I use solution that I remove the old XY data belongs to olddatetime and add a new XY data with newdatetime and same value. This solution works fine, but I don’t know is there a simpler solution for this?
I didn’t find any update method of XyDataSeries class which can updates an X value.
I tried the simple : XValues[olddatetimeidx] = newdatetime but problem is that SciChart surface doesn’t refresh, and I didn’t find any method that refresh all XY data.
Thank you

0 votes
0 answers
7k views

I need z data in DataSeries using LineAnnotation.

Note:
Z data of blue areas 0
Z data of green areas 50

Any help? Thank you.

0 votes
4k views

Is there a way to remove space in xydataseries? Lets say I have a datetime,double xydataseries. If there is a gap in time it shows on chart. Is there an easy way to remove that? I know I could make it double, double and just increment a value for the first. Problem is that I would like to preserve the datetime to display in a rollover modifier.

  • John asked 4 years ago
  • last active 4 years ago
1 vote
10k views

Hello,

I am trying to add series to a linechart, however I seem to be unable to create a XyDataSeries in Kotlin I have tried the following:

private val linedata = XyDataSeries<Double, Double>().apply { fifoCapacity = FIFO_CAPACITY } 

// like from the ECG showcase example, this gives the error 
// "none of the functions can be called with the arguments called"

private val linedata2 : IXyDataSeries<Double, Double> =  XyDataSeries(Double.class, Double.class)

private var linedata3 : XyDataSeries<Double, Double> = XyDataSeries(Integer.class, Double.class).build()

This seems quite straightforward but I am unable to find a solution. Can you help me?

Kind regards,
Bart

0 votes
8k views

Hello is there way to update points in XyDataSeries without Garbage Collector call? Here is my code:

public void RefreshSignal(float[] xData, float[] yData)
{
        if (_series == null)
        {
             _series = new XyDataSeries<float, float>();
            _series.Append(xData, yData);
        }

         for (int i = 0; i < xData.Length; i++)
         {
               _series.Update(xData[i], yData[i]);
         }
}

I may use _series.YValues[i], but then UI will not update.

Main task for me fast update all 25k points in series each 30ms without GC calls.

0 votes
5k views

To whom this may concern:

I would like to create a custom data series where I can manipulate the X-Values more efficiently for a ColumnRenderableSeries, where if I remove a column from the chart or there is a gap in the data, I won’t have any spaces between any of the columns in the chart. I also haven’t found any documentation on creating a custom data series.

My approach is to treat the X values like a stack.
– If a point is appended, a value is pushed to the X values stack and the Y values list.
– If a point is to be removed using RemoveAt(), it only removes the Y-Axis value from the index and pops the X values stack so the order and spacing of the x-values remain the same.

This is similar to Microsoft Excel, where removing a data row linked to a chart deletes the X-axis value instead of leaving a gap.

My thinking is making the following derivation of XYDataSeries (in C# pseudocode):

ColumnDataSeries<TY> : XyDataSeries<int, TY> where TY : IComparable
{
    Stack<IComparable> XValues { get; set; }
    IList<IComparable> YValues { get; set; }

    Append (T value) 
    {
        XValues.Push (XMax + 1);
        YValues.Add (value);
    }

    RemoveAt (int index) 
    {
        XValues.Pop ();
        YValues.RemoveAt (index);
    }
}

Can you please advise or provide any documentation for this?

Thank you, and best regards!

— Ari

Edit: Sorry if the code doesn’t look right, I don’t know how to properly wrap C# code on the forums.
Edit 2: Second attempt at posting code. Should see the generics now.

  • Ari Sagiv asked 5 years ago
  • last active 5 years ago
0 votes
6k views

My group is evaluating SciChart for high performance realtime charting. We are testing line renderer with XyDataSeries.
We were able to get good performance, but we need to squeeze more and our scenario is a bit different from how XyDataSeries is used.

To make a long story short, we cannot append, because our application has 2 strict requirements:

  • every data refresh we need to ditch the whole dataset and replace it
    with a new (usually larger) one (no append)
  • we need to display each refresh immediately, even if it means delaying user input (so Immediate. Or Manual with a refresh after
    every step).

which means put in XyDataSeries a new set of points at every step. This means either do:

var dataSeries = new XyDataSeries<double, float>(samples.Length)
dataSeries.Append(domain, samples);
m_renderableSeries.DataSeries = dataSeries;

or :

dataSeries.Clear();
dataSeries.Append(m_domain, samples);

(btw, the first one is slightly faster, 190ms vs 240ms to draw 10 million points)

Which is obviously working against how XyDataSeries is implemented.
A faster way would be to just do

var dataSeries = new ReadOnlyXyDataSeries(domain, samples);
m_renderableSeries.DataSeries = dataSeries;

Where ReadOnlyXyDataSeries just takes the samples array and without any copy makes it available to the renderer.
So I implemented ReadOnlyXyDataSeries as a IXyDataSeries<double, float>.

To my surprise however this performs much worse (900ms to draw 10
million points), while it should perform better (it is really just a
XyDataSeries without copy)

UPDATE: This is not true: I was setting IsSortedAscending = false on sorted data. Once I put it to true, preformances are back to exactly the same performance as XyDataSeries . Which is good but not stellar.

(hack time) I know there is room for performances, because I made the following (hacky, brutal, very bad) thing:

var internalList = (ISciList<float>)dataSeries.YValues;
Array.Copy(samples, internalList.ItemsArray, samples.Length);

instead of the Clear/Append pair, and it is much faster (30ms are shaved off). No copy should be even faster.

Obviously I am missing something. So, what am I missing? How should I implement a custom IXyDataSeries in a fast way? Is there another way?

0 votes
11k views

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

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

I init my bottom graph like this :

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

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

        audioStreamSciChart.getYAxes().add(yAxis);

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

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

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

Thanks,
Wavely

1 vote
9k 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
11k views

Hallo,

I have a problem with drawing of 2d data in a map. The metadata for the respective points change when you zoom in or move the map.

LandmarkCollection landMarks = new LandmarkCollection();
            NAVLandmarkCollection landmarkCollection = NAVLandmarkCollection.Deserialize(@"C:\Users\Serva_admin\Documents\AGV-Viso\VS_Projekte\AGV-Viso-2\AGV-Viso-2\16-02-06-18-23-ING.lmf");
            for (int i = 0; i < landmarkCollection.Count; i++)
            {
                NAVLandmark lm = landmarkCollection.get(i);
                landMarks.Landmarks.Append(lm.X, lm.Y, new Serva.Base.Navigation.Client.NavigationPlugin.MetaData.LandmarkName("G-" + i, lm.X, lm.Y));
            }

            communicationBus.Publish(landMarks);

This function is called once and the data does not change anymore.

I uploaded the pictures of my problem in the attachment.
You can see the Name of the Point in the top-left corner changed.

I hope you can me help.

  • Tim Nowak asked 5 years ago
  • last active 5 years ago
1 vote
8k views

I saw in the examples where a “gain” and “loss” affected the color of a series. This took a bit of time; however, I figured out was you were doing and was able to implement it.

Please see the attached image. There are 2 sections in my series that are “Green” whereas the remainder of the series is gray. I’d like to be able to do 2 things ONLY to the green area.

  • Show point markers ONLY on the points in the green area.
  • Increase the stroke thickness.
0 votes
12k views

How can I append a float array to an XYDataSeries?

I’m developing an app with scichart. I receive buffers of 20 floats in a float[] type. How can I append this buffer to an XYDataSeries? The chart is updated in real time each time one Buffer is received with FIFO capacity.

What I need is something similar to:

void updateChart(final float[] a, final float[] b) {
    UpdateSuspender.using(surface, new Runnable() {
            @Override
            public void run() {
                // Append the new data received
                lineData.append(a,b);
                // Zoom series to fit the viewport to the x variable
                surface.zoomExtentsX();
            }
        });
}

Is this possible?
Thank you in advance

0 votes
10k views

I have introduced a real time chart in my WPF Application. The chart starts plotting points from the left of the chart ( close to Y-Axis).

I would like it to start plotting from the right of the chart ( Away from Y-Axis) and as when points start adding up, I would like the points to slide to the left ( Towards Y-Axis).

Similar to how performance tab in Task Manager displays the CPU utilization.

0 votes
8k views

Looking at the documentation I’ve figured out how to style the content of the tooltip. But I can’t seem to figure out how to style the container.

You can see in the attached image the automatic blue background that matches the series. I would like to style it with our own style which is the dark background and then BorderBrush that matches the series color.

<DataTemplate x:Key="DigitalToolTipTemplate" DataType="s:XySeriesInfo">
                    <Border Style="{StaticResource BorderStyle}" BorderBrush="{Binding Stroke}">
                        <TextBlock Text="{Binding SeriesName, StringFormat='{}{0}'}" />
                    </Border>
                </DataTemplate>

This seems to style only the inner contents of the tooltip but not the whole tooltip.

Also note the BorderBrush binding (not sure if this is correct to get the series color).

Update
Now using the following code (which is working) — Now the only thing I need to figure out is what to bind for the stroke to get the series color as the border stroke.

<Style x:Key="DigitalToolTipStyle" TargetType="s:TooltipControl">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="s:TooltipControl">
                                <Border Style="{StaticResource BorderStyle}" BorderBrush="{Binding Stroke}">
                                    <ContentPresenter Content="{TemplateBinding DataContext}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
0 votes
15k views

Hi I currently do need to get two things for which I currently have no clue how to get it.

I’m using FastLineRenderableSeries and XyDataSeries<double,double> in SciChart 2D.

1st: The absolute min and max values from an curve.

What I found is that I can get the YMax/YMin and XMax/XMin, but that is not what I need.

-> I need to get the “Point” (x, and y value) where the maximum/minimum is.

2nd: I Need the X-value of an Y-Value (or the list of x-values if the y-value does exist more than once).
Lets say I have the y-Value “5” and want to know at which x-value this is.

Is there a fast and elegant way to get this information from existing RenderableSeries via the SciChart API, or Do I need to get this information from my data source before appending the curves?

Thanks,
Ben

  • Bernd Held asked 7 years ago
  • last active 7 years ago
1 vote
9k views

Hello.

In my 2D scatter chart, I’d like to set markers in a defined region of x and y to a different colour from the rest of the markers. I know I can do this with two data series (where one series is for the points within the region, and the other series is for all the other points) but is there a way to do it with one data series?

I was expecting to be able to do it in a similar way as I did it for a 3D scatter, setting the colour of the marker when I append it to the series:

xyzDataSeries3D.Append(x, y, z, new PointMetadata3D(color, 1));

Thanks for any help,
Daryl.

0 votes
12k views

Is there an convenient way to convert an existing IXyDataSeries<Date, Double> to IOhlcDataSeries<Date, Double> ?
How do Scichart collapse Candlesticks (and presumably merging with neighbouring candlesticks) when its very zoomed out e.g. 1 year period

  • abc def asked 7 years ago
  • last active 7 years ago
0 votes
7k views

Here’s the situation:
Our app has a viewmodel with an XyDataSeries Property bound to the plot. We’ve overridden DataPointSelectionModifer to allow us to trigger calculations when the selected points are changed. This overridden modifier is not instantiated by nor is it directly aware of the viewmodel; it is referenced only in the view xaml.

When changing between datasets we replace the contents of the XyDataSeries Property. Afterwards we are experiencing NullReferenceExceptions in DataPointSelectionModifier.SelectManyPoints(). This occurs whether we replace the contents of the data series or we set a completely new XyDataSeries object into the property.

It appears that the DataPointSelectionModifier.SelectedPointMarkers collection is no longer properly synced to the plot’s XyDataSeries. The size of the the collections are different and with the original DataSeries being garbage-collected the DataPointInfo.DataPointMetadata references are null. So we attempt to dial in a new selection and the deselection of this orphaned null metadata raises exceptions.

Is there some secret-sauce to keeping these collections in line?
Any and all suggestions are greatly appreciated.

1 vote
12k views

I have a WPF application where I am using SciChart to display data placed in an XyDataSeries, which is contained in a FastLineRenderableSeries.

I also have a ListView that displays the same data.

I want to place a marker on the data point selected by the user from the ListView. I would like to use the inverted triangle as the marker.

I know how to identify the item in the data series, but how do place a marker on that single point in the data series?

Thanks,
Dave

  • Dave Leach asked 8 years ago
  • last active 8 years ago
0 votes
8k views

Hi!

I’m having an issue with ZoomExtentsY, where it throws the exception InvalidOperationException.

My software reads sensordata from a stream and appends this data to the SciChart XyDataSeries<DateTime, double>.
I’m plotting a moving window of the data +/- 5 seconds which moves at 1 x speed of time forward. I use ZoomExtentsY to make the moving window show all the available data in that +/- 5 second segment in the Y-direction.

As I haven’t found any pattern on when/why the exception happens, it occurs rather random. Sometimes I can playback fine, but other times the exception happens within seconds of opening the SciChart-plot.

The exception message was: ‘Enumerator version is invalid’

Here is the StackTrace:


at A.1..()
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source)
at Abt.Controls.SciChart.Model.DataSeries.DataSeries2.ZB(IRange C, SearchMode D, SearchMode I)
at Abt.Controls.SciChart.Model.DataSeries.DataSeries2.GetWindowedYRange(IRange xRange, Boolean getPositiveRange)
at Abt.Controls.SciChart.Visuals.RenderableSeries.BaseRenderableSeries.GetYRange(IRange xRange, Boolean getPositiveRange)
at Abt.Controls.SciChart.Visuals.Axes.AxisBase.GetWindowedYRange(IDictionary2 xRanges)
at Abt.Controls.SciChart.Visuals.SciChartSurface.ZB(IDictionary2 C, TimeSpan D
at Abt.Controls.SciChart.Visuals.SciChartSurface.ZoomExtentsY()


Best regards
Lars

  • Stian Dahl asked 8 years ago
  • last active 8 years ago
1 vote
14k views

I have a lot of data to process and I don’t want UI to get frozen. So I’d like to add data in a background thread.

Is it possible to append data to XyDataSeries in a separate thread? Is it supposed to handle this safely?

2 votes
17k views

Hi,
I have some XyDataSeries<DateTime, double> showing some data on my chart. Also I have 2 vertical line annotations (red and blue) where I know the two DateTime values.

Is there a effective way to get the double values between this range of each XyDataSeries.

Regarrds Markus

Showing 33 results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies