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

0 votes
0 answers
40 views

Hello,

We need to add a label with the value of the yAxis on top of all Point Markers. There is an example on WPF, but found nothing on iOS.

How can we achieve that?

0 votes
0 answers
35 views

We’re adding data to a data series form a background thread. We noticed that on some hardware (especially notebooks) the sci chart surface is not updated. Only a window rezise forces an screen update.

We enabled sci chart logging and debugging, but we didn’t see any suspicious logging output.
The data are being added within a block like this:
using (dataSeries.SuspendUpdates)
{
dataSeries.Append(…)
}

The strange thing is, that the x-Axis labeling gets updated (range change), but dataSeries Content won’t be drawn on some machines (more often on notebooks)

Do you have any idea what could lead to this behaviour?

Thanks in advance!
Gerhard

0 votes
38 views

Hello,

As you have already the examples of the EEG -50 channel, Is it possible to set the sensitivity factor for the channels to show the graph.
Basically, this will set the amplitude based on the frequency variation example 7micro volts/millimeter (7microvolts/mm) for each channel. Is there any way we can do it using Scichart, please let us know.

Appreciate your help

Regards,
Aditya

0 votes
36 views

Hi,
I have been using the sci chart for more than 2 months and now I have a problem.
I have an x-axis and multiple y-axes, I want to make my chart scalable with custom values.
Now , I am manually bind major delta and minor delta to control the Axis scale and Autoticks property set to false.
Is there any other way to implement this functionality?

  • ats ta asked 3 days ago
  • last active 3 days ago
0 votes
0 answers
32 views

I use stacked bar chart.
I want to know How to add lines between stacked columns/bars.

How to add lines between stacked columns/bars [Excel charts]

0 votes
41 views

Hello Friends,

I'm looking a solution where i can change Y-Axis range in between (0.1,0.2,0.4,0.6,0.8,1.0) .

I appreciate any help for above question

Thanks
Vasim

0 votes
0 answers
97 views

There are no simple macOS tutorial projects, so I transplant ios “Tutorial 01 Create Simple 2D Chart” to macOS one. (Attached file.)

Build and Run successfully. But no appear the coded chart. It seems that only SCIChartSurface is being displayed. (without axis and line series)
I enabled SciChart Console Debugging and got like this.

2021-09-17 20:48:06.077950+0900 StoryboardTest[75014:920684] [INFO] - [SCIAxisBase] isSuspended = YES. Ignoring `invalidateElement:` call
2021-09-17 20:48:06.078006+0900 StoryboardTest[75014:920684] [INFO] - [SciChartSurfaceBase] IsSuspended=YES. Ignoring `invalidateElement:` call

Why doesn’t the chart show up? Would you mind giving me some advice?

P.S.
It seems that the file was not attached properly.
Please download the file from here.
https://drive.google.com/file/d/1YfJIf0G14QOxA0fzmEQXyAEbPrfMx4CU/view?usp=sharing

0 votes
75 views

When I work with the 2D Android Heatmap Chart, I want to draw a frame on the borders of the cells. Is this possible?

Thanks already for your help.

0 votes
0 answers
50 views

Is it possible with SciChart to generate a Nonuniform Heatmap where the xRangeMapping values depend on the y value, and vice versa? We are mapping a spherical data series to a “flat” projection and would like to present this as a 2D heatmap. That is, we are converting latitude/longitude coordinates to Cartesian, then projecting the +Z hemisphere onto a 2D surface. I’ve attached a screenshot of the mapping of (lat, lon) to (x, y). Any suggestions are greatly appreciated!

0 votes
93 views

Hi

I have added 24 Line graphs for EEG. Now I want to display the name of each channels against each graph. I am using Y steeped graph which you are using for Vital signs display in example code. Can you please let me know how to t to display the name of each channels against each graph

Best Regards,
Aditya

0 votes
76 views

I am wondering if there may be some guidance on how to configure the styles for the SciChart.js chart instance in a React application to be able to handle dynamic changes to the height value.

The scenario is that the chart and wasm context are being saved in refs, so that the component the chart exists within does not rerender. Data is being consumed via a web socket, and streaming realtime data.

All that is well and good, but trying to implement a new feature request where the height of the chart changes dynamically, similar to an accordion style where the chart may have a full view, a split view, or no view (92vh, 46vh, 0vh)

I am finding that my css styles are not applying, or frustratingly will apply seemingly at random and other times not apply even though the underlying code remains the same. I tried to override, or at least alter, the position absolute styles of the canvas, by wrapping it in a parent element with position relative, which works to keep the height and width of the chart as desired, but the aspect ratio seems to falter and the chart axes are blurred and illegible.

I’m sure this would be a great instance of a picture says a 1000 words, and I am nearing a 1000 words. Will try to attach a codepen/ example that demonstrates the issue I am experiencing.

If there are any tips or tricks you would recommend please advise

0 votes
69 views

Hi,

Can you please tell me how to show an annotation(extends at BoxAnnotation(x1, y1, 2, y2)) that starts at a certain point(x1, y1) and ends at the end of the chart. That is, the starting point (x1) is known, and the end point (x2) at the very end of the surface (graph)?
Thanks in advance.

Regards,
Batyr

0 votes
73 views

Is is possible to have a fixed aspect ratio for a 3D chart? I have found suggestions for 2D charts but not 3D. I want the X,Y,Z axes to all scale the same despite having different visible ranges. This means that the lengths of the axis should be different.

  • Myles H asked 2 weeks ago
  • last active 2 weeks ago
0 votes
64 views

I am using FastLineRenderableSeries with DateTimeAxis for X-axis.

And, I’m using mouse event to get X-axis value use clicked by mouse.

I’m using code below.

Put vertical line at chart where nearest X value exists, when mouse button clicked

But sometimes MouseButtonEventArgs.GetPosition takes time.

Code like this.

        private void chartSurface_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
                    if (isInitialized == false) return;

                    PerformanceAnalyzer.Start("chartSurface_PreviewMouseDown");

                    // Get mouse point
                    var mousePoint = e.GetPosition(chartSurface);

                    PerformanceAnalyzer.Check("e.GetPosition(chartSurface)");
        }

Normally.
Performance analyze start:2021/09/09 10:55:47 chartSurface_PreviewMouseDown
Performance analyze check:2021/09/09 10:55:47 elapsed:00:00:00.0027280 e.GetPosition(chartSurface)

When slow
Performance analyze start:2021/09/09 10:55:48 chartSurface_PreviewMouseDown
Performance analyze check:2021/09/09 10:55:48 elapsed:00:00:00.4303424 e.GetPosition(chartSurface)

Is there any good way to get more good and stable performance?

0 votes
77 views

editable box annotation

Hi,

Can you please tell me how to change selection points of annotation?

Thanks in advance.

Regards,
Batyr

0 votes
83 views

Hello,
I am working on a chart that contains a number of StackedColumnRenderableSeries. Each series has a unique StackedGroupId set so all of the columns display side-by-side (“grouped” mode). I have attached a screenshot of what the chart currently looks like.

The Y-values in the chart are each an average of several collected data values, so I would like to be able to include the standard deviations as error bars drawn over each column, with the center at the top of the column and the high and low values set to center+SD and center-SD.

What would be the best approach to do this? The first thing that comes to mind for me is to create a new class StackedColumnRenderableSeriesWithErrorBars which derives from StackedColumnRenderableSeries, override InternalDraw, and add the drawing of error bars to InternalDraw after calling base.InternalDraw. Of course this would only work as long as the DataSeries is an HlcDataSeries instead of an XyDataSeries.

I also considered an approach that involved overriding/modifying FastErrorBarsRenderableSeries to essentially add a “grouped” mode, but I’m not sure there’s a good way to add that.

I believe the StackedColumnRenderableSeriesWithErrorBars approach will work, but I want to make sure I’m not missing a simpler approach that I could take instead. Any help would be greatly appreciated.

Thank you!

UPDATE: I have it working to the point where it draws the error bars, but the X coordinate is always in the middle of the group, rather than being centered in the middle of the column. I assume I need to make use of the Wrapper (IStackedColumnsWrapper) in the StackedColumnRenderableSeries to shift the X coordinate, but I’m having a little trouble figuring out exactly how. Here is what I have thus far:

public class StackedColumnRenderableSeriesWithErrorBars : StackedColumnRenderableSeries
{
    public bool ShowErrorBars { get; set; } = false;

    protected override void InternalDraw(IRenderContext2D renderContext, IRenderPassData renderPassData)
    {
        base.InternalDraw(renderContext, renderPassData);

        // Now that the main drawing of the StackedColumnRenderableSeries is done, draw the error bars (if applicable).
        if (ShowErrorBars)
        {
            // The resampled data for this render pass
            // Don't try to draw error bars if the PointSeries isn't an HlcPointSeries.
            if (renderPassData.PointSeries is not HlcPointSeries dataPointSeries)
            {
                return;
            }
            ICoordinateCalculator<double> xCalc = renderPassData.XCoordinateCalculator;
            ICoordinateCalculator<double> yCalc = renderPassData.YCoordinateCalculator;

            // Iterate over the point series
            for (int i = 0; i < dataPointSeries.Count; i++)
            {
                // Get the values
                double x = dataPointSeries.XValues[i];
                double high = dataPointSeries.HighValues[i];
                double low = dataPointSeries.LowValues[i];

                // Transform to coordinate
                double xCoord = xCalc.GetCoordinate(x);
                double highCoord = yCalc.GetCoordinate(high);
                double lowCoord = yCalc.GetCoordinate(low);

                // TODO: Use Wrapper to transform the X coordinate based on where in the group this column is.

                // TODO: Set cap width based on column width
                double capWidth = 10;

                using IPen2D pen = renderContext.CreatePen(Colors.Black, true, 2);
                // Draw vertical line
                renderContext.DrawLine(pen, new Point(xCoord, highCoord), new Point(xCoord, lowCoord));
                // Draw top cap
                renderContext.DrawLine(pen, new Point(xCoord - (capWidth / 2), highCoord), new Point(xCoord + (capWidth / 2), highCoord));
                // Draw bottom cap
                renderContext.DrawLine(pen, new Point(xCoord - (capWidth / 2), lowCoord), new Point(xCoord + (capWidth / 2), lowCoord));
            }
        }
    }
}
0 votes
85 views

Hello

We want to implement a chart like Step line i.e. for each trade we have a line from trade’s entry to exit time. Similar to Gantt chart type.

can you provide some way to implement this type of chart using Scichart?

Thanks,
Parthiv

0 votes
90 views

Hello,

I have an x-axis of type DateTime. Now I need to change that x-axis to show data in different intervals like Daily, Weekly, Monthly, continuous axis, and discontinuous axis at runtime.

Can you help me to guide on how can we achieve this. Also, any code reference would be really helpful.

Thanks,
Parthiv

0 votes
71 views

We are adding 24 channel data Live graph using Scichart Example of Vital sign monitor. We are using VitalSignsMonitorShowcaseFragment.java example.

To show the live graph, do we need to accumulate the data for 50 point or so. I see in the code they are accumulating?

Is it necessary for the accumulation, please let us know

protected void initExample(ExampleVitalSignsMonitorFragmentBinding binding) {
    final DefaultVitalSignsDataProvider dataProvider = new DefaultVitalSignsDataProvider(getActivity());

    setUpChart(dataProvider);

    dataProvider.getData().buffer(50, TimeUnit.MILLISECONDS).doOnNext(ecgData -> {
        if(ecgData.isEmpty()) return;

        dataBatch.updateData(ecgData);

        UpdateSuspender.using(binding.surface, () -> {
            final DoubleValues xValues = dataBatch.xValues;

            ecgDataSeries.append(xValues, dataBatch.ecgHeartRateValuesA);
            ecgSweepDataSeries.append(xValues, dataBatch.ecgHeartRateValuesB);

            bloodPressureDataSeries.append(xValues, dataBatch.bloodPressureValuesA);
            bloodPressureSweepDataSeries.append(xValues, dataBatch.bloodPressureValuesB);

            bloodOxygenationDataSeries.append(xValues, dataBatch.bloodOxygenationA);
            bloodOxygenationSweepDataSeries.append(xValues, dataBatch.bloodOxygenationB);

            bloodVolumeDataSeries.append(xValues, dataBatch.bloodVolumeValuesA);
            bloodVolumeSweepDataSeries.append(xValues, dataBatch.bloodVolumeValuesB);

            final VitalSignsData lastVitalSignsData = dataBatch.lastVitalSignsData;
            final double xValue = lastVitalSignsData.xValue;

            lastEcgSweepDataSeries.append(xValue, lastVitalSignsData.ecgHeartRate);
            lastBloodPressureDataSeries.append(xValue, lastVitalSignsData.bloodPressure);
            lastBloodOxygenationSweepDataSeries.append(xValue, lastVitalSignsData.bloodOxygenation);
            lastBloodVolumeDataSeries.append(xValue, lastVitalSignsData.bloodVolume);
        });
    }).compose(bindToLifecycle()).subscribe();

    updateIndicators(0);
    Observable.interval(0, 1, TimeUnit.SECONDS, AndroidSchedulers.mainThread())
            .doOnNext(this::updateIndicators)
            .compose(bindToLifecycle()).subscribe();
}
0 votes
67 views

Hi,

I want to use a CursorModifier that snaps to series, but not all series. I can see the BaseRenderableSeriesViewModel has, for example, IncludeTooltipModifier, but there is no IncludeCursorModifier property so I haven’t been able to get it to work out of the box.
Is this a missing feature?
https://www.scichart.com/documentation/win/current/webframe.html#CursorModifier.html
https://www.scichart.com/documentation/win/current/webframe.html#TooltipModifier.html

Are there any work arounds? I was thinking of adding metadata to a series, but there is no metadata for the entire series, just a metadata for the point markers.

I also tried to create a class that inherits from, for example, LineRenderableSeriesViewModel, that has an IncludeCursorModifier, or similarly named property. The issue I had with that is that when I create my own inherited version of CursorModifer I only have access to the ParentSurface?.RenderableSeries which is not the ViewModel version of the series, and thus that information seems to be lost – I can’t cast a member of RenderableSeries to my custom MyLineRenderableSeriesViewModel, thus I can’t inspect whether it should be included in the cursor modifier.

I appreciate the help.

Matt

0 votes
0 answers
123 views

I’ve recently found out that for some particular charts ,the series is not completely visible for top and bottom most parts of the chart.I need to drag the axis to see those portions.do you any suggestions for this issue.I’ll attach some ss.

Thanks in Advance

1 vote
137 views

We want to add a toggle button to our chart, that changes the view range between zooming to a particular region of the graph and showing the whole dataset.
To achieve so, we have followed this post that suggests overriding the methods OnCalculateNewYRange and OnCalculateNewXRange inside a custom viewport manager https://www.scichart.com/documentation/win/current/webframe.html#ViewportManager%20-%20Full%20Control%20over%20Axis%20Ranges%20and%20Viewport.html

However, we have found that always overriding those methods does not work, because they get called when the user zooms and pans around the chart, where you want the default range to be returned, not our custom computed one.
Adding a flag to only override the methods when you click the button has also proven tricky, as those methods get called internally many times and it is difficult to control.
Is there an easier way to achieve this behaviour?

Our overridden methods look something along these lines:

/// <inheritdoc/>
    protected override IRange OnCalculateNewXRange(
        IAxis axis )
    {
        var computedRange = base.OnCalculateNewXRange( axis );

        if ( !( GetXLimitsForCurrentVisibleRangeLevel is null ) ) 
        {
            // Method that returns our computed visible range as a function of the toggle button state (CurrentVisibleRangeLevel )
           // Returns null when a flag indicates that it has already been called after the toggle button was clicked
            var newRange = GetXLimitsForCurrentVisibleRangeLevel( CurrentVisibleRangeLevel );
            return newRange ?? computedRange;
        }

        return computedRange;
    }    

Many thanks in advance!

Malu

  • malú Diaz asked 3 weeks ago
  • last active 3 weeks ago
0 votes
117 views

Hi,

In case of a column chart, would it be possible to display instead of a label, another control (for example a checkbox) under each column?

Thanks

0 votes
124 views

Hi, I’ve trying to run the charts in emulator and it works fine with recyclerview ,but when i try to render chart in a fragment it doesn’t shows.The same fragment render charts in device and issue with emulator.I’m using geny motion. Thanks in Advance

1 vote
135 views

Hello,

How can i convert my data to Y coordinate value in OhlsSeries?

Please advise. Thanks.

0 votes
131 views

Can I place axis tick label text to right-aligned?

Sorry I can’t attach screen shot for my company’s security reason..

var yNumAxis = new NumericAxisViewModel
{
AxisAlignment = SciChart.Charting.Visuals.Axes.AxisAlignment.Left,
TickTextBrush = new SolidColorBrush(Colors.White),
TickLabelsOffset = 1,
DrawMajorGridLines = true,
MajorGridLinesBrush = new SolidColorBrush(Colors.LightGray),
FontSize = 12,
StrokeThickness = 1,
DrawMajorBands = false,
DrawMinorGridLines = false,
DrawMinorTicks = false,
VisibleRange = new DoubleRange(16, 23),
LabelProvider = this.YAxisLabelProvider
};

There is no property related TextAlignment

Please help me.

0 votes
174 views

Hi,

Can you please tell me do you have tool like https://www.scichart.com/documentation/win/current/webframe.html#Fibonacci%20Retracement%20Drawing%20Tool.html
on Android?
If not, please give me a sample code on how to implement this with scichart.
Thanks in advance.

Regards,
Batyr

0 votes
178 views

We are binding the IDataSeries property to the ViewModel and passing the changes to the UI with SetProperty in the INotifyPropertyChanged interface.
However, there is no problem in many PCs, but strange phenomena occur in certain laptops.
The chart moves only when the WPF window is at the maximum screen, and does not move when the WPF window is not at the maximum screen.

What should I do to solve this phenomenon?
The version of SCIChart I am using is v5.

Please refer to the attached video.

Answers I’ll wait.

thank you.

0 votes
185 views

Hi,

I,ve added ZoomExtentsModifier(), PinchZoomModifier() to the chart modifier.I want these modifiers on Xaxis only not on YAxis.Is possible to remove these modifiers on one axis.My requirement is that, during pinchzoom yaxis value needs to be constant

0 votes
198 views

Hi,

Our website is running on a web hosting service supported by the university. To work with the SciChart JS, do we have to install the npm and configure it accordingly? If so, we probably have to contact IT department for assistance, since we don’t have permission to do so.

Please advise. Thanks.

  • Gang Xu asked 1 month ago
  • last active 1 month ago
0 votes
153 views

Hello,

I was overriding the performZoom(at mousePoint: CGPoint, xValue: Double, yValue: Double) method of SCIPinchZoomModifier but it is not accessible anymore.

My Code:

import Foundation
import SciChart

public class FixedToCenterPinchZoomModifier : SCIPinchZoomModifier {

override func performZoom(at mousePoint: CGPoint, xValue: Double, yValue: Double) {
    let middle = CGPoint(x: parentSurface?.frame.midX ?? 0,
                         y: parentSurface?.frame.midY ?? 0)
    super.performZoom(at: middle, xValue: xValue, yValue: yValue)
}

}

I get the error: Method does not override any method from its superclass

Is there a way to access the protected method?

0 votes
207 views

Hi, I’ve been working on recyclerview with scichart.The problem i’m facing is that sometimes,when you come back from other screens the charts is not loading eventhough the other data in the list are showing.The list is placed inside a view pager .This issue is not consistant sometimes it shows the graph sometimes it won’t .The exception i’m getting are

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child’s parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:5260)
at android.view.ViewGroup.addView(ViewGroup.java:5089)

2021-08-17 14:50:52.639 15073-29533/com.fascilityconnex.voicemobile E/SciChart Rendering Errors: SciChartSurface has no XAxes. Please ensure SciChartSurface.XAxis is set, or SciChartSurface.XAxes has at least one axis
2021-08-17 14:50:52.641 15073-29531/com.fascilityconnex.voicemobile E/Exception: null
java.lang.UnsupportedOperationException: AxisCollection.getAxisById(‘DefaultAxisId’) returned more than one axis with the ID=DefaultAxisId. Please check you have assigned correct axis Ids when you have multiple axes in SciChart
at com.scichart.charting.model.AxisCollection.getAxisById(SourceFile:10)

1 vote
226 views

I am having problem instantiating SciChart.js within a specific project and was hoping you might be able to help. To provide context I can run SciChart fine in simple projects and I suspect that I have a webpack issue.

When running a simple graph instantiation such as –

import React, { useEffect } from "react";
import ReactDOM from "react-dom";
import { SciChartSurface } from "scichart/Charting/Visuals/SciChartSurface";
import { NumericAxis } from "scichart/Charting/Visuals/Axis/NumericAxis";

export function MipsGraph(props) {
    useEffect(() => {       
        initSciChart();
    });

    return (
        <div id="depthGraph" style={{height: "100%"}} ></div>
    );
}

async function initSciChart() {
    const { sciChartSurface, wasmContext } = await SciChartSurface.create("depthGraph");

    const xAxis = new NumericAxis(wasmContext);
    const yAxis = new NumericAxis(wasmContext);

    sciChartSurface.xAxes.add(xAxis);
    sciChartSurface.yAxes.add(yAxis);
}

I see the following error

Uncaught (in promise) RuntimeError: abort(TypeError:
WebAssembly.instantiate(): Import #0 module=”env” error: module is not
an object or function). Build with -s ASSERTIONS=1 for more info.

and the warning –

wasm streaming compile failed: TypeError: WebAssembly.instantiate():
Import #0 module=”env” error: module is not an object or function

The warning is raised at line 7544 (after pretty print in chrome dev tools) of scichart2d.js?formatted at a line calling WebAssembly.instantiateStreaming(e,d). both e and d have values.

Debugging originally led me to believe that there was an issue finding the scichart2d.wasm file however network traffic clearly shows the file being fetched.

Any ideas?

0 votes
183 views

Hi!

Part of our project is in labVIEW. It is very convenient to integrate Scichart as .Net assemblies into labVIEW.

Another part is C++ and CUDA, Windows only, Visual Studio 2019.
We can call scichart with managed C++ for .Net (C++/CLI).

Is there native API for C++ in Scichart?

Thanks

  • anton m asked 1 month ago
  • last active 1 month ago
0 votes
212 views

Dear team. We have a need to draw footprint chart, but your library didnt’t have opportunity to draw it. It will be good if you help us with recommendations in which direction we should move to build it. Thanks you a lot !

0 votes
164 views

When i try to add SCITextAnnotation and text color is white, a gray outline appears around the symbol (triangle).
How can I turn it off or change the color?

0 votes
201 views

I would like to add scroll listener on x axis title. Is it possible to add scroll to axis title

0 votes
173 views

When I’m viewing a chart from mobile browser, quality of graphics is very low.
I can see pixels and some blurred graphics on mobile browsers. But it’s completely ok on the desktop browsers.

I reproduced it with an official example:
https://demo.scichart.com/javascript-realtime-ticking-stock-charts

  • Roman Zio asked 2 months ago
  • last active 2 months ago
0 votes
206 views

It’s impossible to zoom a candlestick chart (other types as well) on mobile browsers & WebViews.
I’m trying to use pinch-to-zoom with my fingers on chart, but it doesn’t react on it. Only sliding on the left & right is possible.

I’ve even tried demo from documentation:
https://demo.scichart.com/javascript-realtime-ticking-stock-charts

The same is with my chart as well

How can I fix it?
Thank you

  • Roman Zio asked 2 months ago
  • last active 2 months ago
0 votes
181 views

I’m building a chart where I’m plotting range vs doppler and the range has some error in it. There is a need for me to show the upper and lower bounds of that error. The issue I’m having is that for this particular chart the range is the x value. I have an estimated range but I need to show that there is some error in it. How do I make the error bar horizontal? I saw in the Android SDK there is a method to set the error bar direction. Is there something I can do in WPF to change the orientation of the error bar?

0 votes
169 views

I am using sci charts to show live graphs of some devices. While displaying a graph on IPhone X or iPhone 6s it sometimes lags and lines started overlapping. It’s working fine on devices iPhone XSMax, iPhone 11. I have attached a 3 screenshots. Once when graph starts lagging, 2nd when graph is in middle, 3 when graph completes. please have a look. It starts lagging and overlapping lines when a new graph starts and when it ends it shows a complete graph shown and then again same issue repeats. It also started working correctly after some time. I need information about this issue. How to fix it and why it’s happening like this…

0 votes
190 views

When I open the activity with the chart , I see a black screen. And there is no graph displayed.
I have a trial license key which is valid.

Here is my full code:
xml file:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/chart_layout"
android:orientation="vertical">

Activity:

public class ECGMonitorFragment extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    try {
        com.scichart.charting.visuals.SciChartSurface.setRuntimeLicenseKey("");
    } catch(Exception e){

        Log.e("SciChart", "Error while accesing the license", e);
    }


    setContentView(R.layout.activity_ecgmonitor_fragment);



    // Create a SciChartSurface
    final SciChartSurface surface = new SciChartSurface(this);

    // Get a layout declared in "activity_main.xml" by id
    LinearLayout chartLayout = (LinearLayout) findViewById(R.id.chart_layout);

    // Add the SciChartSurface to the layout
    chartLayout.addView(surface);

    // Initialize the SciChartBuilder
    SciChartBuilder.init(this);

    // Obtain the SciChartBuilder instance
    final SciChartBuilder sciChartBuilder = SciChartBuilder.instance();

    // Create a numeric X axis
    final IAxis xAxis = sciChartBuilder.newNumericAxis()
            .withAxisTitle("X Axis Title")
            .withVisibleRange(-5, 15)
            .build();

    // Added in Tutorial #8 - two Y axes
    // Create a numeric axis, right-aligned
    final IAxis yAxisRight = sciChartBuilder.newNumericAxis()
            .withAxisTitle("Primary")
            // Assign a unique ID to the axis
            .withAxisId("primaryYAxis")
            .withAxisAlignment(AxisAlignment.Right)
            .build();

    // Create another numeric axis, left-aligned
    final IAxis yAxisLeft = sciChartBuilder.newNumericAxis()
            .withAxisTitle("Secondary")
            // Assign a unique ID to the axis
            .withAxisId("secondaryYAxis")
            .withAxisAlignment(AxisAlignment.Left)
            .withGrowBy(0.2,0.2)
            .build();

    // Add both Y axes to the YAxes collection of the surface
    Collections.addAll(surface.getYAxes(), yAxisLeft, yAxisRight);

    // Added in Tutorial #3
    // Add a bunch of interaction modifiers to a ModifierGroup
    ModifierGroup chartModifiers = sciChartBuilder.newModifierGroup()
            // Setting MotionEventsGroup
            .withMotionEventsGroup("SharedMotionEvents").withReceiveHandledEvents(true)
            .withPinchZoomModifier().build()
            .withZoomPanModifier().withReceiveHandledEvents(true).build()
            .withZoomExtentsModifier().withReceiveHandledEvents(true).build()
            .withXAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Scale).withClipModeX(ClipMode.None).build()
            .withYAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Pan).build()
            .build();

    // Add the X axis to the XAxes collection of the surface
    Collections.addAll(surface.getXAxes(), xAxis);

    // Add the interactions to the ChartModifiers collection of the surface
    Collections.addAll(surface.getChartModifiers(), chartModifiers);

    // Added in Tutorial #6 - FIFO (scrolling) series
    // Create a couple of DataSeries for numeric (Int, Double) data
    // Set FIFO capacity to 500 on DataSeries
    final int fifoCapacity = 500;

    final XyDataSeries lineData = sciChartBuilder.newXyDataSeries(Integer.class, Double.class)
            .withFifoCapacity(fifoCapacity)
            .build();
    final XyDataSeries scatterData = sciChartBuilder.newXyDataSeries(Integer.class, Double.class)
            .withFifoCapacity(fifoCapacity)
            .build();

    // Create and configure a line series
    final IRenderableSeries lineSeries = sciChartBuilder.newLineSeries()
            .withDataSeries(lineData)
            // Register on a particular Y axis using its ID
            .withYAxisId("primaryYAxis")
            .withStrokeStyle(ColorUtil.LightBlue, 2f, true)
            .build();

    // Create an Ellipse PointMarker for the Scatter Series
    EllipsePointMarker pointMarker = sciChartBuilder
            .newPointMarker(new EllipsePointMarker())
            .withFill(ColorUtil.LightBlue)
            .withStroke(ColorUtil.Green, 2f)
            .withSize(10)
            .build();

    // Create and configure a scatter series
    final IRenderableSeries scatterSeries = sciChartBuilder.newScatterSeries()
            .withDataSeries(scatterData)
            // Register on a particular Y axis using its ID
            .withYAxisId("primaryYAxis")
            .withPointMarker(pointMarker)
            .build();

    // Add a RenderableSeries onto the SciChartSurface
    surface.getRenderableSeries().add(scatterSeries);
    surface.getRenderableSeries().add(lineSeries);
    surface.zoomExtents();

    // Added in Tutorial #5
    // Create a LegendModifier and configure a chart legend
    ModifierGroup legendModifier = sciChartBuilder.newModifierGroup()
            .withLegendModifier()
            .withOrientation(Orientation.HORIZONTAL)
            .withPosition(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 10)
            .build()
            .build();

    // Add the LegendModifier to the SciChartSurface
    surface.getChartModifiers().add(legendModifier);

    // Create and configure a CursorModifier
    ModifierGroup cursorModifier = sciChartBuilder.newModifierGroup()
            // Setting MotionEventsGroup
            .withMotionEventsGroup("SharedMotionEvents").withReceiveHandledEvents(true)
            .withCursorModifier().withShowTooltip(true).build()
            .build();

    // Add the CursorModifier to the SciChartSurface
    surface.getChartModifiers().add(cursorModifier);

    // Added in Tutorial #9 - one more SciChartSurface
    final SciChartSurface surface2 = new SciChartSurface(this);

    // Add the SciChartSurface to the layout
    chartLayout.addView(surface2);

    // Set layout parameters for both surfaces
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f);
    surface.setLayoutParams(layoutParams);
    surface2.setLayoutParams(layoutParams);

    // Create a numeric X axis
    final IAxis xAxis2 = sciChartBuilder.newNumericAxis()
            .withAxisTitle("X Axis Title")
            .withVisibleRange(-5, 15)
            .build();

    // Create a numeric axis
    final IAxis yAxisRight2 = sciChartBuilder.newNumericAxis()
            .withAxisTitle("Primary")
            .withAxisId("primaryYAxis")
            .withAxisAlignment(AxisAlignment.Right)
            .build();

    // Create another numeric axis
    final IAxis yAxisLeft2 = sciChartBuilder.newNumericAxis()
            .withAxisTitle("Secondary")
            .withAxisId("secondaryYAxis")
            .withAxisAlignment(AxisAlignment.Left)
            .withGrowBy(0.2, 0.2)
            .build();

    // Add the Y axis to the YAxes collection of the surface
    Collections.addAll(surface2.getYAxes(), yAxisLeft2, yAxisRight2);

    // Add the X axis to the XAxes collection of the surface
    Collections.addAll(surface2.getXAxes(), xAxis2);

    // Create and configure an area series
    final IRenderableSeries areaSeries = sciChartBuilder.newMountainSeries()
            .withDataSeries(scatterData)
            .withYAxisId("primaryYAxis")
            .withStrokeStyle(ColorUtil.LightBlue, 2f, true)
            .withAreaFillColor(ColorUtil.argb(ColorUtil.LightSteelBlue, 0.6f))
            .build();

    // Add the area series to the RenderableSeries collection of the surface
    Collections.addAll(surface2.getRenderableSeries(), areaSeries);

    // Create the second collection of chart modifiers
    ModifierGroup chartModifiers2 = sciChartBuilder.newModifierGroup()
            // Setting MotionEventsGroup
            .withMotionEventsGroup("SharedMotionEvents").withReceiveHandledEvents(true)
            .withZoomExtentsModifier().withReceiveHandledEvents(true).build()
            .withZoomPanModifier().withReceiveHandledEvents(true).build()
            .withPinchZoomModifier().withReceiveHandledEvents(true).build()
            .withCursorModifier().withReceiveHandledEvents(true).build()
            .build();

    // Add the interactions to the ChartModifiers collection of the surface
    Collections.addAll(surface2.getChartModifiers(), chartModifiers2);

    TimerTask updateDataTask = new TimerTask() {
        private int x = 0;

        @Override
        public void run() {
            UpdateSuspender.using(surface, new Runnable() {
                @Override
                public void run() {
                    lineData.append(x, Math.sin(x * 0.1));
                    scatterData.append(x, Math.cos(x * 0.1));

                    // Added in Tutorial #7
                    // Add an annotation every 100 data points
                    if(x%100 == 0) {
                        TextAnnotation marker = sciChartBuilder.newTextAnnotation()
                                // Register on a particular Y axis using its ID
                                .withYAxisId("primaryYAxis")
                                .withIsEditable(false)
                                .withText("N")
                                .withBackgroundColor(ColorUtil.Green)
                                .withX1(x)
                                .withY1(0.0)
                                .withVerticalAnchorPoint(VerticalAnchorPoint.Center)
                                .withHorizontalAnchorPoint(HorizontalAnchorPoint.Center)
                                .withFontStyle(20, ColorUtil.White)
                                .withZIndex(1)
                                .build();

                        surface.getAnnotations().add(marker);

                        // Remove one annotation from the beginning
                        // in the FIFO way
                        if(x > fifoCapacity){
                            surface.getAnnotations().remove(0);
                        }
                    }

                    // Zoom series to fit the viewport
                    surface.zoomExtents();
                    surface2.zoomExtents();
                    ++x;
                }
            });
        }
    };

    Timer timer = new Timer();

    long delay = 0;
    long interval = 10;
    timer.schedule(updateDataTask, delay, interval);

}

}

0 votes
213 views

Hi All!
I need to replace major and minor grid lines in sci-chart surface with points at Intersection point; like attached image. is there any way to do that in WPF?

0 votes
213 views

How do you set X1,X2 and Y1,Y2 in xaml as suggested in a previous post here on the forum?

I also get null values here when using Composite Annotations example. the suggestion to set the value DependencyProperty.SetCurrentValue(X1Property, 0.0); does not work since DependencyProperty does not expose a SetCurrentValue method (?)

I am using your example code for doing composite Annotations on my existing chart.
I am using MeasureXAnnotation and MeasureXyAnnotation and the respective Update method that is overidden.

What am I missing ?

Appreciate your help with getting this working

Thanks
Anders

0 votes
198 views

Hi,
I am trying to get my chart to scroll together with my other HTML elements but have not been successful. Referring to the screenshot attached, if I were to disable the position:absolute style the chart is then able to scroll with the HTML elements if not, whenever I scroll the other HTML elements would scroll but the Chart will stay in its position.

Is there property that I can set on the chart to disable the absolute position?

0 votes
195 views

I am adding a LegendModifier to display legends for my chart as below:

_sciChartSurface.chartModifiers.add(new SciChart.LegendModifier({ showCheckboxes: true }));

My legend currently looks like the below, with very poor legend visibility:

![enter image description here][1]

I want to know how to set this legend to be opaque so that the labels may be seen clearly. What would be event better would be to just have a constant class for my legend collection (perhaps .sciChartLegendsContainer or whatever) so that I can apply my own css styling myself, without having to hack around with javascript.
Thanks

0 votes
190 views

I am having an issue with my Composite Annotation implementation.
I am using the example provided in the MeasureXyAnnotation.xaml that I found here.
My exception that is thrown (see exception attachment provided) complains about a missing Axis value.

In the public override void Update(ICoordinateCalculator xCoordCalc, ICoordinateCalculator yCoordCalc)
the yCoordCalc comes in with a null value. The xCoordCalc is populated and looks valid.

See attachment of my plotting area and well as the chart area. The composite annotation shows up alright, but as soon as I try to drag it the exception is immediately thrown.

I have no idea at this point why. I have tried to implement the annotation according to your example but obviously I am missing something.
Support getting this to work would be immensely appreciated.

Thank you
Anders

0 votes
202 views

I want to have multiple point markers within the same series based on per-point metadata – for example, based on categories I should have a circle, square, triangle, etc., within the same series. Is this possible?

0 votes
181 views

Hello guys !
I am looking at the Composite Annotation example provided with the SDK that I downloaded a few days back.

I am somewhat confused on what assemblies I will need . The assemblies list you use is extensive and it is unclear to me what assemblies I need to include to apply this to my plot implementation.

The namespace
SciChart.Examples.Examples.AnnotateAChart.CompositeAnnotations is what I am looking at and what in that list of assemblies will I need to include to successfully implement Composite Annotation in our application ?

I work with a few models and views. Two of them, the ChartView and the PlotView respectively handles the charting surface , then the surrounding toggle buttons and such belongs to the PlotView.

What would be your recommendation how to begin implement this ?

Appreciate the support
Thank you

Cheers
Anders

0 votes
234 views

When i try to run the simple Example from the Documentation ( with my trial License Key ) :

class AppDelegate: NSResponder, NSApplicationDelegate {
override init(){
// Set this code once in AppDelegate or application startup
SCIChartSurface.setRuntimeLicenseKey(“XXXXXX”);
super.init()

}

i receive this error and the application builds but fails to start :

libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception ‘License Exception’, reason: ”
terminating with uncaught exception of type NSException

Showing 1 - 50 of 3k results