Pre loader

Tag: c#

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

0 votes
8k views

When calling SCIThemeManager.ApplyTheme(Surface, SCIThemeManager.SCIChart_Bright_SparkStyleKey); within a the code-behind running on the iPhoneSimulator running iOS 13.2, the iOS system throws an Objective-C exception with the following details:

Foundation.MonoTouchException: 'Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: applyThemeProvider: must be implemented in subclass

Although the exact same pattern works without issue on the corresponding Xamarin.Android project and the examples that call this line seem to be OK too, it is not clear from any documentation what this issue could be. Any advice would be appreciated.

0 votes
7k 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 3 years ago
  • last active 3 years ago
0 votes
0 answers
6k views

Hi,

I am having an issue with the SciChart graphs. I have attached an image – SciChartIssue.png, here which shows the issue. Our SciChart graph contains 8 channels of dataseries for EEG / EMG signals. By default the first channel is selected. When we select/deselect additional channels, they start showing up on the graph accordingly. The issue happens when a channel is de-selected. i.e. when any channel is de-selected, we are clearing that particular channel dataseries, while the other series is being appended and rendered using SuspendUpdates(). But on the graph, the waveform tends to move towards the extreme end of the chart (as seen from the image attached). we were initially using version 5.4 of Scichart. but i later updated it to v6.3, but still have the same issue.
If you are aware or have come across such an issue, then I would appreciate any help or advice from you. Since this is a vast and secure project, I am not able to share the entire code with you at this moment. However, I have attached a xaml & .cs file used to render the graph, If it helps.

Thanks!

0 votes
9k views

Hello,

Would it be possible to receive some information on how to take the legend outside of the chart surface area? We are having an issue when the user selects more axis’ to be shown in the chart. The chart then shrinks horizontally making the legend difficult to access for removing the axis’.

A quick how to with some code example would be highly appreciated. To further highlight, this is Xamarin.iOS project we are talking about.

Thank you and have a nice day.

Best Regards

0 votes
7k views

Hi,

I display a waveform using Scichart DataSeries (IXyDataSeries), where waveform dots are not evenly spaced.

I want to read back a sample of this waveform (example: last 10 seconds displayed on the screen) from IXyDataSeries.

The goal is to get waveforms dots again into an array, but this time I want them to be evenly spaced (Sample rate between X is the same).

This means propably that new points will be generated/deleted by the IXyDataSeries during the resampling.

Does Scichart provide a way to do that ?

Thanks

1 vote
8k views

Hello,

I bought a license and when I try to deploy my application it seems to be crashing. The application will build and run fine in Visual Studio. I have tried removing the scichart portions from my app and deploying and it runs fine then. I have tried following the tutorial for deployment located here:
https://www.scichart.com/activating-scichart/

but have not had any luck. Would anyone be able to offer any assistance with deploying with scichart?

Thank you for your time and assistance with this,
Max

  • Max Kelly asked 4 years ago
  • last active 4 years ago
0 votes
8k views

Hi!

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

0 votes
10k views

I managed to be able to render the EllipsePointMarkers, but here is the thing: It only works when I declare the PointMarker in my view model inside the constructor of the XyScatterRenderableSeriesViewModel. The Style with the PointerMarkerTemplate is NOT APPLIED for some reason. Could this be a bug? Please note that in the following code in the view model I specify the color to be “Red” (ARGB(255, 255, 0, 0) but in xaml the template specifies yellow for the fill and stroke.

I absolutely need the PointMarker Template to work because I want to be able to change the color and thickness of the Scatter points during runtime via UI (function in my custom legend).

The following are code snippets from my view model and the corresponding xaml:

ChartSeries.Add(new XyScatterRenderableSeriesViewModel()
                {
                    DataSeries = dataSeries,
                    //Stroke = color,
                    //StrokeThickness = 10,
                    IsVisible = isVisible,
                    AntiAliasing = useAntiAliasing,
                    IsSelected = isSelected,
                    XAxisId = "DateTimeAxis",
                    YAxisId = yAxisId,
                    PointMarker = new EllipsePointMarker()
                    {
                        Fill = Color.FromArgb(255, 255, 0, 0),
                        Stroke = Color.FromArgb(255, 255, 0, 0),
                        StrokeThickness = 5
                    }

                });


<UserControl.Resources>

    <Style TargetType="{x:Type s:XyScatterRenderableSeries}">
        <Setter Property="PointMarkerTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <s:EllipsePointMarker Fill="Yellow" Stroke="Yellow" StrokeThickness="15"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <s:EffectConverter x:Key="EffectConverter"/>

    <DropShadowEffect x:Key="LegendDropShadow" BlurRadius="10" Direction="-45" ShadowDepth="5" Color="Black"/>

    <SolidColorBrush x:Key="LegendTextBrush"  Color="#5F5F5F"/>

    <resources:VisibilityToBooleanConverter x:Key="VisibilityToBooleanConverter"/>

    <resources:CustomCategoryDateTimeAxisLabelProvider x:Key="LabelProvider"/>

</UserControl.Resources>
  • bbmat asked 5 years ago
  • last active 5 years ago
0 votes
10k views

I refactored from using custom RenderableSeries to a custom RenderableSeriesViewModel which has fixed a refresh bug in the chart:

  public class CustomExclusionRenderableSeriesViewModel : BaseRenderableSeriesViewModel
  {
     public override Type RenderSeriesType => typeof(CustomExclusionRenderableSeries);
  }

However I am invoking MouseLeftButtonUp in the chart code behind and performing a hit test. The HitTest method is not exposed on the BaseRenderableSeriesViewModel:

 private void SciChartSurfaceMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {                          
    // Perform the hit test relative to the GridLinesPanel
    Point hitTestPoint = e.GetPosition(this.sciChart.GridLinesPanel as UIElement);

    // Get hit test the RenderableSeries using interpolation
    this.ViewModel.HitTestInfo = this.ViewModel.ExclusionSeries.HitTest(hitTestPoint, true);

Is there any way to get the series instance from the view model & hit test it?

0 votes
0 answers
15k views

Hello,
I’m developing the WPF charts application in C#. I have an activated developer license.
When I compile my code with DUBUG mode, XamlParseException occurred. (In release mode, there are no exception)

That only happened in my new SciChart project, old one never happened.
I already reference the library like SciChart.Charting and the runtime license key is included in App.xaml.cs.

0 votes
8k views

I have multliple renderable series on one scichartsurface and each series has its own y-axis, when CursorModifier-cross moves over line/scatter point/ohlc/candle series how can I ONLY show the y-Value on the with the rendered series matching y-Axis?

With multiple rendered series its virtually impossible to determine which y-Axis value pertains to the specific point of the CursorModifier which “hit-tests” a rendered series.

Is there a simple way to only highlight the y-Value on the matching yAxis as soon as the CursorModifier hit-tests a rendered series? I do not mind to show all yValues on all yAxes when the CursorModifier does not hit-test any rendered series.

Thanks

  • bbmat asked 8 years ago
  • last active 8 years ago
0 votes
0 answers
8k views

I use a similar multi-pane setup as your multi-pane stock chart demo and specify the ChartModifier within SciChartSurface.ChartModifier as follows:

<s:SciChartSurface.ChartModifier>
                        <s:ModifierGroup s:MouseEventGroup="SharedMouseGroup">
                            <s:RubberBandXyZoomModifier IsAnimated = "False" IsXAxisOnly = "True" ExecuteOn = "MouseRightButton"/>
                            <s:ZoomPanModifier XyDirection="XYDirection" ClipModeX = "ClipAtExtents" ExecuteOn ="MouseLeftButton" />
                            <s:MouseWheelZoomModifier XyDirection = "XYDirection"/>
                            <s:ZoomExtentsModifier IsAnimated = "False" ExecuteOn = "MouseDoubleClick" />
                            <s:CursorModifier SourceMode="AllSeries"  UseInterpolation="True" ShowAxisLabels="True"/>
                            <s:LegendModifier Name="GeneralLegend" ShowLegend="True" LegendPlacement ="Inside" GetLegendDataFor="AllSeries" Margin="10" LegendItemTemplate="{StaticResource LegendItemTemplate}"/>

                            <s:SeriesSelectionModifier ReceiveHandledEvents="True">
                                <s:SeriesSelectionModifier.SelectedSeriesStyle>
                                    <Style TargetType="s:BaseRenderableSeries">
                                        <Setter Property="StrokeThickness" Value="10"/>
                                    </Style>
                                </s:SeriesSelectionModifier.SelectedSeriesStyle>
                            </s:SeriesSelectionModifier>

                        </s:ModifierGroup>
                    </s:SciChartSurface.ChartModifier>

The problem I have is that the vertical chart modifier (a vertical line as part of the crosshair that vertically tracks the mouse cursor) is only visible within the respective pane where the mouse cursor is currently located at. When I move the mouse cursor onto another pane then the vertical line of the cross hair tracks in this different pane but only within this specific pane. I want the vertical line to be visible across all panes just like in your multi-pane stock chart demo. When I pan or zoom any of the panes then all panes are responding accordingly and in synchronized fashion, so I am sure the panes’ xaxis are all correctly linked to the primary xAxis.

What am I doing wrong?

Thanks

  • bbmat asked 9 years ago
  • last active 9 years ago
0 votes
0 answers
8k views

I noticed that there are problems when I try to add data series, create renderable series, or annotations while the view that hosts the scichartgroup and/or scichartsurface(s) is/are not yet initialized/rendered. Could this be a bug? After all it should not matter when the view is rendered; when it is rendered its elements bind to the matching properties of its viewmodel, no?

This poses problems for me because I am forced to take the viewmodel-first approach. So, when I create an instance of my viewmodel and then invoke methods in the viewmodel that add data series and render such I am experiencing errors (the rendered series is not displayed on the chart, though annotations strangely are).

I identified the problem to be 2-fold, one is that I have to create renderable series on the UI thread (solved that, no issue) but my other big problem is that the view is actually not instantiated/rendered unless the view is in focus/visible which is not the case during runtime when data series are added via viewmodel.

How can I solve this problem?

  • bbmat asked 9 years ago
  • last active 9 years ago
0 votes
0 answers
9k views

I try to add data series and have them rendered on a chart surface. The surface and entire chart library is wrapped in an mvvm-based api. The sci chart control and wrapping library are rendered on a document panel. I add new data series via the viewmodel and here is where I have some unexpected behavior:

a) When being on a different document panel, meaning the chart control is NOT visible, and when I add a new data series via view model and then view the document panel that hosts the sci chart control, no chart series are rendered on the chart but I do see the correct legend data (such as chart series name, color, stroke thickness). Please see below screen shot “Capture1.jpg” .

b) When I make the sci chart control visible by viewing the document panel that hosts the sci chart control and then via a button and command add the very same data series via my chart control’s view model the charts are correctly rendered. Please see “Capture2.jpg”.

My question is why is that the case? I basically expose a method in my chart library view model that lets me add data and if I invoke that methods while being on a document panel that does not host the chart control the added data series is not rendered on the chart. But strangely the correct chart legend data are displayed and also the chart control itself is correctly rendered. No problems when the hosting document panel is active and the very same method is invoked.

Basically what I currently observe is that the data series are not rendered at all as long as the chart control is not “in view” or the hosting document panel is not selected. I am sure programmatically all references and bindings are correct.

I have spend many hours debugging this issue and do not seem to find an answer. Any pointers?

Thanks a lot,
Matt

Edit:

Here is how I bind the content control to the view model of my sci chart charting library (user control)

<ContentControl Grid.Row="1" Content="{Binding ChartControl, Mode=OneWay}" />

…and the view model is instantiated in the hosting view model constructor:

public MainWindowViewModel()
    {
       ChartControl = new SciChartControlViewModel();

        ExitApplicationCommand = new RelayCommand(OnExitApplicationCommand);
        LoadDataSeriesFromFilesCommand = new RelayCommand(OnLoadDataSeriesFromFilesCommand);
        RefreshDataSeriesFromFilesCommand = new RelayCommand(OnRefreshDataSeriesFromFilesCommand);


        Test();

    }

…Test() performs the following action:

private void Test()
    {
        var quotes = new List<Quote>();
        List<DateTime> timeStamps = new List<DateTime>();
        List<double> values = new List<double>();
        List<SciChartAnnotation> annotations = new List<SciChartAnnotation>();
        Random rand = new Random((int)DateTime.Now.Ticks);
        DateTime currentDt = DateTime.Now;
        double currentValue = 0;

        for (int index = 0; index <= 50000; index++)
        {
            var randomValue = rand.NextDouble();
            currentDt = currentDt + TimeSpan.FromSeconds(randomValue);
            currentValue = currentValue + randomValue - 0.5;

            if (index % 1000 == 0)
            {
                var buySell = rand.NextDouble() > 0.5 ? SciChartAnnotationDirection.Buy : SciChartAnnotationDirection.Sell;
                annotations.Add(new SciChartAnnotation(buySell, currentDt, currentValue, "Index:" + index));
            }

            timeStamps.Add(currentDt);
            values.Add(currentValue);

            quotes.Add(new Quote(){DataProviderId = "Provider1", SymbolId = "Symbol1", QuoteType = QuoteType.BidAsk, CompressionType = TimeCompressionType.NoCompression, CompressionUnits = 0, TimeStamp = currentDt, Bid = currentValue, Ask= currentValue + 0.05, });

        }

        ChartControl.AddDataSet("Pane1", "0.00000", quotes, annotations);
        //ChartControl.AddDataSet("MattSeries", ChartType.Scatter, 1, "0.00000", timeStamps, values);

    }

…it basically tries to render chart series and annotations.

Strangely, as mentioned before, the series legends render correctly and the annotations also all render correctly but the chart series do not! Could this be a bug? Please refer to the image “Capture3” for a screenshot.

  • bbmat asked 9 years ago
  • last active 9 years ago
0 votes
15k views

Hello,

I wonder what the most efficient way is to completely reset (clean up) a SciChartGroup? I add all kinds of panes, add data series, add renderable series on different panes. Now, with a single call I like to reset the SciChartSurface to its original state (empty). I want to have all panes removed, as well as references the sciChartGroup may hold to panes, and references the panes hold to different renderable series and data series. I tried to clear ChartPaneViewModels, an observable collection that holds objects of type BaseChartPaneViewModel (which in turn implements IChildPane and ViewModelBase) but that did not have any effect. My SciChartGroup binds via ItemsSource to ChartPaneViewModels

What is your recommendation how to best reset the whole sciChartGroup?

Thanks,
Matt

  • bbmat asked 9 years ago
  • last active 9 years ago
Showing 15 results

Try SciChart Today

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

Start TrialCase Studies