Pre loader

Category: WPF

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
7k views

Hello everybody,

I hope you are fine,

I am working with DatapointeselectionModifier on a tablet windows.

I want to be able to select multiple points without pressing Left Ctrl keyboard.
Can you help me please?

Thank you very much.

1 vote
2k views

Hi,

I am using the scichart for WPF an came across a problem. I am trying to create a thumbnail image of a size 300×200 pixels of my chart. I have tried using the ExportToStream method with option of specifying the size output, but that creates a smaller resolution image of my chart. I was hoping that it will resize the chart to the desired size and then make an image.
So I tried a second option which was to put the chart in a user control of a certain size and then use the RenderTargetBitmap to render the user control in an image. That resulted in a partial chart without the chart lines. Take a look at the attached?

Any ideas how to make the chart to be rendered in memory in full for a certain size?

Kind regards,
Boštjan

0 votes
10k views

I getting a weird behavior on my xAxis and yAxis with a real time SciChart.

The labels on axes and the chart itself start shaking like it is trying to update positions but it never gets steady.

I have a background routine adding data to the data series every second and every chart have two series with 2 YAxis, there are only two charts visible in the window at a given time.

Also I have noticed that after a few minutes of doing this the window itself get sluggish and not responsive anymore, I switch to another tab which doesn’t have a chart it start responding again.

Have anyone seeing something like this?

I have tried the Performance Tips and Tricks but nothing changes this behavior.

I’m using a Surface 3 pro with SciChart version 3.3.0.5909

Here is my XAML and the dispatcher timer adding data to the dataseries.

<UserControl 
x:Class="PulseControl.CustomControls.RealTimeEnergy" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:m="clr-namespace:PulseControl.Models"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
xmlns:ee="http://schemas.microsoft.com/expression/2010/effects" 
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
xmlns:Custom="http://metro.mahapps.com/winfx/xaml/shared" 
xmlns:PulseControl="clr-namespace:PulseControl" 
xmlns:converters="clr-namespace:PulseControl.Converters" 
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart" 
xmlns:cc="clr-namespace:PulseControl.CustomControls"
Width="Auto"
Background="{StaticResource WindowBackgroundBrush}" 
mc:Ignorable="d" d:DesignHeight="140" d:DesignWidth="600" d:DataContext="{d:DesignInstance {x:Type m:MainWindowsModel}}"
>
<UserControl.Resources>
    <ResourceDictionary>
        <converters:IntToKiloConverter x:Key="Int2Kilo" />
    </ResourceDictionary>
</UserControl.Resources>

<DockPanel 
    Background="{StaticResource WindowBackgroundBrush}" >

    <Grid 
        DockPanel.Dock="Top"
        Height="140">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"></RowDefinition>
            <RowDefinition Height="40"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="170"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="170"></ColumnDefinition>
        </Grid.ColumnDefinitions>


        <Border 
            Grid.Column="0"
            Grid.Row="0"
            CornerRadius="50"
            Width="170"
            Margin="0"
            Padding="0"
            Background="{StaticResource ColorLeftChartBrush}"
            BorderThickness="1">
            <TextBlock 
                Style="{StaticResource FieldTextBoxStyle}"
                Foreground="{StaticResource BlackBrush}"
                HorizontalAlignment="Center"
                Padding="0"
                Margin="0"
                FontSize="60"
                VerticalAlignment="Center"
                Text="{Binding Laser.OpData.AvgKiloVoltagePerSecond, Mode=OneWay, StringFormat={}{0:N1}}">
            </TextBlock>
        </Border>

        <Label
            Grid.Column="0"
            Grid.Row="1"
            Style="{StaticResource FieldLabelStyle}"
            FontSize="20"
            HorizontalAlignment="Center"
            VerticalAlignment="Top">
            Voltage (kV)
        </Label>


        <s:SciChartSurface 
            Name="sciChart" 
            Grid.Column="1"
            Grid.RowSpan="2"
            Height="140"
            Background="{StaticResource WindowBackgroundBrush}"
            s:SciChartGroup.VerticalChartGroup="OPERATION"
            Width="Auto"
            Margin="0"
            Padding="8 8 8 10"
            RenderPriority="Low"
            MaxFrameRate="30">

            <s:SciChartSurface.RenderableSeries>

                <s:FastMountainRenderableSeries 
                    x:Name="serieVoltage" 
                    SeriesColor="{StaticResource ColorLeftChart}" 
                    StrokeThickness="2"
                    YAxisId="LAXIS"
                    DataSeries="{Binding ChartData.ChartDataVoltage}">
                    <s:FastMountainRenderableSeries.AreaBrush>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Color="#A860a917" Offset="0"/>
                            <GradientStop Color="#3360a917" Offset="1"/>
                        </LinearGradientBrush>
                    </s:FastMountainRenderableSeries.AreaBrush>
                </s:FastMountainRenderableSeries>

                <s:FastMountainRenderableSeries 
                    x:Name="serieEnergy" 
                    SeriesColor="{StaticResource ColorRightChart}" 
                    StrokeThickness="2"
                    YAxisId="RAXIS"
                    DataSeries="{Binding ChartData.ChartDataEnergy}">
                    <s:FastMountainRenderableSeries.AreaBrush>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Color="#A83376E5" Offset="0"/>
                            <GradientStop Color="#333376E5" Offset="1"/>
                        </LinearGradientBrush>
                    </s:FastMountainRenderableSeries.AreaBrush>
                </s:FastMountainRenderableSeries>

            </s:SciChartSurface.RenderableSeries>

            <s:SciChartSurface.XAxis >
                <s:DateTimeAxis Name="xAxis" AutoRange="Always"  IsStaticAxis="True" TextFormatting="dd HH:mm" SubDayTextFormatting="HH:mm:ss" CursorTextFormatting = "mm:ss" Foreground="White"  />
            </s:SciChartSurface.XAxis>

            <s:SciChartSurface.YAxes>
                <s:NumericAxis 
                    AutoRange="Always" 
                    GrowBy="0,0.5"
                    IsPrimaryAxis="True"
                    AxisAlignment="Right"
                    Id="RAXIS"
                    Style="{StaticResource NoMinorLines}">
                </s:NumericAxis>
                <s:NumericAxis 
                    AutoRange="Always" 
                    GrowBy="0,0.25"
                    IsPrimaryAxis="False"
                    Id="LAXIS"
                    AxisAlignment="Left"
                    Style="{StaticResource NoMinorLines}">
                </s:NumericAxis>
            </s:SciChartSurface.YAxes>

            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:RubberBandXyZoomModifier IsEnabled="{Binding ChartData.ZoomEnabled, Mode=TwoWay}" IsXAxisOnly="True"></s:RubberBandXyZoomModifier>
                    <s:ZoomPanModifier IsEnabled="{Binding ChartData.PanEnabled, Mode=TwoWay}"></s:ZoomPanModifier>
                    <s:MouseWheelZoomModifier IsEnabled="{Binding ChartData.MouseWheelEnabled, Mode=TwoWay}"></s:MouseWheelZoomModifier>
                    <s:RolloverModifier IsEnabled="{Binding ChartData.RolloverEnabled, Mode=TwoWay}"></s:RolloverModifier>
                    <s:CursorModifier IsEnabled="{Binding ChartData.CursorEnabled, Mode=TwoWay}"></s:CursorModifier>
                    <s:YAxisDragModifier></s:YAxisDragModifier>
                    <s:XAxisDragModifier></s:XAxisDragModifier>
                    <s:ZoomExtentsModifier></s:ZoomExtentsModifier>
                </s:ModifierGroup>
            </s:SciChartSurface.ChartModifier>

        </s:SciChartSurface>

        <Border 
            Grid.Column="2"
            Grid.Row="0"
            CornerRadius="50"
            Width="170"
            Margin="0"
            Padding="0"
            Background="{StaticResource ColorRightChartBrush}"
            BorderThickness="1">
            <TextBlock 
                Style="{StaticResource FieldTextBoxStyle}"
                Foreground="{StaticResource BlackBrush}"
                HorizontalAlignment="Center"
                Padding="0"
                Margin="0"
                FontSize="60"
                VerticalAlignment="Center"
                Text="{Binding Laser.OpData.AvgEnergyPerSecond, Mode=OneWay, StringFormat={}{0:N1}}">
            </TextBlock>
        </Border>

        <Label
            Grid.Column="2"
            Grid.Row="1"
            Style="{StaticResource FieldLabelStyle}"
            FontSize="20"
            HorizontalAlignment="Center"
            VerticalAlignment="Top">
            Energy (mJ)
        </Label>

    </Grid>

</DockPanel>

Model

void _timer_Tick(object sender, EventArgs e)
    {
        DateTime now = DateTime.Now;

            // Things to do when running
        SafeAddPoint(_chartDataEnergy, now, Laser.OpData.AvgEnergyPerSecond);
        SafeAddPoint(_chartDataEfficiency, now, Laser.OpData.ChamberEfficiency * 100.0);
        SafeAddPoint(_chartDataVoltage, now, Laser.OpData.AvgKiloVoltagePerSecond);
        SafeAddPoint(_chartDataPressure, now, Laser.OpData.Pressure);
        SafeAddPoint(_chartDataSigmaEnergy, now, Laser.OpData.SampleSigma);
        SafeAddPoint(_chartDataSigmaPercentage, now, Laser.OpData.SampleSigmaPercentage);
        SafeAddPoint(_chartDataTemperature, now, Laser.OpData.Temperature);
    }

    private void SafeAddPoint(IDataSeries serie, DateTime dt, double val)
    {
        if (serie.ParentSurface != null)
            using (serie.ParentSurface.SuspendUpdates())
                ((XyDataSeries<DateTime, double>)serie).Append(dt, val);
        else
            ((XyDataSeries<DateTime, double>)serie).Append(dt, val);
    }
1 vote
14k views

I want to display a point as a decimar separator in numeric values. I have achieved this in chart axis and vertical slices tooltips, creating a custom NumericLabelProvider (see attached picture). How can I do the same with vertical slices xacis labels? (in the picture attached, note that every numeric value has a point as a decimar separator, but vertical slice label has a comma). I have defined LabelTextFormatting of the slice with “#.##E+0”, but it doesn’t work.

Thanks in advance

Regads, Juan

0 votes
10k views

Hello.
I wanna deactivate the scichart on machine that doesn’t work because a reach activation limit.
How can i do this?

0 votes
13k views

Hi

We are using a simple SciChart setup like the following:

        <Grid Margin="20,45,50,20">

    <!--  Create the chart surface  -->
    <s:SciChartSurface Name="SparseValuesPlot" s:ThemeManager.Theme="Chrome">

        <!--  Declare RenderableSeries  -->
        <s:SciChartSurface.RenderableSeries>
            <s:FastLineRenderableSeries DataSeries="{Binding Values}" Style="{Binding PlotStyle, Converter={StaticResource plotStyleConverter}}" />
        </s:SciChartSurface.RenderableSeries>

        <!--  Create an X Axis  -->
        <s:SciChartSurface.XAxis>
            <s:NumericAxis AxisAlignment="Bottom" GrowBy="0.1, 0.1" AxisTitle="{Binding XAxisTitle}" AutoRange="Never" VisibleRange="{Binding XRange}" />
        </s:SciChartSurface.XAxis>

        <!--  Create a Y Axis  -->
        <s:SciChartSurface.YAxis>
            <s:NumericAxis AxisAlignment="Left" GrowBy="0.1, 0.1" AxisTitle="{Binding YAxisTitle}" AutoRange="Never" VisibleRange="{Binding YRange}" />
        </s:SciChartSurface.YAxis>

    </s:SciChartSurface>
</Grid>

Is there a way to fix the aspect ratio of the chart such that a unit on the x-axis is displayed with the same number of pixels than a unit on the y-axis?

Right now the chart is streched with the surrounding grid. I tried to set height and width of the SciChartSurface but this does not keep the relations because the axis label areas may take different amount of space.

Thanks
Julian

0 votes
7k views

Hi, I am trying to export an XyScatterRenderableSeries based on a XyzDataSeries<double,double,double> to XPS. The coloring is based on the z value and works perfectly in the application itself. The problem is that when exporting all the data and labels are perfectly visible ( no more vertical mirroring etc.), however all points are grey. I do see by setting a breakpoint on the OverridePointMarker below that the palette is used, just don’t see it in the end result. Anyone any tips or ideas what is going wrong?

Part of the Palette Provider;

    public PointPaletteInfo? OverridePointMarker(IRenderableSeries rSeries, int index, IPointMetadata metadata)
    {
        var rxyz = rSeries as XyScatterRenderableSeries;
        var xyz = rxyz?.DataSeries as XyzDataSeries<double, double, double>;
        if (xyz == null) return null;
        var z = xyz.ZValues[index];
        var i = Convert.ToInt32((_colormap.GetUpperBound(0) * z) / _max);
        var c = _colormap[i];
        return new PointPaletteInfo()
        {
            Fill = c,
            Stroke = c
        };
    }

Code to generate the chart in memory and export it to XPS

        var colormap = new ColorMappingAgain((Brush)Resources["DefaultBrush"], 100);
        var x = new ObservableCollection<IRenderableSeries>() {HeatmapSeries};

        foreach (var y in x)
            y.PaletteProvider = colormap;

        var surface = new SciChartSurface()
        {
            RenderSurface = new XamlRenderSurface(),
            ChartTitle = name,
            FontSize = (double) dpi * fontsize / 96,
            XAxes = xAxes,
            YAxes = yAxes,
            RenderableSeries = x,
        };

        foreach (var y in x)
            y.PaletteProvider = colormap;

        SciChart.ExportToFile(@"C:\Temp\again.xps",ExportType.Xps,true);
        SciChart.ExportToFile(@"C:\Temp\again2.xps", ExportType.Xps, false);
1 vote
14k views

Hi,

I’m creating a CustomChartModifier which I am able to hook to a SciStockChart (a template item in a SciChartGroup MVVM) and now I’m having difficulties in adding the BoxAnnotation to the Chart.

This is the code I’m using in my ChartModifier and placing a breakpoint shows me that indeed the code runs through this method, however, I do not see any BoxAnnotation on my chart? I’ve even tried adding the Height and Width properties without any further success. Other CustomModifiers to draw Lines and Ellipses works without problems. Do BoxAnnotations work differently?

I’m looking to have the the user be able to draw a BoxAnnotation on the chart, free hand / dynamically.

SimpleBoxAnnotationModifier.cs

public override void OnModifierMouseDown(ModifierMouseArgs e)
{
        base.OnModifierMouseDown(e);

        var resources = new AnnotationStyles();
        // x:Key="BoxAnnotationStyle" TargetType="s:BoxAnnotation"
        var style = (Style)resources["BoxAnnotationStyle"];

        _annotationCreation = new AnnotationCreationModifier () { AnnotationType = typeof(BoxAnnotation), AnnotationStyle = style };

        this.ModifierSurface.Children.Add(_annotationCreation);
}

AnnotationStyles.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
                x:Class="ChartModifierBinding.AnnotationStyles">

<Style x:Key="BoxAnnotationStyle" TargetType="s:BoxAnnotation">
    <Setter Property="BorderBrush" Value="#279B27"/>
    <Setter Property="Background" Value="#551964FF"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="IsEditable" Value="True"/>
</Style>

Thanks for any pointers or tips!

  • David T asked 9 years ago
  • last active 8 years ago
1 vote
13k 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-dev.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?

  • Azrin Sani asked 9 years ago
  • last active 8 years ago
0 votes
7k views

I’v tried the latest version[6.5] of SciChart WPF suite and THEN I activated an older version [6.2] in the same computer. Of course, the serial key was left by an ex-colleague. It’s strange that I can activate ver 6.2 and succeed to get a run-time key. But the key cannot be recongnized by the program. It said I didn’t input a run time key in the render surface.
What’ worse, there are no entities rendered in the SciChartSurface. Just show a blank one.

This issue could be reproduced by the following steps:
1. use a trial version of the latest SciChart;
2. activate an older version using an expired license key. [royalty use, right?]

If I reinstall the OS, and use ver 6.2 directly, all works well.

We’ve brought several 6.2 s, I think reinstall OS is not a smart method to solve this. Could it be solved in a more easy way?

  • Niu mag asked 2 years ago
  • last active 2 years ago
1 vote
11k views

I cannot figure out how to setup SciChartSurface so that it would be initialized right away and IsSizeValidForDrawing returned true.

Now I have the special case for the first call to the view with SciChartSurface and I start working with it after receiving SizeChanged event. In this event handler and afterwards IsSizeValidForDrawing gets true and later on all my requests to the view are OK. It’s quite inconvenient.

When does SciChartSurface get resized? What makes it resize?
Which moment does IsSizeValidForDrawing get true?
What should I do to make the size valid after instantiating or receiving first bunch of data ?
How can I make it progmammatically?

This is my xaml:

        <s:SciChartSurface.RenderableSeries>
            <s:FastLineRenderableSeries XAxisId="XAxis1" YAxisId="YAxis1" AntiAliasing="False" />
            <s:FastLineRenderableSeries XAxisId="XAxis2" YAxisId="YAxis2" AntiAliasing="False"  />
            <s:FastLineRenderableSeries XAxisId="XAxis1" YAxisId="YAxis1" AntiAliasing="False" />
            <s:FastLineRenderableSeries XAxisId="XAxis2" YAxisId="YAxis2" AntiAliasing="False" />
            <s:FastLineRenderableSeries XAxisId="XAxis1" YAxisId="YAxis1" AntiAliasing="False"/>
            <s:FastLineRenderableSeries XAxisId="XAxis2" YAxisId="YAxis2" AntiAliasing="False"/>
        </s:SciChartSurface.RenderableSeries>

        <s:SciChartSurface.XAxes>
            <s:NumericAxis Id="XAxis1" />
            <s:NumericAxis Id="XAxis2" />
        </s:SciChartSurface.XAxes>

        <s:SciChartSurface.YAxes>
            <s:NumericAxis Id="YAxis1"  />
            <s:NumericAxis Id="YAxis2" />
        </s:SciChartSurface.YAxes>
    </s:SciChartSurface>

    <Grid Grid.Row="1" x:Name="myOverviews">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <s:SciChartOverview  Grid.Row="0" 
                    XAxisId="XAxis1"
                    ParentSurface="{Binding ElementName=mySurface}"
                    DataSeries="{Binding ElementName=mySurface, Path=RenderableSeries[4].DataSeries}"
                    SelectedRange="{Binding ElementName=mySurface, Path=XAxes[0].VisibleRange, Mode=TwoWay}"
                    Visibility ="Collapsed"
                    s:ThemeManager.Theme="BlackSteel">
        </s:SciChartOverview>

        <s:SciChartOverview Grid.Row="1" 
                    XAxisId="XAxis2"
                    ParentSurface="{Binding ElementName=mySurface}"
                    DataSeries="{Binding ElementName=mySurface, Path=RenderableSeries[4].DataSeries}"
                    SelectedRange="{Binding ElementName=mySurface, Path=XAxes[1].VisibleRange, Mode=TwoWay}"
                    Visibility ="Collapsed"
                    s:ThemeManager.Theme="BlackSteel">
        </s:SciChartOverview>
    </Grid>

All visibilities besides SciChartSurface are “Collapsed”

SciChart version 3.1.0.5077

Thank you

1 vote
16k views

Hello,

I have been working with an application that plots real-time serial data using a FIFO buffer. I have started programming around the ECG-Monitor example as this is exactly what I am creating.

I have a device that broadcasts real-time ECG data via Bluetooth (HC-05), to be exact. I have paired the device and opened a SerialPort in my program to receive the data. My sampling rate is 256 Hz.

When I used a text file to simulate ECG data, it works perfectly well. However, when I use real-time data, there is a delay in charting that increases as the time increases. An easier way to understand this is, the chart continues plotting for a significant period of time even after I have switched off my hardware device.

I have then come to the conclusion that my data is being received at the rate that I want it to, but the plotting gets delayed at an increasing rate as the time increases.

I am currently using the Direct-X rendering type as this gives me a very smooth plot. I receive the data via SerialPort, write to an array and then to the FIFO buffer.

I’m attaching my code for the same.

namespace SciChart.Examples.Examples.SeeFeaturedApplication.ECGMonitor
{
    public class ECGMonitorViewModel : BaseViewModel
    {
    private Timer _timer;
    private IXyDataSeries<double, double> _series0;
    public static double[] _sourceData = new double[50000];
    private int _currentIndex = 0;
    private int _totalIndex = 0;
    private DoubleRange _yVisibleRange;
    private bool _isBeat;
    private int _heartRate;
    private bool _lastBeat;
    private DateTime _lastBeatTime;
    private ICommand _startCommand;
    private ICommand _stopCommand;
    private const double WindowSize = 5.0;
    private const int TimerInterval = 40;
    public static int counter = 0;
    public static SerialPort mySerialPort=new SerialPort("COM3",9600);

    public ECGMonitorViewModel()
    {
        mySerialPort.Open();
        ECGMonitorViewModel.mySerialPort.WriteLine("A");
        ECGMonitorViewModel.mySerialPort.WriteLine("F");

        _series0 = new XyDataSeries<double, double>() { FifoCapacity = 2460, AcceptsUnsortedData = true };

        YVisibleRange = new DoubleRange(-20, 500);
        _startCommand = new ActionCommand(OnExampleEnter);
        _stopCommand = new ActionCommand(OnExampleExit);
    }

    public ICommand StartCommand
    {
        get
        {
            return _startCommand;
        }
    }

    public ICommand StopCommand
    {
        get
        {
            return _stopCommand;
        }
    }

    public IXyDataSeries<double, double> EcgDataSeries
    {
        get
        {
            return _series0;
        }
        set
        {
            _series0 = value;
            OnPropertyChanged("EcgDataSeries");
        }
    }

    public DoubleRange YVisibleRange
    {
        get
        {
            return _yVisibleRange;
        }
        set
        {
            _yVisibleRange = value;
            OnPropertyChanged("YVisibleRange");
        }
    }

    public bool IsBeat
    {
        get
        {
            return _isBeat;
        }
        set
        {
            if (_isBeat != value)
            {
                _isBeat = value;
                OnPropertyChanged("IsBeat");
            }
        }
    }

    public int HeartRate
    {
        get { return _heartRate; }
        set
        {
            _heartRate = value;
            OnPropertyChanged("HeartRate");
        }
    }

    public void OnExampleExit()
    {
        if (_timer != null)
        {
            _timer.Stop();
            _timer.Elapsed -= TimerElapsed;
            _timer = null;
        }
    }

    public void OnExampleEnter()
    {
        _timer = new Timer(TimerInterval) { AutoReset = true };
        _timer.Elapsed += TimerElapsed;
        _timer.Start();
    }

    private void TimerElapsed(object sender, EventArgs e)
    {
        lock (this)
        {
            for (int i = 0; i < 10; i++)
            {
                AppendPoint(250);
            }

            if ((DateTime.Now - _lastBeatTime).TotalMilliseconds < 120) return;

            IsBeat = _series0.YValues[_series0.Count - 3] > 120 ||
                     _series0.YValues[_series0.Count - 5] > 120 ||
                     _series0.YValues[_series0.Count - 8] > 120;

            if (IsBeat && !_lastBeat)
            {
                HeartRate = (int)(60.0 / (DateTime.Now - _lastBeatTime).TotalSeconds);
                _lastBeatTime = DateTime.Now;
            }
        }
    }

    private void AppendPoint(double sampleRate)
    {
        if (_currentIndex >= _sourceData.Length)
        {
            _currentIndex = 0;
        }

        double voltage = _sourceData[_currentIndex];
        double time = _totalIndex / sampleRate %10;

        if(time==0.00)
        {
            voltage = double.NaN;
        }

        _series0.Append(time, voltage);

        _lastBeat = IsBeat;
        _currentIndex++;
        _totalIndex++;
    }

    public static void mySerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
    {
        while (mySerialPort.BytesToRead > 0)
        {
            int b;
            b = mySerialPort.ReadByte();
            _sourceData[counter] = b;
            counter++;
        }
    }
}
}

namespace SciChart.Examples.Examples.SeeFeaturedApplication.ECGMonitor
{
    public partial class ECGMonitorView : UserControl
    {
        public ECGMonitorView()
        {
            InitializeComponent();
            ECGMonitorViewModel.mySerialPort.DataReceived += new SerialDataReceivedEventHandler(ECGMonitorViewModel.mySerialPort_DataReceived);
        }
    }
}

The xaml code is as follows,

<UserControl
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
         xmlns:local="clr-namespace:SciChart.Examples.Examples.SeeFeaturedApplication.ECGMonitor"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
         xmlns:s3D="http://schemas.abtsoftware.co.uk/scichart3D" xmlns:XamlRasterizer="clr-namespace:SciChart.Drawing.XamlRasterizer;assembly=SciChart.Drawing" x:Class="SciChart.Examples.Examples.SeeFeaturedApplication.ECGMonitor.ECGMonitorView"
         d:DesignHeight="400"
         d:DesignWidth="600"
         mc:Ignorable="d">

<UserControl.Resources>

    <Style TargetType="{x:Type s:RenderSurfaceBase}">
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect BlurRadius="5"
                                  ShadowDepth="0"
                                  Color="#FFB3E8F6" />
            </Setter.Value>
        </Setter>
    </Style>

    <local:BeatToScaleConverter x:Key="BeatToScaleConverter" />
</UserControl.Resources>

<i:Interaction.Triggers>
    <i:EventTrigger EventName="Loaded">
        <i:InvokeCommandAction Command="{Binding StartCommand}" />
    </i:EventTrigger>
    <i:EventTrigger EventName="Unoaded">
        <i:InvokeCommandAction Command="{Binding StopCommand}" />
    </i:EventTrigger>
</i:Interaction.Triggers>

<Grid>

    <s:SciChartSurface RenderPriority="Low" MaxFrameRate="25" AutoRangeOnStartup="False">

        <s:SciChartSurface.RenderableSeries>
            <s:FastLineRenderableSeries DataSeries="{Binding EcgDataSeries}"
                Stroke="#FFB3E8F6"                                      
                StrokeThickness="2" />
        </s:SciChartSurface.RenderableSeries>

        <s:SciChartSurface.YAxis>
            <s:NumericAxis AxisTitle="Voltage (mV)"
                DrawMinorGridLines="True"
                MaxAutoTicks="5"
                VisibleRange="{Binding YVisibleRange, Mode=TwoWay}" />
        </s:SciChartSurface.YAxis>

        <s:SciChartSurface.XAxis>
            <s:NumericAxis AxisTitle="Seconds (s)" TextFormatting="0.000s" VisibleRange="0, 10" AutoRange="Never"/>
        </s:SciChartSurface.XAxis>

        <s:SciChartSurface.RenderSurface>
            <s3D:Direct3D10RenderSurface/>
        </s:SciChartSurface.RenderSurface>

    </s:SciChartSurface>

    <StackPanel Margin="30,30" Orientation="Horizontal">
        <StackPanel.Effect>
            <DropShadowEffect BlurRadius="5"
                ShadowDepth="0"
                Color="#FFB3E8F6" />
        </StackPanel.Effect>

        <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
            <Canvas x:Name="layer1"
                Width="20"
                Height="20"
                Margin="12,34,10,0">
                <Canvas.RenderTransform>
                    <ScaleTransform CenterX="-6"
                        CenterY="-6"
                        ScaleX="{Binding IsBeat, Converter={StaticResource BeatToScaleConverter}}"
                        ScaleY="{Binding IsBeat, Converter={StaticResource BeatToScaleConverter}}" />
                </Canvas.RenderTransform>
                <Path Data="m 0 0 c -4 -4 -8.866933 -10.79431 -10 -15 0 0 0 -5 5 -5 5 0 5 5 5 5 0 0 0 -5 5 -5 5 0 5.242535 4.02986 5 5 -1 4 -6 11 -10 15 z" Fill="#FFB0E6F4" />
            </Canvas>
        </Grid>

        <TextBlock HorizontalAlignment="Left"
            VerticalAlignment="Top"
            FontFamily="ArialBlack"
            FontSize="36"
            FontWeight="Bold"
            Foreground="#FFB0E6F4"
            Text="{Binding HeartRate}" />
        <TextBlock HorizontalAlignment="Left"
            VerticalAlignment="Top"
            FontFamily="ArialBlack"
            FontSize="36"
            FontWeight="Bold"
            Foreground="#FFB0E6F4"
            Text="BPM" />

    </StackPanel>

    <TextBlock Margin="5"
        HorizontalAlignment="Left"
        VerticalAlignment="Bottom"
        FontSize="9"
        FontStyle="Italic"
        Foreground="#FFB0E6F4"/>

</Grid>

I’ve attached pictures of what my program currently does. I have also attached a file with sample data in case anybody wants to test the program. I have also tried building in release mode and that doesn’t help, either.

The only issue is the delay in plotting of real-time data. Otherwise, the graphing and rendering is really smooth. As I am a complete beginner to this, can somebody help with me with what I might have done wrong?

Thanks a ton,

Jaivignesh Jayakumar

0 votes
11k views

Is there any way to change the view of a 3d chart so the Y and Z axis are switched?

0 votes
11k views

Hello,

I have a line series with 500k to 8 million data points and I use the StrokePaletteProvider to highlight certain peaks in different colors. But the colors only appear right at a certain zoom level, without zooming in it is a mixture of my default line color and the chosen StrokePaletteProvider color. Is there anything I can do about this?

  • Roland D asked 5 years ago
  • last active 5 years ago
0 votes
20k views

The topic title speaks for itself. Will SciChart ever support non-Sci types like the pie chart?

Thanks…

  • RMittelman asked 12 years ago
  • last active 6 years ago
0 votes
10k views

Good day.

Changing RolloverModifier SourceMode property to AllSeries, AllVisibleSeries and etc. take no effect.
In collection RolloverModifier.SeriesData.SeriesInfo we have only charts, that currently visible in chart field.
Is that bug?

Best regards
Sam

0 votes
4k views

Hi,

we have a graph which it’s x axis visible range changed when the graph draw until the max (as a travel graph)
we also have logic for each serie a minimum\maximum range, outside of this range the color should be red
so, we use the ExtremePointMarkerPaletteProvider and set for each value the suttible color in the colors list.

our problem is when the graph visible range changed – the serie points is draw correctly but it’s color is not match.
the colors are stay the same as they was before the range changed.
we looked at the colors list and YValues list – the value and the color on each index was match.
the problem is only in the view.

also, after some time it’s fixed, we don’t know what cause it to be fixed…

Thanks

0 votes
4k views

I’ve verified it steps thru the code as I would expect; however, it only ever zooms in further. The intent of this modifier is to only zoom out when the mouse is dragged up and left. I.e.

Mouse down
Drag up/left
Mouse up

    class ZoomOutModifier : ZoomExtentsModifier
{
    double _x;
    double _y;
    MouseButtons _button = MouseButtons.None;

    public override void OnModifierDoubleClick(ModifierMouseArgs e)
    {
        // do not zoom to extents on a double click
        e.Handled = true;
    }

    public override void OnModifierMouseDown(ModifierMouseArgs e)
    {
        base.OnModifierMouseDown(e);

        // where was the mouse button on the chart surface?            
        _x = e.MousePoint.X;
        _y = e.MousePoint.Y;

        // which button was clicked?  we're only going to zoom 
        // out on a left button click.
        _button = e.MouseButtons;
    }

    public override void OnModifierMouseUp(ModifierMouseArgs e)
    {            
        // are we left and up from where the mouse was clicked?
        if (MouseButtons.Left == _button &&
            e.MousePoint.X < _x &&
            e.MousePoint.Y < _y)
        {
            using (var updater = ParentSurface.SuspendUpdates())
            {
                ParentSurface.ZoomExtents();
                ParentSurface.ResumeUpdates(updater);
            }

            e.Handled = true;
        }
        else
            base.OnModifierMouseUp(e);
    }
}
1 vote
18k views

Hi

I would like to do some logic after zooming in but can not find to witch event I should subscribe or overwrite ?

3 votes
20k views

I’m wondering what the established methods would be for the following scenario:

You generate data in your own assembly and dump it into an XyDataSeries and point or line render series with an IChartSeriesViewModel object and bind that using the SeriesSource api.

But it is relatively common to have additional metdata about a given datapoint that is keyed to something other than an X or Y value. For example, the plot may be based on the a computed number that is independent of a time value, but you still want to display the time value for that chart in the rollover tooltip.

What are the options for dealing with this in scichart?

Best and thanks!

  • dsantimore asked 11 years ago
  • last active 2 years ago
0 votes
9k views

I want to paint my time axis like this:
Chessboard ruler
Or just highlight last week, day, hour.
Is there way to apply style only on part of axis?

0 votes
17k views

Good day, everybody!
I’ve got a problem. I’m working with inherited class from LineAnnotation- MarkerLineAnnotation. I’ve added some fields to the class. When I set X1=0 and X2=100000, displayed the element on SciChartSurface, I tried to zoom in. But after a few zooms my MarkerLineAnnotations had disappeared.
After that situation I set X1=0 and X2=10000 and tried to zoom in. I could zoom in my custom annotations for a long time, but they had disappeared too.

How can I solve this problem?
I’ve attached screenshots describing this problem. (Image 1-normal size for line with X1=0 and X2=10000 , Image 2-zoom, when disappearing took place for line with X1=0 and X2=10000; Image 3-normal size for line with X1=0 and X2=100000 , Image 4-zoom, when disappearing took place for line with X1=0 and X2=10000)
Thanks in advance.

  • Egor asked 10 years ago
  • last active 10 years ago
0 votes
12k views

To whom this may concern:

I’m having a slight issue (bug, possibly?) with custom annotations. I have created a custom annotation with an image (XAML shown below)

<s:CustomAnnotation x:Class="Dashboard.SciChartCustomComponents.CustomAnnotations.MicrostructureAnnotation"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                    xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
                    xmlns:local="clr-namespace:Dashboard.SciChartCustomComponents.CustomAnnotations"
                    mc:Ignorable="d">

    <Border BorderBrush="White" BorderThickness="2" Background="Black">
        <StackPanel>
            <Image x:Name="annotationImage" Stretch="None" Width="150" Height="100" Visibility="Collapsed"/>
            <TextBlock x:Name="annotationText" HorizontalAlignment="Center"/>
            <TextBlock x:Name="parameterText" HorizontalAlignment="Center" Visibility="Collapsed"/>
        </StackPanel>
    </Border>

</s:CustomAnnotation>

The image is applied with the following code (note the anchor points are bottom-right):

var annotation = new MicrostructureAnnotation
{
    HorizontalAnchorPoint = HorizontalAnchorPoint.Right,
    VerticalAnchorPoint = VerticalAnchorPoint.Bottom,
    IsEditable = true,
    X1 = xValue, // Both Obtained from hitpoint X- and Y-Values
    Y1 = yValue
};

annotation.annotationImage.Source = // some image Uri
annotation.annotationText.Text = // some text
annotation.parameterText.Text = // some other text

So this successfully shows the annotation as i liked, shown in 1.png.

Now I have a function that collapses the visibility of the image, which yields an annotation that is removed from its anchor point (although the top-left location remains the same), shown in 2.png.

If I try to move the annotation after removing the image, the anchor point is in the location of where the top-left anchor should be when the image collapses but the image is still in the wrong location, shown in 3.png.

When I finally do move the annotation, the annotation moves away from the cursor to the top-left anchor point, shown in 4.png.

Again i’m not sure if this is a bug, but could someone please advise?

Thanks kindly!

— Ari

Edit: I don’t have this problem when setting the anchor points to top-left.

  • Ari Sagiv asked 8 years ago
  • last active 8 years ago
1 vote
5k views

Hi,

I want to change the grid distance between the two slices dynamically in both X , Y and Z direction. But whatever the value I set for StepZ and StepX, nothing changes in the output. I still see the same graph.

Please can you suggest if there is any way to achieve this.

I am attaching the code of waterfall example here.

0 votes
9k views
  <s:SciChartSurface x:Name="sciChart" Grid.Row="0"
                       s:ThemeManager.Theme="Chrome"
                       LeftAxesPanelTemplate="{StaticResource YAxesPanel}"
                       RightAxesPanelTemplate="{StaticResource YAxesPanel}">

        <s:SciChartSurface.RenderableSeries>
            <s:FastLineRenderableSeries SeriesColor="#FFFF1919" YAxisId="Ch0" />
            <s:FastLineRenderableSeries SeriesColor="#FFFC9C29" YAxisId="Ch1" />
            <s:FastLineRenderableSeries SeriesColor="#FFFF1919" YAxisId="Ch2" />
            <s:FastLineRenderableSeries SeriesColor="#FFFC9C29" YAxisId="Ch3" />
        </s:SciChartSurface.RenderableSeries>

        <s:SciChartSurface.YAxes>
            <s:NumericAxis x:Name="Ch0" Style="{StaticResource YAxisStyle}" Id="Ch0" Grid.Row="0" DrawMajorTicks="False" DrawLabels="False" />
            <s:NumericAxis x:Name="Ch1" Style="{StaticResource YAxisStyle}" Id="Ch1" Grid.Row="2" />
            <s:NumericAxis x:Name="Ch2" Style="{StaticResource YAxisStyle}" Id="Ch2" Grid.Row="4" />
            <s:NumericAxis x:Name="Ch3" Style="{StaticResource YAxisStyle}" Id="Ch3" Grid.Row="6" />
        </s:SciChartSurface.YAxes>

        <s:SciChartSurface.XAxis>
            <s:NumericAxis Name="xAxis" />
        </s:SciChartSurface.XAxis>


        <s:SciChartSurface.Annotations>
                    <s:BoxAnnotation YAxisId="Ch1" Name="boxAnnotationCh1" Background="#33FF6600" BorderBrush="#77FF6600" BorderThickness="1" CornerRadius="3" IsEditable="true" />
            <s:BoxAnnotation YAxisId="Ch2" Name="boxAnnotationCh2"  Background="#33FF6600" BorderBrush="#77FF6600" BorderThickness="1" CornerRadius="3" IsEditable="true" />
            <s:BoxAnnotation YAxisId="Ch3" Name="boxAnnotationCh3"  Background="#33FF6600" BorderBrush="#77FF6600" BorderThickness="1" CornerRadius="3" IsEditable="true" />
                     </s:SciChartSurface.Annotations>
    </s:SciChartSurface>

How can I make BoxAnnotations editable?
I can’t move the boxes in the chart.

0 votes
17k views

Hello,
I would like to allow user click on Legend and highlight the corresponding Series on the chart but I don’t know if this feature is supported or not.

I tried to add mouse events to the Legend Modified but it seems like mouse events are not triggered

This is the simple code that I am using

<s:LegendModifier x:Name="chlLegend" ShowLegend="True" LegendPlacement="Top" Orientation="Horizontal" MouseDown="chlLegend_MouseDown" ScrollViewer.HorizontalScrollBarVisibility="Auto" />

Before investigating more I would like to ask you if you have any hints which is the correct way to implement this behavior.
Is the LegendModifier suitable for this or should I override instead the Legend Control Template?

Thank you in advance for the support

1 vote
5k views

Memory leak in Fifo mode with Visual Xccelerator Engine enabled.

Two screenshots with Visual Xccelerator Engine enabled and disabled.
In a real application, the behavior is repeated. GS.Collect does not solve the problem.

It looks like the problem occurs on the integrated video card. AMD. When switching to a discrete video card. Memory is stable.

1 vote
14k views

Here is XAML code which works:

                                <!--  Defines the renderable series. Each series may be styled  -->
                                <visuals:SciChartSurface.RenderableSeries>
                                    <visuals:FastLineRenderableSeries SeriesColor="Red" DataSeries="{Binding Measured1StPointsSeries}" IsVisible="{Binding Is1StMeasured}">
                                    </visuals:FastLineRenderableSeries>

                                    <visuals:FastLineRenderableSeries SeriesColor="Green" DataSeries="{Binding Measured2NdPointsSeries}"  IsVisible="{Binding Is2NdMeasured}">
                                    </visuals:FastLineRenderableSeries>

                                    <visuals:FastLineRenderableSeries SeriesColor="Blue" DataSeries="{Binding Measured3RdPointsSeries}"  IsVisible="{Binding Is3RdMeasured}">
                                    </visuals:FastLineRenderableSeries>
                                </visuals:SciChartSurface.RenderableSeries>

                                <!--  Defines the XAxis, using an explicit VisibleRange  -->
                                <visuals:SciChartSurface.XAxis >
                                    <visuals:NumericAxis AxisTitle="RA Pump Current, A" DrawMajorTicks="True" FontSize="30" TitleFontSize="35" Orientation="Horizontal"  MajorDelta="5" MinorDelta="1" AutoTicks="True" AutoRange="Always" VisibleRange="{Binding PowerXRange}">
                                    </visuals:NumericAxis>
                                </visuals:SciChartSurface.XAxis>

                                <!--  Defines the YAxis  -->
                                <visuals:SciChartSurface.YAxis>
                                    <visuals:NumericAxis AxisAlignment="Left" FontSize="30" TitleFontSize="35" AxisTitle="Power, W" MajorDelta="0.2" MinorDelta="0.1" AutoTicks="False" AutoRange="Always" VisibleRange="{Binding PowerYRange}"/>
                                </visuals:SciChartSurface.YAxis>

                                <!--  Declare ChartModifiers  -->
                                <visuals:SciChartSurface.ChartModifier>

                                    <visuals:LegendModifier x:Name="PowerLegendModifier" Background="White" GetLegendDataFor="AllVisibleSeries"/>

                                </visuals:SciChartSurface.ChartModifier>

                            </visuals:SciChartSurface>
                            <visuals:SciChartLegend  x:Name="PowerChartLegend" Foreground="Black" FontSize="28" Background="White"  LegendData="{Binding LegendData, ElementName=PowerLegendModifier, Mode=OneWay}" Margin="125,23,0,0"  />

But I tried to create chart programaticall to render it in memory and export to bitmap, but I can not add legend:

        //Scichart thing

        var series1St = new FastLineRenderableSeries() {
            SeriesColor = Colors.Red,
            DataSeries = Measured1StPointsSeries,
            IsVisible = Is1StMeasured

        };
        var series2Nd = new FastLineRenderableSeries() {
            SeriesColor = Colors.Green,
            DataSeries = Measured2NdPointsSeries
        };
        var series3Rd = new FastLineRenderableSeries() {
            SeriesColor = Colors.Blue,
            DataSeries = Measured3RdPointsSeries
        };


        var xAxes = new AxisCollection() { new NumericAxis() };

        var yAxes = new AxisCollection() { new NumericAxis() };

        //var powerLegendModifier = new LegendModifier() {
        //    Background = Brushes.White,
        //    GetLegendDataFor = SourceMode.AllVisibleSeries

        //};

        var surface = new SciChartSurface() {
            //ChartTitle = "Rendered In Memory",
            XAxes = xAxes,
            YAxes = yAxes,
            RenderableSeries = new ObservableCollection<IRenderableSeries>() { series1St, series2Nd, series3Rd },
            ChartModifier = new LegendModifier() {
                Background = Brushes.White,
                GetLegendDataFor = SourceMode.AllVisibleSeries
            }
        };

Seems like SourceMode.AllVisibleSeries to be the culprit – tries to update non existing data. How could I have chart modifier added with c# direct code?

0 votes
6k views

Hello,

I’m having intermitent behavior of column selection when using the DataPointSelectionModifier.

I’m using the PointMetadata API + PaletteProvider to fill the “selected color” of a column when the DataPoint Selection modifier is used.

Sometimes clicking on a column apparently does not trigger the selection changed event.

I have created a sample app with the code I’m using.

I would like to know if this is a bug or I’m doing something wrong.

Thank you.
Sebastian

1 vote
2k views

Dear SciChart team,

We have been subscribing SciChart WPF 2D Pro for a few years, usually I made some WPF user controls which have SciChartSurface in it, and we use it to display some data in the form of charts. Since my colleagues do not have the developer’s license, so they can’t see these charts on their laptop when they were debugging the solution, but it was fine, they do not care the charts.

Last week I updated the SciChart on my laptop, it works fine on my PC. but it always crashed when my colleagues debugging the solution.

The error info is:
Cannot attach VerticalLineAnnotation, because it is already used.

The call stack is full of SciChart’s calling

at SciChart.Charting.ChartModifiers.VerticalSliceModifier.sfp(VerticalLineAnnotation hhv)
at SciChart.Charting.ChartModifiers.VerticalSliceModifier.sge()
at SciChart.Charting.ChartModifiers.VerticalSliceModifier.OnAttached()
at SciChart.Charting.ChartModifiers.ModifierGroup.geq(IChartModifier gwl)
at SciChart.Core.Extensions.EnumerableExtensions.ForEachDo[T](IEnumerable1 enumerable, Action1 operation)
at SciChart.Charting.ChartModifiers.ModifierGroup.gep(IEnumerable`1 gwk)
at SciChart.Charting.ChartModifiers.ModifierGroup.OnAttached()
at SciChart.Charting.Visuals.SciChartSurface.sjj(IChartModifier anx)
at SciChart.Charting.Visuals.SciChartSurface.sht()
at SciChart.Charting.Visuals.SciChartSurface.OnSciChartSurfaceLoaded()
at SciChart.Charting.Visuals.SciChartSurfaceBase.gtm(Object aqg, RoutedEventArgs aqh)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at ABB.Motion.WorkBench.App.Main()

  • Chris Chen asked 2 years ago
  • last active 2 years ago
0 votes
12k views

V. 2.11.4972.38029:
Hello,

in my application I want to use a RubberBandXyZoomModifier and a CursorModifier simultaneously.

my Code:

                    <SciChart:LegendModifier x:Name="legend" GetLegendDataFor="AllSeries"/>
                    <SciChart:XAxisDragModifier/>
                    <SciChart:YAxisDragModifier/>
                    <SciChart:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>
                    <SciChart:CursorModifier ShowTooltip="True" ShowAxisLabels="False" ShowTooltipOn="Always" TooltipLabelTemplate="{StaticResource ToolTipLabelTemplate}"/>
                    <SciChart:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True" IsXAxisOnly="False" ZoomExtentsY="False" IsAnimated="True" />
                    <SciChart:MouseWheelZoomModifier />

The zoom function works but there is no highlighter visible. If I remove the CursorModifier then it works great.

How can I resolve this?
Thanks!

  • miri asked 11 years ago
  • last active 7 years ago
0 votes
11k views

Hi!

Connecting to my latest reply on this thread
https://www.scichart.com/questions/question/strange-behaviour-of-collapsing-panes#sabai-entity-content-8887
I still can’t make panes disappear correctly with multiple panes.

Here is the sample project demonstrating what you proposed on the previous thread, the first chartpane is shown but the panes do not resize.
https://drive.google.com/open?id=0B19IHNOVxrKCR21aeG4tOHlRNmM

Please make this project work as expected (i.e. there is 3 panes in the list, but only the second displayed in the list on the area of the 3 panes) to show me, how this works.

thanks.

Kristóf

0 votes
10k views

Hi,

I’m in need to draw polygons around series, so they must scale correctly when zooming and support transparency.
So far I am unable to find a native and simple way to do it, can anybody help me?

Thank you so much

0 votes
9k views

Hi All,
i have a problem when i added the Abt.Controls.Scichart.Core.Wpf.Example in my project like in the picture ! Thank you !
Best Regards Sahar

  • sahar Les asked 9 years ago
  • last active 9 years ago
1 vote
2k views

Following the “How to Template the Axis Title” sample and using a simple TextBlock with TextWrapping=”Wrap” I am seeing strange resizing of the main chart elements especially with a scrollbar.

The attached image shows an example app (code available).

The first chart is normal (title clipped).
The second chart has the wrapping textblock and a scrollbar. The scrollbar is off the edge, the chart view area is off the edge. The entire axis label is still not visible (“Lorem ipsum dolor sit amet, consectetur”)
The third chart has no scrollbar so fits elements on the window, but still does not show all text.

The components creeping offscreen is the big problem I cannot figure out how to fix. Please

Note also happens in v7

1 vote
10k views

Hi,
I have a SciChartGroup with 2 SciChartSurfaces…
It seems the SciChartGroup is adding the surface Title on its own somewhere.
What do I have to do to not display the 2nd surfaces title in white in the top-left corner?
Thanks!

(I’d attach the project, but the buttons on the ask page aren’t attaching anything – in chrome anyway…)

Here is the codebehind:

using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;
using System.Windows.Input;
using Abt.Controls.SciChart;
namespace nameOn2ndSurface
{
    public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
}
public class datamodel : INotifyPropertyChanged
{
    #region PropertyChanged

    public event PropertyChangedEventHandler PropertyChanged;
    protected void OnPropertyChanged(PropertyChangedEventArgs e)
    {
        if (PropertyChanged != null)
            PropertyChanged(this, e);
    }
    protected void notifyPropertyChanged(string propertyName)
    {
        PropertyChangedEventArgs e = new PropertyChangedEventArgs(propertyName);
        OnPropertyChanged(e);
    }

    #endregion

    ObservableCollection<DataModelGraph> graphs;

    public datamodel()
    {
        graphs = new ObservableCollection<DataModelGraph>();
        graphs.Add(new DataModelGraph() { Title = "graph1" });
        graphs.Add(new DataModelGraph() { Title = "graph2" });
    }
    public ObservableCollection<DataModelGraph> Graphs
    {
        get
        {
            return graphs;
        }
    }
}
public class DataModelGraph : IChildPane, INotifyPropertyChanged
{
    #region PropertyChanged

    public event PropertyChangedEventHandler PropertyChanged;
    protected void OnPropertyChanged(PropertyChangedEventArgs e)
    {
        if (PropertyChanged != null)
            PropertyChanged(this, e);
    }
    protected void notifyPropertyChanged(string propertyName)
    {
        PropertyChangedEventArgs e = new PropertyChangedEventArgs(propertyName);
        OnPropertyChanged(e);
    }

    #endregion

    string title;
    public DataModelGraph()
    {
        title = "graph";
    }
    public string Title
    {
        get
        {
            return title;
        }
        set
        {
            if (title != value)
            {
                title = value;
                notifyPropertyChanged("Title");
            }
        }
    }

    public ICommand ClosePaneCommand { get; set; }
    public void ZoomExtents()
    {
    }
}

}

Here is the xaml:

<Window x:Class="nameOn2ndSurface.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.abtsoftware.co.uk/scichart" 
    xmlns:local="clr-namespace:nameOn2ndSurface"
    Title="MainWindow" Height="350" Width="525">
<Window.Resources>
    <local:datamodel x:Key="data" />
    <Style TargetType="s:SciChartSurface">
        <Setter Property="Foreground" Value="Red"/>
        <Setter Property="ChartTitle" Value="{Binding Title}"/>
    </Style>
</Window.Resources>
<Grid DataContext="{DynamicResource data}">
    <s:SciChartGroup x:Name="group"
                     ItemsSource="{Binding Graphs}"
                     >
        <s:SciChartGroup.ItemTemplate>
            <DataTemplate>
                <s:SciChartSurface />
            </DataTemplate>
        </s:SciChartGroup.ItemTemplate>
    </s:SciChartGroup>
</Grid>

  • dwoerner asked 9 years ago
  • last active 5 months ago
0 votes
10k views

Is there a sample or documentation that you can point me to be able to create the chart panels on the fly?

0 votes
14k views

Hello.

Thank you for creating great chart library.
I’m now using a trial version for test that is enable to use at project that I’m concerned.

I have one problem that when I set zoom function to chart, and zoomed too much, axis label disappears.
(I used mouse scroll zoom, I attached zoom before image and after image)

How can I control this problem?
Is there any properties or setting for this?

0 votes
5k views

Hello,

i’ve created the following sample application were i tried to use CategoryDateTimeAxisViewModel as x axis:

class MainViewModel : INotifyPropertyChanged
{
    private IAxisViewModel _xAxis;
    private IAxisViewModel _yAxis;

    public event PropertyChangedEventHandler PropertyChanged;

    public IAxisViewModel XAxis
    {
        get { return _xAxis; }
        set
        {
            if (_xAxis != value)
            {
                _xAxis = value;
                OnPropertyChanged();
            }
        }
    }

    public IAxisViewModel YAxis
    {
        get { return _yAxis; }
        set
        {
            if (_yAxis != value)
            {
                _yAxis = value;
                OnPropertyChanged();
            }
        }
    }

    public MainViewModel()
    {
        XAxis = new CategoryDateTimeAxisViewModel
        {
            AxisTitle = "X-Achse",
            Id = "DefaultAxisId",
            AxisAlignment = AxisAlignment.Bottom,
            AutoRange = AutoRange.Always,
            TickProvider = new DateTimeTickProvider()
        };
        YAxis = new NumericAxisViewModel
        {
            AxisTitle = "Y-Achse",
            Id = "DefaultAxisId",
            AxisAlignment = AxisAlignment.Left,
            AutoRange = AutoRange.Always,
            TickProvider = new NumericTickProvider()
        };
    }

    [NotifyPropertyChangedInvocator]
    protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}

<Window x:Class="WpfApp1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:WpfApp1"
    xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
    mc:Ignorable="d"
    Title="MainWindow" Height="450" Width="800">
<Window.DataContext>
    <local:MainViewModel/>
</Window.DataContext>
<DockPanel>
    <s:SciChartSurface DockPanel.Dock="Top"
                       ChartTitle="Testdiagramm"
                       XAxis="{s:AxesBinding XAxis}"
                       YAxis="{s:AxesBinding YAxis}">
    </s:SciChartSurface>
</DockPanel>

When i run the application i can see only the axis titles but no axes, gridlines etc. However when i replace CategoryDateTimeAxisViewModel with DateTimeAxisViewModel everything works fine and looks like expected. What am i doing wrong?

Best regards
Alexander

0 votes
9k views

I want to display a line series chart with 3500 series. But the application hangs 20-30 seconds because SciChart is doing something in the UI thread. I’ve read your article “https://www.scichart.com/performance-improvements-scichart-wpf-v5-1/” and set the extension property s:PerformanceHelper.EnableExtremeDrawingManager=”True” and s:PerformanceHelper.EnableExtremeResamplers=”True”. But there is no improvement!
You can reproduce this issue using your example “WaterfallChartDemo” and increase the series count from 50 to 3500.

Why s:PerformanceHelper.EnableExtremeDrawingManager=”True” and s:PerformanceHelper.EnableExtremeResamplers=”True” has no effect?

  • Tobias asked 5 years ago
  • last active 5 years ago
0 votes
5k views

I recently needed to change the Rotation Angle of a polar plot from the default to 90 degrees. We have line annotations for different points on the polar plot. After the change, the annotation was still plotted on the default Rotation Angle.

I manually updated the points like this for the annotations to work:

var line = new LineAnnotation();

                var x1 = (double)NewSeries.DataSeries.XValues[0];
                var x2 = (double)NewSeries.DataSeries.XValues[1];

                if (x1.Between(0, 90) && x2.Between(0, 90))
                {
                    x1 += 270;
                    x2 += 270;
                }
                else
                {
                    x1 -= 90;
                    x2 -= 90;
                }

                line.X1 = x1;
                line.X2 = x2;

Is there another way to update the annotation or is something like this the preferred way?

0 votes
7k views

Hello,

I need to plot an arrow line serie, that is, a fastLine rendearable serie where the point markers are connected by arrow
(in the middle or the end) lines.

Screenshots attached.

Thanks in advance.

  • argonte asked 7 years ago
  • last active 7 years ago
0 votes
6k views

Hello,

how can i implement a vertically stacked y axis chart like in your example (WPF Chart Vertically Stacked YAxis) with MVVM and a varying number of y axes. Your example has a fixed number of y axes and the needed YAxesPanel is directly implemented in your xaml code. What is the best way to achieve the same result with a varying number of y axis?

Best regards
Alexander

1 vote
7k views

Dear all, I am trying to export a heat map that I have generated that you can see at the right side of the attached image. However, the resulting XPS generated is the figure at the left. As one can see they are not very similar as one would expect. I have checked my code, but can’t seem to find the problem. Parts of my code are shown here to give more info. If anyone has tips why this strange result may occur , let me know please.

 <s:SciChartSurface x:Name="sciChart"  ChartTitle="Carbon and DBE">


       <s:SciChartSurface.RenderableSeries>
           <s:FastHeatMapRenderableSeries x:Name="heatmapSeries" Opacity="0.5" Maximum="100">
               <s:FastHeatMapRenderableSeries.ColorMap>
                   <LinearGradientBrush>
                       <GradientStop Offset="0" Color="DarkBlue"/>
                       <GradientStop Offset="0.2" Color="CornflowerBlue"/>
                       <GradientStop Offset="0.4" Color="DarkGreen"/>
                       <GradientStop Offset="0.6" Color="Chartreuse"/>
                       <GradientStop Offset="0.8" Color="Yellow"/>
                       <GradientStop Offset="1" Color="Red"/>
                   </LinearGradientBrush>
               </s:FastHeatMapRenderableSeries.ColorMap>
           </s:FastHeatMapRenderableSeries>

       </s:SciChartSurface.RenderableSeries> .
    </s:SciChartSurface>

and code

    double[,] a = x.Normalized2DArray(100);
                    Heatmap2DArrayDataSeries<double, double, double> heatmap = new Heatmap2DArrayDataSeries<double, double, double>(a, ix => (double)ix * x.binSizeX, iy => (double)iy * x.binSizeY);
                      heatmapSeries.DataSeries = heatmap;
          sciChart.ExportToFile(@"C:\Temp\chart.xps", ExportType.Xps, true, new Size(2000, 2000));
0 votes
7k views

.Net 6 MAUI preview has been released, so may i know scichart support MAUI ?
Can we use Xmarin charts directly to MAUI app ?

Can you provide some examples for MAUI ?

  • Abhilash R asked 3 years ago
  • last active 8 months ago
0 votes
8k views

I’m trying to set the visible range property of a CategoryDateTimeAxis through MVVM. I’m following the general instructions detailed here for converting between pixel & data coordinates on the axis:

https://www.scichart.com/questions/question/categorydatetimeaxis-in-mvvm#sabai-inline-nav

I have the following code in my viewmodel:

XAxis.OnBeginRenderPass();
var calc = XAxis.GetCurrentCoordinateCalculator();
var coordCalc = calc as ICategoryCoordinateCalculator;

XAxis is a CategoryDateTimeAxis injected from the view. I call OnBeginRenderpass as I saw in another forum post that this will ensure that the CoordinateCalculator is initialized.

calc shows in the debugger as:

  • calc {A.} Abt.Controls.SciChart.Numerics.CoordinateCalculators.ICoordinateCalculator {A.}

The coordCalc variable ends up assigned to NULL, as the ICoordinateCalculator< double > cannot be cast to the interface.

How do I accomplish the above?

Thanks, Asher

  • ashernew asked 8 years ago
  • last active 8 years ago
0 votes
8k views

Does scichart support smith charts? If not, it is possible to build a smith chart based on polar chart?

Thanks!
Manuel

1 vote
7k views

Hello,
I have a polar chart in my wpf application and I want to get data value from pixel coordinates, once the user has
clicked on scichart surface. This is what I tried:

   mouseClick = (s, arg) =>
        {
            var mousePoint = arg.GetPosition((UIElement)this.sciChartSurface.GridLinesPanel);

    //From cartesian to polar conversion
            double xpolar = Math.Atan(mousePoint2.Y / mousePoint2.X);
            double ypolar = Math.Sqrt(Math.Pow(mousePoint2.X, 2) + Math.Pow(mousePoint2.Y, 2));

            double a = sciChartSurface.RenderableSeries[_trace_index].XAxis.GetCurrentCoordinateCalculator().GetDataValue(xpolar);
            double b = sciChartSurface.RenderableSeries[_trace_index].YAxis.GetCurrentCoordinateCalculator().GetDataValue(ypolar);
};

This code gets mouse point coordinates, then it converts pixel coordinates to polar, and then (a,b) data are obtained with
GetCurrentCoordinateCalculator().GetDataValue(), but a and b have some strange values. I’ve tried just the opposite (from data value to pixel coordinate using GetCoordinate()), but it still doesn’t work. Any ideas? Is it possible to get data from pixel coordinates in polar chart?

Thanks in advance,
Juan

0 votes
4k views

[remind]
Please tell me how to add licence to 2 computer I have.

1 vote
5k views

I am facing the following two issues related to application crash and unable to perform 3d object rotation in release mode.

Issue 1: Application Crash
I am using PointLineRenderableSeries3D object to render the Data series points.
I have a timer which ticks every 1 sec and have new data series points with some rotation of previous values.
Hence will try to add new points on every 1 sec to the same object data series

timer1.tick +=(() => {
// rendererUpdate is object of PointLineRenderableSeries3D

        using (rendererUpdate.DataSeries.SuspendUpdates()) 
            {
              var newData = GetNewPointsWithRotation( rendererUpdate.DataSeries, 30);//30 is angle of rotation for older points
                rendererUpdate.DataSeries = newData;
            }

}

Issue 2: When i run the application in release mode, i am unable to perform manual rotation using mouse dragging for the 3d sphere FreeSurfaceRenderableSeries3D object SurfaceMesh referred in the code.
When the application is running in release mode , i tried to drag rotate the 3d shape, but the 3d object is not responding to the mouse drag event (Press hold mouse left button and drag).

The attachment contains the wpf code (xaml and cs) in the same file.
Code refers .jpg file, Please refer any local jpg file to repro the issue.

Please suggest the possible reasons and fixes of the same.
Please provide the possible insights of the same.

Showing 51 - 100 of 3k results