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

1 vote
9k views

To whom this may concern:

I have a Custom Renderable Series that I use to draws a polygon around the points on a scatter plot.

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

    var blobShellPoints = getBlobShellPoints();

    using (var polyPen = renderContext.CreateBrush(Colors.DodgerBlue, 0.3))
    {
        var startCoordinates = getCoordinatesFor(blobShellPoints[0].X, blobShellPoints[0].Y);

        using (var blobDrawingContext = renderContext.BeginPolygon(polyPen, startCoordinates.X, startCoordinates.Y))
        {
            foreach (var point in blobShellPoints)
            {
                var pointCoords = getCoordinatesFor(point.X, point.Y);

                blobDrawingContext.MoveTo(pointCoords.X, pointCoords.Y);
            }
        }
    }
}

I would like to know if there is some way to show a tooltip when the mouse hovers over the said drawn polygon. I don’t see any ability to do this after I finish creating the polygon or before the end of the encapsulated polyPen disposable. It should look something like the attached image.

Can you please advise? Thank you kindly for your response!

P.S. I realize some of this code may be obsolete since I’m using SciChart 5. If this is only possible in 6+ then that’s understandable.

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

I use SeriesSelection modifier on SciChartSurface. I need only one series to be selected at a particular time (even if I try to select with ctrl pressed). Is there any modifier setting for this?

1 vote
5k views

I must be missing something here.
I’ve followed the tooltips and hit test 3d chart examples.
All I need is the X, Y, Z coordinates that you get with the tooltip.
The only example I’ve found is for scatter points using VertexSelectionModifier3D and OnScatterDataChanged event.
But I cant figure out how to do something similar with GridDataSeries (Uniform or non-uniform).
I’ve tried the “ToolTipOpening” event but it doesn’t trigger when the tooltip opens.
This is the last thing I need before I commit to a licence.
The chart is working fine for my use case otherwise.
Thanks!

  • Blaz Majcen asked 11 months ago
  • last active 10 months ago
1 vote
2k views

When I put localized text in my annotations, and the user selects a different language while the chart is showing, do I have to rebuild my annotations?
I had hoped that I could register ‘globalized’ texts in my annotation object, and localize them in the getter method, but it seems that the getter method is not called every time the annotation text is displayed in a ToolTip

1 vote
0 answers
477 views

Hi!
I have next error crash in my desktop app:
Application: DRYERRPP.NET.exe
CoreCLR Version: 8.0.123.58001
.NET Version: 8.0.1
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack:
at ukt.aafs(System.Runtime.InteropServices.HandleRef)
at ukt.aafs(System.Runtime.InteropServices.HandleRef)
at SciChart.Charting2D.Interop.TSRWPFTarget.ResolveFinalImage()
at nki.ysm()
at naj.nmo(nkf, SciChart.Charting2D.Interop.SCRTRenderContext)
at nkk.Dispose()
at SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()
at SciChart.Charting.Visuals.SciChartSurface.ses(System.Object, SciChart.Drawing.Common.DrawEventArgs)
at SciChart.Drawing.Common.RenderSurfaceBase.OnDraw()
at SciChart.Drawing.Common.RenderSurfaceBase.OnRenderTimeElapsed()
at SciChart.Drawing.Common.RenderTimer.nqv()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)
at System.Windows.Media.MediaContext.RenderMessageHandler(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at DRYERRPP.NET.App.Main()
Can somebody help me?

1 vote
19k views

Hi,

I’m using the following code to create a text annotation:

private void AddLabel(DateTime StartTime, DateTime EndTime, string label)
{
    TextAnnotation text = new TextAnnotation();
    text.YAxisId = "LeftAxis";
    text.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center;
    text.Text = label;
    text.CoordinateMode = AnnotationCoordinateMode.RelativeY;
    text.X1 = StartTime;
    text.X2 = EndTime;
    text.Y1 = .05;
    text.Y2 = 0;
    text.TextAlignment = TextAlignment.Center;
    text.TextStretch = Stretch.UniformToFill;
    text.Background = new SolidColorBrush(Color.FromArgb(0x80, 0x80, 0x80, 0x80));
    text.BorderBrush = new SolidColorBrush(Color.FromArgb(0xC0, 0xD0, 0xD0, 0xD0));
    text.BorderThickness = new Thickness(2);
    sciChart.Annotations.Add(text);
}

Unfortunately the text doesn’t scale like I want it to though. The size of the text stays the same even when the chart is small, making the height greater than .05. Is there a way to make the text get smaller as the chart is shrunk so that it stays within the .05 Y boundary?

I attached 2 images to illustrate the issue.

Thanks,
Greg

1 vote
9k views

Hi!

I haven’t been working with scichart for a while and today I tried upgrading my application from 1.7 to 2.1. I got so many compiling errors and what not that I had to give it up. Is there any sort of upgrade-feature list like there was when upgrading to 1.5?

Lisbeth

1 vote
10k views

I want to add series dynamicaly in code behind. I am creating my own LegendData which needs to add series to the chart.

I was thinking of adding all series at once and make them invisible and then when i want to show one i just change the IsVisible flag.

Will this result in good performance, or would it be faster if I add and remove the series each time i want to see them?

1 vote
10k views

Hello guys~

I’m trying to display custom label text at Y-Axis using a LabelProvider.
Everything was OK, but I find a strage text block when charater ‘e’ combine with other charater.

e.g.) “ASDF”, “EEEE”, “eeee” good, “AEDF”, “AEEEE”, “teeee” not good.

Check attached image please.

Thank you.
Best regards,
Sungchul

1 vote
20k views

I have got a CustomTextAnnotation like in this example CustomTextAnnotation
I added a Rendertransform like this.

<s:TextAnnotation.RenderTransform>
    <RotateTransform Angle="90"/>
</s:TextAnnotation.RenderTransform>

But the AnchorPoint is not used as rotation center.
I thought of using ToCoordinate() but need a calculator for that which is not available within CustomTextAnnotation.

What is best practice to achive the requested rotation in sciChart?

1 vote
15k views

Hello again!

I’ve got a problem with LineAnnotation display on the axis: it is blurry (image 1). I have tried to use UseLayoutRounding/SnapsToDevicePixels properties from this post https://www.scichart.com/questions/question/2-1-1-lines-are-sometimes-blurry-when-added-to-modifier-surface, but it doesn’t work. Any ideas to make this LineAnnotation look like other annotation on surface?

Thanks in advance!

  • Egor asked 9 years ago
  • last active 5 years ago
1 vote
7k views

How can I print a scaled chart. For Example my chart has a range from 0 to 10 and 1 step shall be 1 centimeter on the printed paper.

0…10 in chart is from 0 to 10 centimeter?

1 vote
8k views

Hi everyone,

I have the column chart as the image below. However, they overlap each other when I don’t set the DataWidthPoint.
If I set the DataWidthPoint = 0.2 the chart is ok but in another circumstance the width column is quite small.
Are there any way to add some spacing between columns in FastColumnRenderableSeries .

Thanks.

Image

  • Quan Tran asked 8 years ago
  • last active 8 years ago
1 vote
6k views

Hello,

I’ve been trying to add a FastLineRenderableSeries in conjunction with PolarXAxis and PolarYAxis.

The series draws “arcs” between each data point. Is there a way to flatten the series to draw only straight lines? I just feel confused since if I add a FastLineRenderableSeries I would expect lines.

I attach an image just in case.

Thank you.

Regards,
Sebastian

1 vote
11k views

Dear all,

In our application we have a chart that we need to explot into a BMP file at a given size.
For our scenario the process is as below :

1 – From the chart which is display to user at a default size we force the Width and Height of the chart to our desired size

mysciChart.Width = 480;
mysciChart.Height = 220;
mysciChart.UpdateLayout();

2 – We can then use the build in Export To file method to export the file

if (mysciChart.ActualWidth > 10 && mysciChart.ActualHeight > 10)
{
    mysciChart.ExportToFile(myBMPFile, ExportType.Bmp, false);
    }

The chart is then exported to correct size but it is not refresh with data as shown in picture attached

please note that the code above is executed in the Main UI thread dispatcher

Any idea how to get the chart properly render in Export, is there a kind of refresh something to call on the chart before export when we change its size ?

Thnaks for help

  • sc sc asked 6 years ago
  • last active 6 years ago
1 vote
5k views

Hello,

is there a way to update the X-Axis Values within an XYDataSeries?
What I found was the Update function to update the Y-Values.
https://www.scichart.com/documentation/win/current/webframe.html#SciChart.Charting~SciChart.Charting.Model.DataSeries.XyDataSeries%602~Update.html

But I can’t figure out how to update the X Values of the DataSeries.

The XyzDataSeries3D does support the functionality to update also the X Value.
https://www.scichart.com/documentation/win/current/webframe.html#SciChart.Charting3D~SciChart.Charting3D.Model.XyzDataSeries3D%603~Update.html

But for the NonUniformGridDataSeries3D I can’t figure out how to update any point.

Maybe I am missing something, just let me know.

Best Regards,
Nick

1 vote
3k views

Hello,

I am trying to change the frequency range in the Y axis on the Heatmap to 100000 from 50000, but the plot does not seem to be working to scale to the proper frequency range on the Y axis. I expect the plot to keep the same scale around 20000 for the upper line when I change the upper scale to 100000, but the graph scales the upper line up to 40000. I’m using function Heatmap2DArrayDataSeries() and passing the series data along with TimeFunc() for mapping to X axis and FreqFunc() for mapping to Y axis. I made some changes to FreqFunc(), but it did not change the upper line to 20000. See below for my partial code. Thanks,

    protected override void OnDisplayLoaded()
    {
    ...
    ...
        _dopplersurface.YAxes[0].VisibleRange = YVisibleRange2; // YVisibleRange2 = {0, 100000}
        _surface.UpdateLayout();

    }

    private void PlotData()
    {
    ...
        ...
        heatmap2DArrayDataSeries = new Heatmap2DArrayDataSeries<DateTime, double, double>(_spectrogramBuffer, TimeFunc, FreqFunc);
        HeatmapRenderableSeries = heatmap2DArrayDataSeries;
    }

    double FreqFunc(int iy)
    {
        double FreqDelta = 1.0 / (time_queue[1] - time_queue[0]).TotalSeconds / (FFT_Points / 2.0);
        if (((FFT_Points / 2.0) * FreqDelta / 2) < (double)YVisibleRange2.Max); // FFT_Points = 1024
        {
            FreqDelta = FreqDelta * 2;
        }
        return iy * FreqDelta / 2; // Returns 0 if iy is 0 and 50000 if iy is 512
    }

    DateTime TimeFunc(int ix)
    {
        if (time_queue.Count > (ix * Step))
        {
            DateTime DateTimeTemp1 = time_queue[ix * Step];
            return DateTimeTemp1;
        }
        else
        {
            return time_queue[time_queue.Count - 1];
        }
    }
  • Hoa Duong asked 2 years ago
  • last active 2 years ago
1 vote
0 answers
2k views

I used both, but DataPointSelectionModifier doesn’t seem to work

  • ppp t asked 1 year ago
  • last active 1 year ago
1 vote
6k views

Hi SciChart team,

first of all I want to say that I still think SciChart is great! However, I am quite frustrated at the moment. In small applications, the chart and its annotations work very well (yes “Annotations are Easy!”), but in large industrial applications with many views and millions of lines of code, there are from time to time difficult complications with the chart. This is also the case now with the Annotation Creation Modifier. As far as I can see, the AnnotationCreationModifier.OnModifierMouseUp method uses the annotation’s IsSelected state to determine whether to create a new annotation or complete one. With custom composite annotation it can happen that a mouse click first selects the annotation and only then AnnotationCreationModifier.OnModifierMouseUp is called (see attached screenshots).
Sometimes it works, sometimes it doesn’t, depending on where the mouse is.
The AnnotationCreationModifier should not use the annotation’s IsSelected state to complete its internal “edit mode” and call “OnAnnotationCreated”.
Or is there already a solution for this?

regards,
Tobias

  • Tobias asked 12 months ago
  • last active 11 months ago
1 vote
6k views

I’m experimenting with creating a CustomRenderableSeries.

I was expecting VisualXcceleratorRenderSurface to perform the fastest. But what I am finding is that it is noticeably slower than XamlRenderSurface. By slower, I mean interaction with zoom/pan becomes choppy and resizing the window is choppy. Which is surprising because I’m really not rendering much at all.

We plan on rendering a lot more than this, but it already appears to struggling. Can you shed some light?

public class MyDataSeries : XyDataSeries<double>
{
    public MyDataSeries()
    {

    }
}

public class MyRenderableSeries : CustomRenderableSeries
{
    public MyRenderableSeries()
    {

    }

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

        if (DataSeries is not MyDataSeries series)
            return;

        using (var brush = renderContext.CreateBrush(Brushes.Red))
        using (var pen = renderContext.CreatePen(Colors.Black, true, 1))
        {
            for (int i = 0; i < series.Count; ++i)
            {
                double pos = (double)series.XValues[i];

                var x = renderPassData.XCoordinateCalculator.GetCoordinate(pos);
                var y = renderPassData.YCoordinateCalculator.GetCoordinate(pos);
                var s = renderPassData.XCoordinateCalculator.GetCoordinate(0) - renderPassData.XCoordinateCalculator.GetCoordinate(1);

                var points = CreateCircle(new Point(x, y), s);
                renderContext.FillPolygon(brush, points);
            }
        }
    }

    private List<Point> CreateCircle(Point pos, double radius)
    {
        var points = new List<Point>();

        int count = 1000;
        for (int i = 0; i < count; ++i)
        {
            double angle = (360.0 / count * i) * (Math.PI / 180);
            double x = Math.Cos(angle) * radius;
            double y = Math.Sin(angle) * radius;

            points.Add(new Point(pos.X + x, pos.Y + y));
        }

        points.Add(points[0]);

        return points;
    }
}

public class MyRenderableSeriesViewModel : BaseRenderableSeriesViewModel
{
    public override Type ViewType => typeof(MyRenderableSeries);
}

public class MyViewModel : BaseViewModel
{
    public List<IRenderableSeriesViewModel> RenderableSeriesViewModels { get; }

    public MyViewModel()
    {
        RenderableSeriesViewModels = new List<IRenderableSeriesViewModel>
        {
            Generate(Enumerable.Range(0, 25).Select(x => (double)x).ToArray()),
        };
    }

    private IRenderableSeriesViewModel Generate(double[] data)
    {
        var dataSeries = new MyDataSeries();
        dataSeries.Append(data, data);

        return new MyRenderableSeriesViewModel
        {
            DataSeries = dataSeries,
            StyleKey = "mySeriesStyle"
        };
    }
}


<UserControl x:Class="SciChart.Examples.Examples.SeeFeaturedApplication.Histogram.ViolinView"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:SciChart.Examples.Examples.SeeFeaturedApplication.Histogram"
         mc:Ignorable="d">

<UserControl.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/SciChart.Charting;component/Themes/Default.xaml" />
        </ResourceDictionary.MergedDictionaries>

        <Style TargetType="{x:Type local:MyRenderableSeries}"
               BasedOn="{StaticResource MvvmDefaultRenderableSeriesStyle}"
               x:Key="mySeriesStyle">
        </Style>
    </ResourceDictionary>
</UserControl.Resources>

<s:SciChartSurface x:Name="SciChart"
                   RenderableSeries="{s:SeriesBinding RenderableSeriesViewModels}">
    <s:SciChartSurface.RenderSurface>
        <s:VisualXcceleratorRenderSurface />
    </s:SciChartSurface.RenderSurface>

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

    <s:SciChartSurface.YAxis>
        <s:NumericAxis />
    </s:SciChartSurface.YAxis>
    <s:SciChartSurface.ChartModifier>
        <s:ModifierGroup>
            <s:ZoomPanModifier />
            <s:RubberBandXyZoomModifier ExecuteOn="MouseRightButton" />
            <s:ZoomExtentsModifier ReceiveHandledEvents="False" />
            <s:MouseWheelZoomModifier />
        </s:ModifierGroup>
    </s:SciChartSurface.ChartModifier>
</s:SciChartSurface>

I have tested this on 3 machines, and all show the same behaviour.

**VisualXcceleratorEngine: Creating VisualXcceleratorRenderSurface Visual Xccelerator Engine v7.0.1.27055

GPU Capability Test ### Is BGRA feature required: TRUE

Examining Graphics Adapter: Intel(R) Iris(R) Xe Graphics VRAM:
128Mb DeviceId: 39497

Visual Xccelerator Engine Direct3D9 Compatibility
Determines whether the adapter is blacklisted due to its unstable work… FALSE
Trying to create Direct3D9 Device… SUCCESS

Visual Xccelerator Engine Direct3D11 Compatibility
Trying to create Direct3D9Ex Device (WPF Compatibility)… SUCCESS
Trying to create Direct3D11 Device… SUCCESS

Rank: 3000128 Points

Examining Graphics Adapter: NVIDIA T500 VRAM: 1928Mb DeviceId:
8123

Visual Xccelerator Engine Direct3D9 Compatibility
Determines whether the adapter is blacklisted due to its unstable work… FALSE
Trying to create Direct3D9 Device… FAILED

Visual Xccelerator Engine Direct3D11 Compatibility
Trying to create Direct3D9Ex Device (WPF Compatibility)… FAILED
Trying to create Direct3D11 Device… SUCCESS

Rank: 3001928 Points

Examining Graphics Adapter: Microsoft Basic Render Driver VRAM: 0Mb
DeviceId: 140

Visual Xccelerator Engine Direct3D9 Compatibility
Determines whether the adapter is blacklisted due to its unstable work… FALSE
Trying to create Direct3D9 Device… FAILED

Visual Xccelerator Engine Direct3D11 Compatibility
Trying to create Direct3D9Ex Device (WPF Compatibility)… FAILED
Trying to create Direct3D11 Device… SUCCESS

Rank: 2000000 Points

Selected Graphics Adapter, where DeviceId is: 8123 Is Direct3D9
Supported: FALSE Is Direct3D11 Supported: TRUE Is Blacklisted:
FALSE

Please find the log file here:
C:\dev\TestApps\SciChart_Violin\bin\Debug\net6.0-windows\GpuCapability.log

**VisualXcceleratorEngine: SUCCESS! VisualXcceleratorRenderSurface: attempt to initialize the engine with parameters: Use Direct3D9 –
False

  • Ben Green asked 9 months ago
  • last active 8 months ago
1 vote
13k views

Hi there

How to change crosshair’s and rollover’s tooltip, in particular lowest to low and highest to high?

  • VRueda asked 11 years ago
  • last active 10 years ago
1 vote
1k views

I want to implement something like, if a certain analysis value/custom logic is true for one of the values in the loop, –> set this bar color to ‘orange’ as an example, how can i do this?

   // Create a dataset of type x=DateTime, y=Double
  var dataSeries = new OhlcDataSeries<DateTime, double>();

   // Prices are in the format Time, Open, High, Low, Close (all IList)
  var prices = smallerList;

    // Append data to series. SciChart automatically redraws
    for (var i = 0; i < prices.Count(); i++)
   {

 // Convert TIME to a 4-digit string (e.g., 5 becomes "0005", 15 becomes "0015")
 string timeString = prices[i].Value.TIME.ToString("D4");

 // Parse the TIME field
 int hour = int.Parse(timeString.Substring(0, 2));
 int minute = int.Parse(timeString.Substring(2, 2));

 // Create the DateTime object
 DateTime dateTime = new DateTime(prices[i].Value.YEAR, prices[i].Value.MONTH, prices[i].Value.DAY,      hour, minute, 0);
 Dispatcher.Invoke(() =>
 {
     //here we append values in 'dataSeries', how do i do something like, 'bool condition = 
// returnCustomLogic('dataValues') --> outputs true, if true --> set this bar color to orange

     // Update the UI element on the UI thread
     dataSeries.Append(
    dateTime,
    (double)prices[i].Value.OPEN,
    (double)prices[i].Value.HIGH,
    (double)prices[i].Value.LOW,
    (double)prices[i].Value.CLOSE);

   });


   }
     Dispatcher.Invoke(() =>
     {
 StockChart.RenderableSeries[0].DataSeries = dataSeries;

 // Zoom Extents - necessary as we have AutoRange=False
 StockChart.ZoomExtents();
   });
1 vote
13k views

I have a custom ControlTemplate for the Rollover modifier that works fine for an OHLC DataSeries (see Chart_Rollover_One_Series.png), but as soon as I start adding other DataSeries (of different types, particularly XY), the ControlTemplate doesn’t work for it (as expected and as can be seen on Chart_Rollover_Multiple_Series.png). So, my question is, how do I specify different templates for different dataseries types?

Another option I thought about was using the Cursor modifier (like the one on the SciTrader example) where there is only one unified tooltip for all the series, but I wasn’t able to modify the template correctly.

At the moment I have 1 OHLC DataSeries and 3 XYs, but what I want to achieve in the end is being able to add and remove DataSeries on the fly and being able to see their corresponding values when I am using either the Rollover or Cursor modifier.

I am no expert in WPF, so this actually might not be that complicated, but I just couldn’t figure it out.

Appreciate the help. I also have attached my current XAML file for your reference.

1 vote
10k views

Hi Guys,

I am using a Data Template to display charts in an Items Control. The template displays the charts correctly but the Modifier group in the chart modifier of the template is not working correctly.

The IsEnabled property of each modifier is bound to a ChartModifier Property in the parent view model for the ItemsControl which then needs to be converted to a boolean as per the SciChart Trader example.

As you can see from the code below I have inserted a textblock element to test the conversion and the binding. The ChartModifier for the parent viewmodel is initialized to “ZoomPan”. When run the template correctly displays “False” in the textblock but none of the converter calls fire from the ModifierGroup leaving each chart with all 4 modifiers active at the same time.

Any thoughts as to possible causes/cures would be much appreciated

Regards
Ian Carson

        <DataTemplate x:Key="ChartTemplate">
            <Grid Margin="0"
                  HorizontalAlignment="Stretch"
                  VerticalAlignment="Stretch"
                  Height="400">
                <Grid.RowDefinitions>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="3*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <TextBlock Text="{Binding Path=DataContext.ChartModifier,  Converter={StaticResource IsModifierTypeConverter}, ConverterParameter=Rollover, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type explorer:PriceGraphShapeView}}, Mode=TwoWay }"/>
                <visuals:SciStockChart Grid.Row="1"
                                       Margin="0"
                                       x:Name="PriceChart"
                                       SeriesSource="{Binding Path=PriceChartAndOverlaySeries}"
                                       visuals:ThemeManager.Theme="BlackSteel"
                                       visuals:SciChartGroup.VerticalChartGroup="{Binding VerticalGroupID}"
                                       DrawMinorGridLines="False"
                                       DrawMajorGridLines="True"
                                       XAxisTextFormatting="dd MMM yyyy"
                                       YAxisTextFormatting="0.00">
                    <visuals:SciChartSurface.XAxis>
                        <visuals:CategoryDateTimeAxis DrawMajorBands="True"
                                                      GrowBy="0.0, 0.1" />
                    </visuals:SciChartSurface.XAxis>
                    <visuals:SciStockChart.ChartModifier>
                        <visuals:ModifierGroup visuals:MouseManager.MouseEventGroup="{Binding MouseGroupID}">
                            <visuals:RolloverModifier  IsEnabled="{Binding Path=DataContext.ChartModifier,  Converter={StaticResource IsModifierTypeConverter}, ConverterParameter=Rollover, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type explorer:PriceGraphShapeView}}, Mode=TwoWay }"
                                                      ReceiveHandledEvents="True" />
                            <visuals:ZoomPanModifier IsEnabled="{Binding Path=DataContext.ChartModifier, Converter={StaticResource IsModifierTypeConverter}, ConverterParameter=ZoomPan, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type explorer:PriceGraphShapeView}} , Mode=TwoWay }"
                                                     XyDirection="XDirection"
                                                     ReceiveHandledEvents="True" />
                            <visuals:CursorModifier IsEnabled="{Binding Path=DataContext.ChartModifier, Converter={StaticResource IsModifierTypeConverter}, ConverterParameter=CrosshairsCursor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type explorer:PriceGraphShapeView}}, Mode=TwoWay }"
                                                    ReceiveHandledEvents="True"
                                                    ShowAxisLabels="True"
                                                    ShowTooltip="False" />
                            <visuals:RubberBandXyZoomModifier IsEnabled="{Binding Path=DataContext.ChartModifier, Converter={StaticResource IsModifierTypeConverter}, ConverterParameter=RubberBandZoom, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type explorer:PriceGraphShapeView}}, Mode=TwoWay  }"
                                                              IsXAxisOnly="True"
                                                              IsAnimated="True"
                                                              ReceiveHandledEvents="True" />
                            <visuals:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
                        </visuals:ModifierGroup>
                    </visuals:SciStockChart.ChartModifier>
                </visuals:SciStockChart>
                <uiServices:GridExpander Grid.Row="2"
                                         Margin="0"
                                         BorderBrush="#FF67777C"
                                         Height="10"
                                         Background="#FF67777C"
                                         HorizontalAlignment="Stretch"
                                         VerticalAlignment="Center"
                                         IsCollapsed="False"
                                         IsTabStop="False"
                                         Direction="Next" />
                <ItemsControl x:Name="IndicatorsContainer"
                              Grid.Row="3"
                              Margin="0"
                              Background="Aqua"
                              ItemsSource="{Binding Indicators}"
                              ItemTemplate="{StaticResource IndicatorTemplate}">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <UniformGrid Columns="1"
                                         Background="Bisque" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
            </Grid>
        </DataTemplate>
  • Ian Carson asked 10 years ago
  • last active 10 years ago
1 vote
17k views

Hi!

I would like to ask what is the best strategy to implement 1-to-many relationship between DataSeries and SciChartSurfaces, when charts are shown in a second window and presumably rendered in its UI thread.

Currently I have a root object in the main window that creates and carry updates for a single DataSeries. The object has a property that creates a new SciChartSurfaces instance programmatically everytime, as the property is read. As a chart is created, I assign the same DataSeries as source for chart’s RenderableSeries.

This approach allows me to multiple charts in the second window and all these chart share the same dataseries on the root object. However, I have some issues with flicking, re-rendering and updating. For example, only the most recently created chart redraws after updates in the dataseries. I use dataSeries.SuspendUpdates() and batch Append but I guess it works only for the last chart.

I attached here a screenshot showing what happening when the shared DataSeries is filled with random values in real-time.

Could you recommend something for this scenario?

Thanks in advance,

Ilia

  • corvex asked 10 years ago
  • last active 10 years ago
1 vote
10k views

I have a datetime x-axis. The data i want to see is ordered. However there are gaps in my datetimes. When i load the data SciChart will fill all the gaps with empty space. E.g i load some data from 02-03-2014 to 05-03-2014 and continue at 07-08-2014 and ends at 10-10-2014. Sci chart creates an axis from 02-03-2014 to 10-10-2014. Is there an option where i can avoid those empty spaces? In the pics you can see what im trying to achieve.

I dont know why the pics are not complete. Just click them to see the whole picture. The first one is how my data is loaded. The second one is how i want it to be loaded.

  • bochelie asked 10 years ago
  • last active 10 years ago
1 vote
16k views

I have recently upgraded to SciChart 3 without major issues, but one thing that has changed is that the labels on my YAxes get cut-off beyond the minimum and maximum value. It’s a really weird behaviour and I have no idea what may be causing it. Please note that I do want to be able to display the ‘0’ label (that was the reason I updated to the newest version of SciChart). I’ve attached some screenshots that illustrate the problem.

Any ideas?

Thanks,
Charles

1 vote
20k views

I have the requirement of using a line series, but not displaying certain data points in the series (essentially breaking the line between points).

Do you have any recommendations on how to do this?

Thanks,
Jason

  • morseja asked 10 years ago
  • last active 10 years ago
1 vote
9k views

Hello

We implemented a vertical graph in a WPF project.
We’d like to add a mecanism similar to the VerticalSliceModifier on it, something like a HorizontalSliceModifier.

Do you have any clue for ?

Thanks in advance

1 vote
14k views

Hi,

Thank you for adding the shifted axis support in SciChart. There is still a problem though, the axis labels are on the right side of the axis overlapping the graph. I want to place the labels on the left side of the axis. I have tried giving the LabelTickStyle with HorizontalAnchorPoint.Left with no avail. I have also tried scaling the axis to -1, which you might have guessed flips the labels 180 degrees as well.

I have also tried AxisAlignment = Left, but it doesn’t seem to work with the shifted axis, if I mark the axis IsCenter =false it does place the labels on the left, but no longer shifts them. I have also tried doing the same thing with IsCenter = true ofcourse, but that seems to just flip the labels in place with their tick lines.

Is there a way to place the labels on the left side of the Y axis while shifted?

Thank you.

  • kewur asked 9 years ago
  • last active 9 years ago
1 vote
15k views

Hello together,

I have implemented a PaletteProvider which colors the whole Series depending on the Series always the same.

public class OwnPaletteProvider : PaletteProviderBase
{
    private readonly Dictionary<IRenderableSeries, Color> seriesColorsDictionary = new Dictionary<IRenderableSeries, Color>();

    private List<Color> availablesColors = new List<Color>()
    {
        Colors.Red,
        Colors.Yellow,
        Colors.Green,
        Colors.Orange,
        Colors.Blue
    };

    private int counter = 0;

    public override Color? GetColor(IRenderableSeries series, double xValue, double yValue)
    {
        // Get the specific Color for the specific Series
        if (seriesColorsDictionary.ContainsKey(series))
        {
            return seriesColorsDictionary[series];
        }

        // Series doesn't have a color
        // Add new Color from the list for this series in a RoundRobin-way
        var newColorForSeries = availablesColors[counter%availablesColors.Count];
        counter++;

        seriesColorsDictionary.Add(series, newColorForSeries);

        return newColorForSeries;
    }
}

The problem is that I have also in this Series PointMarkers which should have the same Color as the RenderableSeries. I thought, I could create a Style which binds to the Color of the RenderableSeries, but this is not working (see image in attachment).

<Style x:Key="pointMarker" TargetType="{x:Type s:BasePointMarker}">
    <Setter Property="StrokeThickness" Value="5" />
    <Setter Property="Fill" Value="{Binding Path=SeriesColor, 
        RelativeSource={RelativeSource AncestorType={x:Type s:FastLineRenderableSeries}}, Converter={StaticResource StringToBrushConverter}}"/>
    <Setter Property="Background" Value="{Binding Path=SeriesColor, 
        RelativeSource={RelativeSource AncestorType={x:Type s:FastLineRenderableSeries}}, Converter={StaticResource StringToBrushConverter}}"/>
</Style>

I could imagine that the PaletteProvider doesn’t support this. I would need a dynamic coloring of the RenderableSeries and the PointMarkers because the amount of the Series are flexible.

My current solution for this problem is to set the color in the ViewModel, but this seems to me not very nice, because I what to have only Bindings in the ViewModel and the “Styling” and the “Coloring” of the Chart should be done in the Xaml Code with some converters are with the PaletteProvider.

Why questions are:

  • How is it possible to color the FastLineRenderableSeriesor or the XyScatterRenderableSeries dynamically, also when new ones are added or deleted dynamically from the Xaml Code?
  • Can the PaletteProvider have an influence of the Color MarkerPoints?

Best regards,
Martin

PS: Sry I couldn’t use NuGet because the Port 81 is blocked in our company, so you have to add the SciChart library by our own.

1 vote
14k views

Hi All,

I have a situation where the chart needs to be switched between a log scale and a linear scale. To solve this I created 2 axis (one of each) and collapse one of them while the other is visible. The user can switch between them from a context menu.

I declare them in XAML as:

            <s:SciChartSurface.YAxes>
            <s:NumericAxis x:Name="LinearAxis" Id="LinearAxisID" AutoRange="Always" AxisAlignment="Left" AxisTitle="Linear" Style="{StaticResource LinearScaleStyle}" Visibility="Visible" GrowBy="0.0, 0.1"/>
            <s:LogarithmicNumericAxis x:Name="LogAxis"  Id="LogAxisID" AxisAlignment="Left" AxisTitle="Log" Style="{StaticResource LogScaleStyle}" GrowBy="0.0, 0.1" />
        </s:SciChartSurface.YAxes> 

THE ISSUE:
I’ve noticed that the Major and Minor gridlines are drawn based on the order the Axis are declared in <s:SciChartSurface.YAxes> which isn’t a problem. The problem comes when I collapse one axis and make the other visible (obviously re-assigning the series to the visible axis by ID) – The axis and data change as you might expect but the major and minor gridlines are not redrawn.

In summary, if you start with log gridlines, you always get log gridlines – even on a linear axis.

Is there a way to force the redrawing of the gridlines?

1 vote
10k views

Hi,

Could you provide any advice on how to get the y axis tick labels in this case to display different numbers. The differentiation may be small, but the labels in this case are not helpful.

See attached.

Thanks,
Jason

  • morseja asked 9 years ago
  • last active 9 years ago
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

1 vote
6k views

Hello, first let me say this is a awesome product.

I’m trying to implement sweeping scroll on SciChart. I have read the following article
http://support.scichart.com/index.php?/Knowledgebase/Article/View/17233/37/how-to-create-a-sweeping-ecg-chart
and was able to implement it, but i have one small issue.

First my x axis is TimeSpanAxis, i need ticks to move appropriately. In chart presented with uploaded image, time base of X axis is fixed with VisibleRange from 0-10. I need tick on new trace that comes from left side to add ticks in order like 11-12-13… and old axis to lose oldest ticks like 0-1-2… So when i add new tick on left side trace, oldest tick on right side trace will disapper

Best regards

1 vote
9k views

I need to export a load of images from one graph. Export from the View is very long. So, I’ve implemented the export in memory like in this example:
https://support.scichart.com/index.php?/Knowledgebase/Article/View/17213/34/rendering-chart-to-bitmap-in-memory

Export is fast and flexible. One of my axes has a custom label provider, but I see a default axis labels after export. Export from View gives correct label values. Here is the code of the label provider:

public class MyCustomLabelProvider: NumericLabelProvider
{

    public override string FormatLabel(IComparable dataValue)
    {
        return string.Format("{0:" + this.ParentAxis.TextFormatting + "}", 1 / (double)dataValue);
    }

    public override string FormatCursorLabel(IComparable dataValue)
    {
        return string.Format("{0:" + this.ParentAxis.TextFormatting + "}", 1 / (double)dataValue);
    }
}

And a code of export:

    var sciChartSurface = new SciChartSurface();
    ThemeManager.SetTheme(sciChartSurface, "BrightSpark");
    sciChartSurface.YAxes = new AxisCollection()
    {
        new NumericAxis()
        {
            AxisAlignment = AxisAlignment.Left,
            VisibleRangeLimitMode = RangeClipMode.MinMax,
            LabelProvider = new MyCustomLabelProvider(),
            DrawMajorGridLines = false,
            DrawMinorGridLines = false,
            DrawMajorBands = false,
        }
    };
    sciChartSurface.XAxes = new AxisCollection()
    {
        new NumericAxis()
        {
            AxisAlignment = AxisAlignment.Bottom,
            LabelProvider = new CurvatureLabelProvider(),
            VisibleRangeLimitMode = RangeClipMode.MinMax,
            DrawMajorGridLines = false,
            DrawMinorGridLines = false,
            DrawMajorBands = false
        }
    };

    sciChartSurface.RenderableSeries = new ObservableCollection<IRenderableSeries>()
    {
        new FastLineRenderableSeries() { DataSeries = lineSeries, Stroke = Colors.Green }
    };

    ...

    sciChartSurface.XAxes.FirstOrDefault().VisibleRange = new DoubleRange(0, 100);
    sciChartSurface.ExportToFile(Path.Combine(folderPath, $"Object.png"), ExportType.Png, false, new Size(1500, 750));

Any suggestions?

1 vote
8k views

SciChart is creating too much garbage objects/events* instead of reusing through pools (Analysis through dotMemory shows this). In complex applications this additional gc-pressure causes frequent lockups. (GC Pauses in 50-250ms+ range).

Top backtraces for GC-Problem:
– WeakEventTable.Purge
– Tick Rendering (TimeSpan, Strings)
– ProperyChangedEventManager.Purge

Top Types:
– WeakEventTable+EventKey
– HybridDictionary
– Double, String, TimeSpan
– Action

All of these top types/backtraces result directly from SciChart as we cross-verified with your 2D-Chart-Realtime-Series demo and by omitting the SciChart controls from our application. ( 2/3 of the total memory pressure comes from SciChart with even just 2 charts being present in our application, we see 5MB garbage memory traffic per 2 second, resulting in very frequent GC collections sporadically spiking into a high duration)

We currently use SciChart WPF V5, it seems SciChart WPF V6 Demo didnt fix this instead just using the LowLatency GC mode causing more frequent GC-collections causing worse overall performance in complex applications. (as we verfied in our application)

Is there plans to increase memory/object reuse/pooling and reduce events/actions? (70k allocations of events/actions for short time spans arent really understandable). What are those 70k events for simply rendering a chart with not much changing, see the attached image.

What settings/methods do you recommend to lower the Memory Pressure/WeakEvents resulting from SciChart usage?

What is the best rendering method to minimize GC pressure, we only require updates if new data becomes available through our application. Would it be manual?

Please comment

Thank you

1 vote
13k views

My previous example/question worked because I hard coded to use two charts each with their own chart modifiers as follows all in the same class.

_chartModifiers = new ModifierGroup();
MouseManager.SetMouseEventGroup(_chartModifiers, "MyGroup");
_chartModifiers2 = new ModifierGroup();
MouseManager.SetMouseEventGroup(_chartModifiers2, "MyGroup");

I am now building the ui that allows me to add and remove a graph from an items control. Each graph now binds to a view model to get its data and a parent class manages a collection of graphs (view models). I set the mouse event group in the constructor which is empty when I call SetMouseEventGroup. This causes some weird behavior when zooming as both graphs zoom together plus scrolling the yaxis scolls both yaxis at the same time and sometimes crashes.

Note: in my code now this gets call two times; once for each chart.

public GraphViewModel()
{
  _chartModifiers = new ModifierGroup();
  MouseManager.SetMouseEventGroup(_chartModifiers, &quot;MyGroup&quot;);
}

private ModifierGroup _chartModifiers;
public ModifierGroup ChartModifiers
{
  get { return _chartModifiers; }
  set
  {
    _chartModifiers = value;
    NotifyPropertyChanged(_chartModifierArgs);
  }
}

I also tried to manage the number of items that I add to the mouse event group and while that stopped linking the zoom and yaxis scoll in this case I can no longer get the rollover to work.

ModifierGroup total = new ModifierGroup();
foreach (GraphViewModel www in vm.HistoricalHealthViewModel.DisplayedGraphs)
{
   foreach (IChartModifier chartModifier in <a target="_blank" href="http://www.ChartModifiers.ChildModifiers)"  target="_blank">www.ChartModifiers.ChildModifiers)</a> 
   {
      // do not add the drag modifiers
      if (!(chartModifier is YAxisDragModifier))
      {
         total.ChildModifiers.Add(chartModifier);
      }
   }
}
MouseManager.SetMouseEventGroup(total, &quot;MyGroup&quot;);

Can you please suggest how to use the mouse event group?

1 vote
4k views

Working app suddenly getting System.Windows.Markup.XamlParseException: ‘Provide value on ‘System.Windows.Baml2006.TypeConverterMarkupExtension’ threw an exception.’
Inner Exception
FileNotFoundException: Could not load file or assembly ‘SciChart.Charting.DrawingTools, PublicKeyToken=b55dd9efe817e823’ or one of its dependencies. The system cannot find the file specified.

I am on a Windows 10 machine that looks like it just did a Windows Update…any thoughts on what this is?

1 vote
0 answers
6k views

hello, can i know how to draw draw multiple 3DPointlines in a 3DSurface? I want to show my result in a 3DSurface, but i don’t know how to do it in SciChart. Thank you very much!

1 vote
2k views

I’m using the ZoomHistoryManager in my application which works great!

But how can I add my own entry to the undo/redo stack?

On my viewmodel I have

 /// <summary>
/// XAxisRange
/// </summary>
public DoubleRange? XAxisRange
{
    get => _xAxisRange;
    set => SetProperty(ref _xAxisRange, value);
}

private DoubleRange? _xAxisRange = null;

/// <summary>
/// YAxisRange
/// </summary>
public DoubleRange? YAxisRange
{
    get => _yAxisRange;
    set => SetProperty(ref _yAxisRange, value);
}

private DoubleRange? _yAxisRange = null;

and I want to implement something like :

 public void CustomRangeUpdate()
{
    if (RenderableSeries.Count > 0)
    {

        XAxisRange = new DoubleRange(x1, x2);
        YAxisRange = new DoubleRange(y1, y2);

        ZoomHistoryManager.SaveLatestRange(new AxisKey("DefaultAxisId", true), XAxisRange);
        ZoomHistoryManager.SaveLatestRange(new AxisKey("YAxis", false), YAxisRange);
        ZoomHistoryManager.PushAll();
    }
}

But it looks like I am using it incorrectly as it doesn’t add any entries. I’ve also tried Push() with no luck

  • forl forl asked 11 months ago
  • last active 11 months ago
1 vote
5k views

When running with scaling other than 100%, the results are very blurry.

I’ve come across this article https://support.scichart.com/index.php?/Knowledgebase/Article/View/17263/40/ which explains the reasoning. In that you’re always rendering at 96DPI no matter what the current scaling is set to.

It says to use the XamlRenderSurface, but this isn’t practical in most scenarios. For example, we want to render scatter plots. Enabling the XamlRenderSurface in your Scatter Chart example results in very poor performance even with only a small number of points being rendered.

So is the situation still the same from that 2019 article? You still don’t provide the option to render using the accelerated surface at anything other than 96 DPI?

I appreciate that the performance would be reduced, but it would surely be much better than the XamlRenderSurface?

  • Ben Green asked 9 months ago
  • last active 8 months ago
1 vote
5k views

I have two SciChartSurfaces

One is a HeatMap (x:Name=”MainChartSurface”), the other a line graph.
I have set it up so that when a vertical cursor is moved the smaller line graph shows a ‘cross-section’ of the heatmap.

The attached image shows the right hand end of the heatmap and the smaller line graph.

The X-axis of the line graph is set to Alignment=Right and this axis has the same range as the y-axis of the heat map – set in xml as:

 MajorDelta="{Binding Source={x:Reference Name=MainChartSurface}, Path=YAxis.MajorDelta, Mode=TwoWay}"
 MinorDelta="{Binding Source={x:Reference Name=MainChartSurface}, Path=YAxis.MinorDelta, Mode=TwoWay}"
 AutoTicks="False"
 VisibleRange="{Binding Source={x:Reference Name=MainChartSurface}, Path=YAxis.VisibleRange, Mode=TwoWay}"

this all works, so if the main graph is zoomed, the 2D line graph Y-axis follows the main graph.

The Y-axis of the line graph has Alignment=Bottom, and it shows the z-values for all y-values at the location vertical cursor (a RolloverModifier) on the main graph.

The problem I have is that the space taken by the axis at the bottom of the charts is different, so the chart areas are different. Look carefully at the attached image and see the bottom axes do not align.

How can I link the space taken to force the bottom axes to stay in alignment?

Thanks
Andrew Milford

1 vote
1k views

Hi,

I would like to use the UniformXyDataSeries because I have different Y values that are equidistant in time. I then assumed that I could use UniformXyDataSeries when X values are equidistant. I created an object of type UniformXyDataSeries but this class expects the XStart and XStep to be double values. I would like to provide TimeSpan values instead of double values. Is there any class that lets us have this setup (uniform data series with Y being double values and X equidistant TimeSpan values)?

Now, if I create a UniformXyDataSeries and provide XStep to be 0.0001 (double value) seconds and set the X axis being a TimeSpanAxis, the chart will not be rendered because it is saying it cannot convert the double value of XStep into a TimeSpan.

Thank you!
Alex

1 vote
9k views

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

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

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

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

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

1 vote
12k views

I currently have a scatter plot:
XyScatterRenderableSeries series = new XyScatterRenderableSeries();
series.PointMarker = new EllipsePointMarker()
{
Fill = Colors.Blue,
Width = 3,
Height = 3,
};
series.AntiAliasing = false;
series.ResamplingMode = Abt.Controls.SciChart.Numerics.ResamplingMode.None;
With 12000 points. The points are sorted, but I’m still having performance issues. When zoomed all the way out panning and zooming is very slow/choppy. Is there a way to set up the series so that it has higher performance?

Thanks,
Greg

1 vote
12k views

Hello,
first at all im very new to SciChart. I actually evaluate it for our Software.
I like the Performance from Scichart.

But now i have a little Problem.

Please have a look at the DEmo-Application. I use MVVM-Light. Think you have to install it via Nuget.

I’ve made two Buttons. With the first one i generate 2 Axis and with the Second – one 4 Axis (Just for testing). This works very fine. I see the GRaph and the GRidlines.

Now i want to generate some Lines for the different Axes.
But when i try to add a new ChartSeriesViewModel to my Seriessource alls Gridlines where hide and the Line wont show. What i’m doing wrong here ?
Can you help me to generate an Example via MVVM to generate more lines for different Axes and fill the Lines with an Timer ?

##########UPDATE

i got the most on my own. I have one left Problem. i want a static x-Axes. For Example from 1 – 60 seconds. And a scrolling chart.
Don’t know how to get this. Actually i have only an increasing x-axes.

Is it possible to make two X-Axes. One Scrolling and one fix. And then i can hide the scrolling one ?
Do you know what i mean ?I have made an attachment with my Demo-Application.
Please have a look at the image. This is how i want that it looks like. The fixed X-Axes and the coninious scrolling Graph.
Thanks

########UPDATE 2

Ok here some more Explanation

In the Screenshots below you can see our actual Graph

In the Graph1 you can see a static X-Axes from 0-60 seconds

In the GRaph2 you can see the Graph starts scrolling. I tried this with Scichart. But the only possibility to start scrolling on the Graph is to set the FifoCapacity from the XyDataSeries. I want to have a Capacity from over 100000 Points to analyze the Graph on a later time with pan and zoom.

In the GRaph 3 you can see a scrolling GRaph and a static x-Axes from 0-60 Seconds. AND The Gridlines do NOT Scroll with the Graph.

In the GRaph 4 we can stop the Measurement. That is also possible with Scichart.
And in the last GRaph we can Pan and Zoom on the stopped Graph. Think this is also possible with Scichart.

So what is not possible (with my knowledge) is, that the Graph should Scroll and The Gridlines should not Scroll.

I trid following:
I set two X-Axes. One with Autorange=”Always” and visibility Collapsed. The FastlinerenderableSeries i set to this X-Axes.
The other X-Axes i set to Autorange=”never” and visible. but the GRidlines always scroll and i think that were the Gridlines from the first X-Axis.

So i hope you understand my Problem now and can help me to find a Solution.

Thanks a lot

Nice Wishes

1 vote
11k views

Good day!
I’m working with painting FastMountainRenderableSeries. Now I need to give to user an ability to paint curve not only under the line, but above line too.
Is there any automatic property to make it?
Thank in advance.

  • Egor asked 10 years ago
  • last active 10 years ago
1 vote
11k views

Hi,

After I’ve added some TextAnnotations on the graph, I’ve noticed that the TextAnnotations and CustomaAnnotations doesn’t resize with the view. They all stay constant in size. I’ve found a previous question about this in here: https://www.scichart.com/questions/question/text-annotation-size

But I’m not getting the results I hoped for with this. The test is still not resizing with the surface. Since it’s been a while that a question was asked about this, maybe there are new methods to do this in Scichart?

Thanks

  • kewur asked 10 years ago
  • last active 9 years ago
1 vote
8k views

Hi everybody! I’m using SciChart V2.2.5. I have a chart with XyDataSeries<DateTime, double> on it, and i need to associate some extra data with each point to be able to display it on hint.
Something like this:

struct Point
{
    public DateTime XValue;
    public double YValue;
    public long ByteOffset;
}

And i need to find ByteOffset associated with XValue and YValue when user moves mouse over the point in the chart.

  • Danila asked 9 years ago
  • last active 9 years ago
Showing 101 - 150 of 3k results