Pre loader

Forums

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

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

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

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

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

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

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

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

Hello,

Is there a mechanism for binding, in a two way fashion, the collection of Selected points when using the IPointmetadata mechnism?

Basically, I have a view which contains a table (DevExpress Datagrid) and a SciChart plot, where all of the rows are plotted on a line series. When the user highlights a row or rows in the table, the appropriate points should be selected on the graph. Also, if the user selects the points on the graph, the rows should be selected in the table. Ideally, I would like to bind each view’s SelectedRows (or SelectedPoints) to a common ObservableCollection.

The trouble I am seeing is that the two views use different paradigms to represent Selected-ness. The point is only selectable if it is given an object that implements IPointMetadata, and its selection state is represented by the BizObjectViewModel’s IsSelected property. The selection state in the table is represented by its presence in the SelectedRows collection.

No opinions as to which is better, I am simply trying to get the two to work together nicely. OnCollectionChanged of the bound SelectedRows is a great place for me to set/unset IsSelected for the affected object, and the chart reacts:

switch (e.Action)
        {
            case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
                foreach (var p in e.NewItems.Cast<SolverDetailRow>())
                {
                    p.IsSelected = true;
                }
                break;
            case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
                foreach (var p in e.OldItems.Cast<SolverDetailRow>())
                {
                    p.IsSelected = false;
                }
                break;
            case System.Collections.Specialized.NotifyCollectionChangedAction.Replace:
                break;
            case System.Collections.Specialized.NotifyCollectionChangedAction.Move:
                break;
            case System.Collections.Specialized.NotifyCollectionChangedAction.Reset:
                foreach (var row in SolverRows)
                {
                    foreach (var detRow in row.Observations)
                    {
                        detRow.IsSelected = false;
                    }
                }
                break;
            default:
                break;
        }

However, I can’t find the best place to update the collection when the chart updates the IsSelected property itself. The BizObjectViewModel won’t (and shouldn’t) know about the collection he is in. Right now I am using a Messenger model from DevExpress to notify anyone who cares that the IsSelected property has changed:

private bool _isSelected;
    public virtual bool IsSelected
    {
        get { return _isSelected; }
        set
        {
            if (value != _isSelected)
            {
                _isSelected = value;
                RaisePropertyChanged("IsSelected");
                Messenger.Default.Send(new PointSelectionChangedMessage() { Object = this });
                Messenger.Default.Send(new ChartRefreshRequestedMessage());
            }
            _isSelected = value;
        }
    }

This at least decouples the view model from knowing about the collection, but it kind of muddies the Viewmodel with piping that seems superfluous. It would be nice if I could bind the DataPointSelectionModifier’s SelectedPoints to the same collection that the table is bound to, but it appears that this is Readonly.

Am I missing something? I suppose I can extend the DataPointSelectionModifier to provide something, but I am hoping I am overlooking a feature…

Thanks for your time,
Mike.

0 votes
6k views

Hi

I want to set multi TextAnnotations on the top left of the chart surface like as bmp.
So I use the HorizontalAnchorPoint and VerticalAnchorPoint to set top left of the chart but how can I set these property in multi TextAnnotations?
This is my code:

            txtAnno1.Text = "Hellow World1!";
            txtAnno1.Foreground = new SolidColorBrush(Colors.Blue);
            txtAnno1.HorizontalAnchorPoint = HorizontalAnchorPoint.Left;
            txtAnno1.VerticalAnchorPoint = VerticalAnchorPoint.Top;
            Surface.Annotations.Add(txtAnno1);

            txtAnno2.Text = "Hellow World2!";
            txtAnno2.Foreground = new SolidColorBrush(Colors.Red);
            txtAnno2.HorizontalAnchorPoint = HorizontalAnchorPoint.Left;
            txtAnno2.VerticalAnchorPoint = VerticalAnchorPoint.Top;
            Surface.Annotations.Add(txtAnno2);

Please help me.

Thanks

  • Bruce Juli asked 5 years ago
  • last active 5 years ago
0 votes
16k views

I have a wpf application that is binding to the FastLineRenderableSeries . I can see the axes changing and I can see the lines been rendered if they are 0 or at the y range limit but the center of the chart is blank.

I have worked on this for a couple of days and I have other developers helping out and we just cannot get anything to show on the chart surface. It is as if the center of the chart is missing. There are no grid lines displayed either.

Is there a problem with screen resolutions or something similar. Nothing shows in the center of the chart. I can see lines on the Y-Axis limits but not on the center.

I would appreciate any help as I am at me limits trying to get a simple line graph working. It should just work as I have looked at the samples and mine is similar.

I have attached a zip file with the image in it.

Regards
Bryan

0 votes
15k views

I’m trying to have two graphs which share the same X-Axis and have an overview control that zooms and pans. Everything is synchronized but zooming and panning with the overview control. For some reason it only applies to one surface. Below is segments of the code:

SciChartSurface surface = new SciChartSurface();
DateTimeAxis xaxis = new DateTimeAxis();
surface.XAxis = xaxis;
SciChartOverview overview = new SciChartOverview();
overview.ParentSurface = surface;
Binding bind = new Binding();
bind.Source = xaxis;
bind.BindsDirectlyToSource = true;
bind.Mode = BindingMode.TwoWay;
bind.Path = new PropertyPath("VisibleRange"); overview.SetBinding(SciChartOverview.SelectedRangeProperty, bind);
SciChartSurface surface2 = new SciChartSurface();
surface2.XAxis = xaxis;

Could you please help me figure out why it only zooms/pans on one surface?

Thanks,
Greg

0 votes
16k views

Hi,

I would like to select different themes using MVVM.
Do you have an example how to do this?

Thanks,
Egbert

0 votes
22k views

Hi All,

We have included in our wpf chart vertical slices to show markers on data series, but when a vertical slice is added, one marker per series is shown at the same time.
Is it possible to show only one marker per series and per vertical line annotation? We want to add serveral vertical slices, and each one has a marker to only one series.
Please find attached two pictures: the first one represents what we have, and the second one represents what we need.

Thank you in advance
Regards,
Juan

0 votes
13k views

Is there a way to create a custom TooltipModifier.TooltipTemplate for Annotations?

I’m trying to find an example of one on the site or in the SciChart examples application but I’m not having any luck. Thanks!

I’d like to be able to pass an object to the tooltip’s metadata like with XySeriesInfo tooltip templates.

Thanks!

  • Greg Knox asked 6 years ago
  • last active 6 years ago
0 votes
11k views

Hello,

We are looking at buying a license of SciChart mostly because we need to implement high performance real time dashboards on a discrete event simulation application.
Performance-wise we noticed that SciChart is very good, handling well large amount of data in a short period of time.
However, we also need to have the ability to customize some of the aspects of the charts like annotations, legends, colors etc. I did a little bit of research (not much though) and could not find an easy way to add text to the Y axis to tell the user what each bar represents (see attached image).

Looking at the attached image, do you see anything that we won’t be able to achieve using SciChart?

Thanks in advance,
Andre.

  • andrecsa asked 10 years ago
  • last active 1 year ago
0 votes
0 answers
0 views
1 vote
5k views

I am trying to change the format of CursorModifier

sciChartSurface.chartModifiers.add(
  new CursorModifier({
    modifierGroup: 'Chart',
    showAxisLabels: true,
    showTooltip: false,
    showYLine: false,
    showXLine: true,
  })
);

I have a custom DateLabelProvider for the xAxis that return dates in this format ‘MM/dd HH:mm’ but the CursorModifier tooltip is showing the ‘MM/dd/YYYY’ format, how can I change it?

1 vote
6k views

Error from chart in div instrument_candle_chart_2
RuntimeError: call_indirect to a signature that does not match (evaluating ‘invoker(fn, thisWired, arg0Wired, arg1Wired, arg2Wired, arg3Wired, arg4Wired, arg5Wired, arg6Wired, arg7Wired, arg8Wired)

error here: OhlcSeriesDrawingProvider.prototype.draw:

this.nativeDrawingProvider.DrawPointsVec(nativeContext, xDrawValues, openValues, highValues, lowValues, closeValues, renderPassData.xCoordinateCalculator.nativeCalculator, renderPassData.yCoordinateCalculator.nativeCalculator, this.args);

0 votes
15k views

Hi,
I have a multichart MVVM Light based application with each chart having its own view model. In particulat I have an XYScatter chart with multiple series, each coloured differently. I need to select a point in one of the series with the left mouse button such that all that series points change and the index of the selected series is available in my view model. Simultaneously I need to have the groupRubberBandZoomModifier, groupXAxisDragModifier & groupYAxisDragModifier enabled.

I’ve found a couple of ways of doing this, overriding a modifier or EventToCommand directly on the mouse events and re-drawing the appropriate series, but I either don’t get the interrupt or the groupRubberBandZoomModifier doesn’t work and I can’t figure out what is happening.

Please could you elaborate on how the interrupts are handled in this situation.

Many Thanks
Dai

  • Dai asked 13 years ago
  • last active 1 year ago
0 votes
12k views

Hi,

I have 2 separate charts (SciChartSurface) and my goal is to enable mouse selection of a series on only the chart surface that contains the series. I do not share renderable series and not even data series between different chart surfaces. I am not sure why a series on the second chart surface is selected when I click on an area within the first chart surface. How can I prevent this from happening?

Could it be this is a bug in that SeriesSelectionModifier checks for hitpoints beyond the chart surface on which the mouse hit occurred? I verified and this problem only occurs when sharing Chart Modifiers via MouseManager. Attaching the MouseManager.MouseEventGroup to each individual modifier does not seem to work, it looks like it has to be attached to “ModifierGroup”. So I am still stuck with this problem.

<s:SciChartSurface.ChartModifier>
            <s:ModifierGroup s:MouseManager.MouseEventGroup="MyMouseEventGroup">

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

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


            </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>
  • bbmat asked 10 years ago
  • last active 1 year ago
1 vote
3k views

Which options should I use to have a line chart being filled from right to left, with the first point appearing to the right of the chart area? And is it possible to have the X axis labelled with 0 to the right and sample age from left? Say, a 10 minute graph updated at 2 Hz with reasonable ticks starting at the left part of a fixed 10 minute visible/data range?
I have tried to search for this in the documentation, but not found anything I can use. The xValues start at 0 and increase by 0.5 for each sample.
I have tried the flippedCoordinate property, but it is not quite what I wanted, as it just appends the latest value to the left rather than scrolling existing values to the left before adding the most recent at the right end of the graph.
As can be seen from the attached stacked graph example, I update a stacked graph with 4 values being read and appended to the FastLineRenderableSeries as the samples appear. I use scichart-angular with scichart in my Angular app.
I have attached another screen dump with an example of a graph appearing from right to left (scrolling per sample) with a time span axis with now at right and -(max span) to the left. It is rendered using the SciChart WPF library.
Any suggestion on how I could achieve a mix of the two is highly appreciated.

0 votes
12k views

Hi all,
How can I remove the space (red cross) inside the chart ?
Thank you!

  • sahar Les asked 12 years ago
  • last active 1 year ago
1 vote
3k views

Hello,

we upgraded the version from 3.4.652 to 3.5.687, and problems with the Y-axis appeared on the charts. When moving the overviewChart sliders or using the scroll wheel to change the visibleRange, the Y-axis fails to set the min and max values correctly, resulting in the default values of 0 and 10 being displayed (Error: Argument max must be a real number (not infinite, not NAN)). We didn’t change anything in the code. I checked the data we provide, and all variables are of type Number, there are no other random things.
I’ll just include the axis parameters we use.

            const yAxis = new NumericAxis(wasmContext, {
            autoRange: EAutoRange.Always,
            growBy: new NumberRange(0.1, 0.1),
            drawMajorBands: false,
            drawMajorTickLines: false,
            drawMinorGridLines: false,
            drawMinorTickLines: false,
            labelStyle: {
                fontSize: 11,
                fontFamily: 'Open Sans, sans-serif',
                padding: new Thickness(0, 3, 0, 0),
                color: this.theme.lineChartColor,
                alignment: ELabelAlignment.Right,
            },
            maxAutoTicks: 7,
            axisAlignment: EAxisAlignment.Right,
            labelProvider: this.getDynamicValueLabelProvider(),
            isVisible: false
        });

        const yAxisVolume = new NumericAxis(wasmContext, {
            id: USER_CHART.Y_AXIS_VOLUME_ID,
            growBy: new NumberRange(0, 4),
            isVisible: false,
            autoRange: EAutoRange.Always,
            allowFastMath: true,
        });

https://ibb.co/tL5HgCz – in the screenshot, the incorrect axes are on the left side – sometimes only the volume axis (invisible), and in another case, both axes. The correct charts are on the right side.

Best regards,
Kamil

0 votes
10k views

Dear all
When the binding data is changed in real time to the ColumnRenderableSeries, the pointer size of the corresponding series is changed to an arbitrary size.
ColumnRenderableSeries wants to know if it can fix the size when the x and z axes are changed in real time.
Or, I want to know if there is a function that can calculate the position of xyz in 3D chart and adjust the height of the corresponding pointer.

Thank you for your reply.

  • Lee JunHee asked 9 years ago
  • last active 9 years ago
0 votes
11k 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);
0 votes
9k views

Hey everyone,

SCIThemeColorProvider has styling properties for individual types of chart elements (annotations, axes, grid lines, renderable series). How can multiple colours be assigned to individual RenderableSeries in case there are more than one?

For example, a stacked column chart will surely have more that one data series and it appears that current implementation of SCIThemeColorProvider doesn’t take this into account from architectural point of view.

Am I missing something?

Thanks,
Igor

  • Igor Peric asked 9 years ago
  • last active 9 years ago
0 votes
18k views

Hello! I need to change position of VerticalLineAnnotation label (not the label showing axis value, but the label showing a value of crossed chart). How can I do this?

0 votes
0 answers
15k views

Hello!

I want to use three colors in Xaxis.
But I do not know how to use multiple colors at once.

can put multiple colors through Xaxes,
but when move the scroll bar, the Xaxes colors do not move together. (Top and Buttom Xaxes colors)
I want to move the colors of both Xaxes together. or want to assign multiple colors(over the 3 Colors) to one Xaxis.

You can see the code and graphs through the image.

Tell us how to use it.

Thank you!

1 vote
0 answers
11k views

Currently the color of 3D axis plane can only be filled with one color by the property AxisPlaneBackgroundFill. We have a requirement that gradient color should be used there. Is it possible to achieve these through styling or templating, or otherwise? If not, could this possibly be implemented in the future?

0 votes
18k views

Hi,

Is it possible to set legend item orientation to horizontal? Normally they all stack vertically.

Thanks,
Charith

1 vote
18k views

If I have two points on my chart (x1, y1) and (x2, y2), what is the recommended way to create a line that goes through these two points? I maintain the value of the slope and the previously mentioned coordinates.

Thanks!

  • Ryan Woods asked 10 years ago
  • last active 1 year ago
0 votes
14k views

In the HeatMap chart, each cell can draw color according to the value…
But after the cell drawing, the HeatMap’s Gridline is covered by the cell color (see the jpg file before and after)

Can I always make the gridline front to the top of cell color? (I Want to see the major grid line after cell drawing…)

thk

  • ychch yang asked 10 years ago
  • last active 10 years ago
0 votes
21k views

Has anyone encountered this before?

XamlParseException: Unexpected record in Baml stream. Trying to add to SciChartSurface which is not a collection or has a TypeConverter.

<DataTemplate x:Key="SciLineChartTemplate"><Grid><s:SciChartSurface ...

1 vote
9k views

Hi,

The axis labels are not always showing when zoomed in/out.
Is there a way/workaround to persist the end labels and also make it editable?

Please see attached pic

Thanks
Pramesh

0 votes
10k views

When using GLTextureView on Android 4.4 API 19, there are a few issues. The same issue does not occur on API 27. Have not tested other API levels. If you do not use GLTextureView, this issue doesn’t happen (but due to theming bugs I have to use GLTextureView and not the other 2 types of render surfaces).

  1. If activity A has a SciChartSurface and activity B has a SciChartSurface and appears above activity A, then the surface in A dissapears (Shows blank) when you return to it. 100% repro for me. Let me know if you need more info.

  2. Due to 1? If you try to re-render the chart on activity A, it will lead to an ANR (app freezes indefinitely) after a few times (see below)

  3. Even if you don’t have activity B and only activity A, if you interact with it a few times and show/hide it, it will lead to an ANR (app freezes indefinitely) as well (see below):

ANR log (it freezes the app until you kill it):

09-03 13:01:40.583 1690-1705/system_process E/ActivityManager: ANR in co..stocks (co..stocks/.ui.screens.home.MainActivity)
PID: 12076
Reason: Input dispatching timed out (Waiting because the touched window has not finished processing the input events that were previously delivered to it.)
Load: 0.64 / 0.49 / 0.39
CPU usage from 6217ms to 779ms ago:

  • Mike Liu asked 8 years ago
  • last active 8 years ago
0 votes
14k views

Hi All,

When i did the Zoom I want to fixed my Scrollbar in this position (like picture) and continous to charting in real time with the same position of Scrollbar it’s possible to did this with Scichart ? because it’s possible with the lib ZedGraph but i don’t know if it’s possible with Scichart !! please i need a response and helps ! Thank you !
Best Regards, Sahar.

  • sahar Les asked 12 years ago
  • last active 12 years ago
0 votes
18k views

I’m trying to implement custom annotations using the MVVM pattern. I’ve been using your tutorial as an example (https://www.scichart.com/databinding-annotations-with-mvvm/). Everything works as expected if I manually load some example data to the annotations collection. When I actually try to load the data from our database using async method, the annotations are no longer drawn.

Is this by design or am I doing something wrong? Do you have any suggestions how to load annotations when using async code and MVVM patterns? I haven’t had any problems loading the actual time series on the chart using the same pattern.

I also tried binding the SciChartSurface’s Annotations property to AnnotationCollection and then calling ChartAnnotations.ParentSurface.InvalidateElement(), but the issue still persists.

You can easily reproduce this behavior by adding an async call to the examples’s source code:

private async Task Initialize()
{
    var ds0 = new XyDataSeries<double, double>();
    var someData = new RandomWalkGenerator().GetRandomWalkSeries(200); // RandomWalkGenerator is found in the examples source code

    ds0.Append(someData.XData, someData.YData);

    _chartSeries = new ObservableCollection<IChartSeriesViewModel>();
    _chartSeries.Add(new ChartSeriesViewModel(ds0, new FastLineRenderableSeries()));

    // Now create the labels
    _chartLabels = new List<LabelViewModel>
                       {
                           new LabelViewModel(5, -2.5, "Label0", "Label0 Tooltip!"),
                           new LabelViewModel(20, -2, "Label1", "Label1 Tooltip!"),
                           new LabelViewModel(35, 3, "Label2", "Label2 Tooltip!"),
                           new LabelViewModel(50, 1.5, "Label3", "Label3 Tooltip!"),
                       };

    await Test();

    _chartLabels.Add(new LabelViewModel(65, -0.5, "AFTER ASYNC", "Label4 Tooltip!"));
}

private async Task Test()
{
    await Task.Delay(5000);
}
  • Juho asked 9 years ago
  • last active 9 years ago
0 votes
3k views

Memory Leak and Crash In SciChart 3D
Demo: https://github.com/Chenyliang/CrashDemo

The situation occurs in two configurations.
1ÒÇü i7-9700 + Graphics card: Intel(R) UHD Graphics 630
2ÒÇüi7-12700 + RTX 3050

Version : 8.5.0.28148

  • chen yl asked 2 years ago
  • last active 2 years ago
1 vote
9k 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
13k views

Hi Andrew,

I have a problem with the Scrollbar : when i Choosed “ZoomX” after this i pressed the button ” Zoom” the Scrollbar run but the curve removed like “first” picture and “second”,
i think that the problem in the scrollbar because in my application the scrollbar moves from right to left and in your application like picture”Scichart” the Scrollbar moves from left to right !!
So how can i do this!
Thank you!

Best Regards,
Sahar.

C# Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using System.Timers;

using System.Windows.Threading;
using Abt.Controls.SciChart.Common;

using Abt.Controls.SciChart.Model.DataSeries;
using Abt.Controls.SciChart.Common.Helpers;
using Abt.Controls.SciChart;
using Common;
using System.Globalization;
using Microsoft.Win32;
using System.Diagnostics;
using Abt.Controls.SciChart.Visuals;
using System;
using System.Collections.Generic;
using System.Timers;
using Abt.Controls.SciChart.Model.DataSeries;
using Abt.Controls.SciChart.Numerics;
using Abt.Controls.SciChart.ChartModifiers;
using Abt.Controls.SciChart.Visuals.RenderableSeries;
using Abt.Controls.SciChart.Example.MVVM;
using Abt.Controls.SciChart.Example;
using Abt.Controls.SciChart.Visuals.Axes;
using Abt.Controls.SciChart.Example.Data;
using Abt.Controls.SciChart.Example.Common;
using Abt.Controls.SciChart.Example.Examples.IWantTo.AnnotateAChart.DragHorizontalThreshold;
using System.Collections.ObjectModel;
using System.Windows.Annotations;
using Abt.Controls.SciChart.Visuals.Annotations;


namespace BeanGUI
{
/// <summary>
/// Interaction logic for SensorGraph2D.xaml
/// </summary>
public partial class SensorGraph2D : UserControl, IExampleAware
{


    private IXyDataSeries<DateTime, double> series1;

    public double _Threshold;
    public Boolean chkBx_Threshold_checked = false;
    private bool _isMouseDoubleClick;
    private bool _isZoomEnabled;
    private bool _isPanEnabled;
    private TimedMethod _startDelegate;
    public Boolean Zoom_test = false;
    public int cpt = 0;
    private readonly Abt.Controls.SciChart.ActionCommand _zoomModeCommand;
    private I_BeanSensorModel sensor;

    private readonly Abt.Controls.SciChart.ActionCommand _panModeCommand;

    public double Measure_val;
    Boolean Circle = false;
    public string date_val;
    private IndexRange _xVisibleRange;
    public double val_Threshold;
    public int i = 0;
    public int h = 0;
    public double st;

    string[] Tab = new string[4];
    public SensorGraph2D()
    {
        InitializeComponent();
        _zoomModeCommand = new Abt.Controls.SciChart.ActionCommand(SetZoomMode);
        _panModeCommand = new Abt.Controls.SciChart.ActionCommand(SetPanMode);
        IsPanEnabled = true;


        /* for foreach all themeManager */


        foreach (string theme in ThemeManager.AllThemes)
        {
            cboTheme.Items.Add(theme);
        }
        cboTheme.SelectedItem = "Oscilloscope";


    }


    public ICommand ZoomModeCommand { get { return _zoomModeCommand; } }

    public ICommand PanModeCommand { get { return _panModeCommand; } }

    public bool IsZoomEnabled
    {
        get { return _isZoomEnabled; }
        set
        {
            _isZoomEnabled = value;

        }
    }
    public bool IsPanEnabled
    {
        get { return _isPanEnabled; }
        set
        {
            _isPanEnabled = value;

        }
    }

    private void SetPanMode()
    {
        IsPanEnabled = true;
        IsZoomEnabled = false;
    }

    private void SetZoomMode()
    {

        IsZoomEnabled = true;
    }


    public double Threshold
    {
        get { return _Threshold; }
        set
        {
            _Threshold = value;

        }
    }


    public IndexRange XVisibleRange
    {
        get { return _xVisibleRange; }
        set
        {
            if (Equals(_xVisibleRange, value))
                return;
            _xVisibleRange = value;
            OnPropertyChanged("XVisibleRange");

        }
    }

    private void OnPropertyChanged(string p)
    {
        throw new System.NotImplementedException();
    }

    public void CreateDataSetAndSeries_Alarm(List<DateTime> lstX1, List<double> lstY1)
    {
        series1 = new XyDataSeries<DateTime, double>();

        using (this.sciChartSurface.SuspendUpdates())
        {

            series1.Append(lstX1, lstY1);

        }
        redLine.DataSeries = series1;
        if (Zoom_test == false)
        {
            sciChartSurface.ZoomExtentsY();
        }

    }


    public double maxValuesY()
    {
        return (double)series0.YMax;
    }

    public double minValuesY()
    {
        return (double)series0.YMin;
    }

    public DateTime maxValuesX()
    {
        return (DateTime)series0.XMax;
    }

    public DateTime minValuesX()
    {
        return (DateTime)series0.XMin;
    }


    public void ClearDataSeries1()
    {
        if (series1 == null)
            return;

        using (this.sciChartSurface.SuspendUpdates())
        {
            series1.Clear();
        }
    }



    /* for the Theme Changed*/
    private void cboThemeChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
    {

        ThemeManager.SetTheme(sciChartSurface, (string)cboTheme.SelectedItem);
        ThemeManager.SetTheme(sciChartSurface, (string)cboTheme.SelectedItem);

    }

    /*Point values*/
    public void SeriesSelectionModifier_SelectionChanged(object sender, EventArgs e)
    {
        if (Circle == true)
        {
            OnSeriesSelectionChanged();
        }
    }
    public void OnSeriesSelectionChanged()
    {
        bool hasSelection = sciChartSurface.SelectedRenderableSeries.Any();

    }


    private void CopyToClipboardClick(object sender, RoutedEventArgs e)
    {

        var bmp = this.sciChartSurface.ExportToBitmapSource();
        Clipboard.SetImage(bmp);

        MessageBox.Show("Copied to Clipboard!");
    }

    private void SaveAsPngClick(object sender, RoutedEventArgs e)
    {
        var dialog = new SaveFileDialog();
        dialog.DefaultExt = "png";
        dialog.AddExtension = true;
        dialog.Filter = "Png Files|*.png";
        dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
        if (dialog.ShowDialog() == true)
        {
            this.sciChartSurface.ExportToFile(dialog.FileName, ExportType.Png);
            Process.Start(dialog.FileName);
        }
    }


    private void ZoomExtendsClick(object sender, RoutedEventArgs e)
    {
        sciChartSurface.ZoomExtents();

        Zoom_test = false;
        this.panModifier.IsEnabled = false;
    }
    private void PrintToXpsClick(object sender, RoutedEventArgs e)
    {
        var dialog = new PrintDialog();
        if (dialog.ShowDialog() == true)
        {
            var size = new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaWidth * 3 / 4);

            var scs = CreateSciChartSurfaceWithoutShowingIt(size);


            Action printAction = () => dialog.PrintVisual(scs, "Programmer Awesomeness");
            Dispatcher.BeginInvoke(printAction);
        }
    }

    private void ZoomExtentsY_Checked(object sender, RoutedEventArgs e)
    {
        this.XAxis.AutoRange = AutoRange.Always;
        this.YAxis.AutoRange = AutoRange.Never;
        if (rubberBandZoomModifier != null)
        {

            var checkBox = (CheckBox)sender;
            rubberBandZoomModifier.ZoomExtentsY = checkBox.IsChecked == true;
        }
    }
    private void ZoomExtentsX_Checked(object sender, RoutedEventArgs e)
    {

        this.YAxis.AutoRange = AutoRange.Always;
        this.XAxis.AutoRange = AutoRange.Never;
        if (rubberBandZoomModifier != null)
        {
            var checkBox = (CheckBox)sender;
            rubberBandZoomModifier.IsXAxisOnly = checkBox.IsChecked == true;
        }
    }

    private void ZoomClick(object sender, RoutedEventArgs e)
    {

        Zoom_test = true;


    }

    private void ZoomPanModifier_MouseDown(object sender, MouseButtonEventArgs e)
    {
        this.XAxis.AutoRange = AutoRange.Never;
        this.YAxis.AutoRange = AutoRange.Never;
    }

    private void UserControl_Loaded(object sender, RoutedEventArgs e)
    {

    }

    public void OnExampleExit()
    {
        throw new System.NotImplementedException();

    }

    public void OnExampleEnter()
    {
        throw new System.NotImplementedException();
    }
    public void CursorModifier_MouseDown(object sender, MouseButtonEventArgs e)
    {

        this.XAxis.Scrollbar.IsEnabled = false;
        System.Diagnostics.Debug.WriteLine("Sahar====>");
    }


    private void chkBx_Threshold_Checked(object sender, RoutedEventArgs e)
    {
        chkBx_Threshold_checked = true;
    }

    private void chkBx_Threshold_Unchecked(object sender, RoutedEventArgs e)
    {
        chkBx_Threshold_checked = false;

        ClearDataSeries1();
    }




}
}

XAML CODE

<UserControl x:Class="BeanGUI.SensorGraph2D"
         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:SciChart="http://schemas.abtsoftware.co.uk/scichart" 
         xmlns:helpers="clr-namespace:Abt.Controls.SciChart.Example.Helpers;assembly=Abt.Controls.SciChart.Example"
          xmlns:Common="clr-namespace:Abt.Controls.SciChart.Example.Common;assembly=Abt.Controls.SciChart.Example"
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300" Loaded="UserControl_Loaded">


<UserControl.Resources>

</UserControl.Resources>

<Grid x:Name="LayoutRoot">
    <Grid.Resources>
        <Common:DoubleToGridLengthConverter x:Key="DoubleToGridLengthConverter"/>
    </Grid.Resources>



    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <SciChart:SciStockChart x:Name="sciChartSurface" Grid.Row="1" Padding="20,40,10,10" IsPanEnabled="{Binding IsPanEnabled}" IsRubberBandZoomEnabled="{Binding IsZoomEnabled}" SciChart:ThemeManager.Theme="Oscilloscope"  >

        <!-- <SciChart:SciStockChart.Annotations>
            <SciChart:HorizontalLineAnnotation HorizontalAlignment="Stretch"
            IsEditable="True"
            LabelPlacement="Axis"
            LabelTextFormatting="0.00"
            ShowLabel="True"
            Stroke="Red"
            StrokeThickness="2"
            Y1="{Binding Threshold,Mode=TwoWay}"  />
        </SciChart:SciStockChart.Annotations> -->



        <!-- Create three RenderableSeries, which map 1:1 to the DataSeries created in code-behind -->
        <SciChart:SciChartSurface.RenderableSeries>
            <SciChart:FastLineRenderableSeries x:Name="lineSeries" SeriesColor="#FFFFA500" StrokeThickness="2" />


        </SciChart:SciChartSurface.RenderableSeries>


        <SciChart:SciStockChart.XAxisStyle>
            <Style TargetType="SciChart:CategoryDateTimeAxis">
                <Setter Property="VisibleRange" Value="{Binding XVisibleRange, Mode=TwoWay}"/>
            </Style>
        </SciChart:SciStockChart.XAxisStyle>
        <SciChart:SciStockChart.XAxis>
            <SciChart:DateTimeAxis  Name="XAxis"  DrawMinorTicks="true" DrawMinorGridLines="True"   DrawLabels ="true" DrawMajorGridLines="true" MinHeight="50"  TextFormatting="HH:mm MMM dd"
                                  SubDayTextFormatting="HH:mm:ss MMM dd yyyy" >

                <SciChart:DateTimeAxis.GrowBy>
                    <SciChart:DoubleRange Min="0" Max="0"/>
                </SciChart:DateTimeAxis.GrowBy>

            </SciChart:DateTimeAxis  >
        </SciChart:SciStockChart.XAxis>

        <!-- Create a Y Axis -->
        <SciChart:SciStockChart.YAxis>
            <SciChart:NumericAxis Name="YAxis" AutoRange="Never" AllowDrop="False" ToolTip="true"
                                  DrawMinorTicks="True" DrawMinorGridLines="true" DrawLabels ="true" DrawMajorBands="True" AutoTicks="True" DrawMajorGridLines="true" TextFormatting="0.0000" >

                <SciChart:NumericAxis.GrowBy>
                    <SciChart:DoubleRange Min="0.1" Max="0.1"/>
                </SciChart:NumericAxis.GrowBy>


            </SciChart:NumericAxis>
        </SciChart:SciStockChart.YAxis>

        <!--  Add some modifiers to zoom, zoom extents  -->

        <!--    -->
        <SciChart:SciStockChart.ChartModifier>

            <SciChart:ModifierGroup>


                <SciChart:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True" IsXAxisOnly="False" ZoomExtentsY="False"/>

                <SciChart:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>
                <SciChart:ZoomPanModifier x:Name="panModifier"/>

                <SciChart:CursorModifier ReceiveHandledEvents="True" ShowAxisLabels="True" ShowTooltip="True" ShowTooltipOn="MouseRightButtonDown"  ToolTip="true"/>
                <!-- <SciChart:RubberBandXyZoomModifier IsEnabled="{Binding ChartModifier, Mode=TwoWay, ConverterParameter=RubberBandZoom}" IsXAxisOnly="False"/>-->
                <SciChart:MouseWheelZoomModifier/>
                <!-- For the point values -->

                <SciChart:SeriesSelectionModifier SelectionChanged="SeriesSelectionModifier_SelectionChanged">
                    <SciChart:SeriesSelectionModifier.SelectedSeriesStyle>
                        <Style TargetType="SciChart:BaseRenderableSeries">
                            <Setter Property="PointMarkerTemplate">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <SciChart:EllipsePointMarker x:Name="PART_PointMarker" Stroke="White" Fill="#77777777" StrokeThickness="1" Width="5" Height="5"/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </SciChart:SeriesSelectionModifier.SelectedSeriesStyle>
                </SciChart:SeriesSelectionModifier>
            </SciChart:ModifierGroup>
        </SciChart:SciStockChart.ChartModifier>
    </SciChart:SciStockChart>

    <!-- Define the Toolbar -->
    <!-- Define the Toolbar verticale -->
    <!-- Update Theme -->
    <!--  This grid is used to space Overview Control so its width matches parent chart XAxis  -->

    <Grid Grid.Row="2">
        <!--  The grid is used to set paddings around the Overview, so that the size of the Overview matches the size of the XAxis on the parent chart  -->
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="20"/>
            <!--  Matches parent surface padding left  -->
            <ColumnDefinition Width="25*"/>
            <!--  Hosts overview control  -->
            <ColumnDefinition Width="0"/>
            <!--  Used to bind to parent surface YAxis  -->
            <ColumnDefinition Width="80"/>
            <!--  Matches parent surface padding right  -->
        </Grid.ColumnDefinitions>

        <helpers:ActualSizePropertyProxy x:Name="proxy" Element="{Binding ElementName=sciChartSurface, Path=YAxis}"/>
        <SciChart:SciChartOverview  Grid.Column="1" ParentSurface="{Binding ElementName=sciChartSurface,
                                                    Mode=OneWay}"
                                                            SciChart:ThemeManager.Theme="{Binding ElementName=cboTheme,
                                                           Path=SelectedItem}"
                            SelectedRange="{Binding XVisibleRange,
                                             Mode=TwoWay}" Focusable="True" />




    </Grid>



    <Grid Grid.Row="1" Margin="40,40,0,0" VerticalAlignment="Top">
        <Grid.Resources>
            <!-- Style for Stats -->
            <Style TargetType="TextBlock" x:Key="StatsStyle">
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="Foreground" Value="#BBFC9C29"/>
                <Setter Property="FontFamily" Value="pack://application:,,,/Resources/Fonts/#Neuropol Regular"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="60"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="186*" />
        </Grid.ColumnDefinitions>
        <Label x:Name="measureLabel1"    Margin="-8,6,12,-2"  Foreground="GreenYellow" FontStyle="Normal" FontSize="11" FontStretch="UltraCondensed" Target="{Binding}" IsEnabled="True"/>
        <TextBlock Margin="5" FontSize="16" Foreground="#eee" Text="{Binding DataContext.Threshold, StringFormat='Threshold = {0:#0.00}', RelativeSource={RelativeSource AncestorType=SciChart:SciChartSurface}}"/>
    </Grid>
    <Grid Grid.Row="1" Margin="-4,102,0,119" VerticalAlignment="Center">
        <Grid.RowDefinitions>
            <RowDefinition Height="12*" />
            <RowDefinition Height="2*" />
        </Grid.RowDefinitions>
        <Grid.Resources>
            <!-- Style for Stats -->
            <Style TargetType="TextBlock" x:Key="StatsStyle">
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="Foreground" Value="#BBFC9C29"/>
                <Setter Property="FontFamily" Value="pack://application:,,,/Resources/Fonts/#Neuropol Regular"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="290*" />
        </Grid.ColumnDefinitions>
        <Label x:Name="ActifLabel"   IsEnabled="true"   HorizontalAlignment="Left" Foreground="GreenYellow" FontStyle="Normal" FontSize="11" FontStretch="UltraCondensed" Target="{Binding}"  />

    </Grid>
    <Grid Grid.Row="1" Margin="-4,-56,0,56" VerticalAlignment="Bottom">
        <Grid.RowDefinitions>
            <RowDefinition Height="15*" />
            <RowDefinition Height="2*" />
        </Grid.RowDefinitions>
        <Grid.Resources>
            <!-- Style for Stats -->
            <Style TargetType="TextBlock" x:Key="StatsStyle">
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="Foreground" Value="#BBFC9C29"/>
                <Setter Property="FontFamily" Value="pack://application:,,,/Resources/Fonts/#Neuropol Regular"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="290*" />
        </Grid.ColumnDefinitions>
        <Label x:Name="inactifLabel"   IsEnabled="true"   HorizontalAlignment="Left" Foreground="GreenYellow" FontStyle="Normal" FontSize="11" FontStretch="UltraCondensed" Target="{Binding}"  />

    </Grid>




    <Grid Grid.Row="1"  VerticalAlignment="top" HorizontalAlignment="Center" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.Resources>
            <!-- Style for Stats -->
            <Style TargetType="TextBlock" x:Key="StatsStyle">
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="FontFamily" Value="pack://application:,,,/Resources/Fonts/#Neuropol Regular"/>
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="200*" />
        </Grid.ColumnDefinitions>
        <Label x:Name="graphPaneTitle" Margin="2" Foreground="#FFFFA500" FontStyle="Italic" FontSize="20" FontStretch="UltraCondensed" Height="31" />

    </Grid>

    <StackPanel Grid.Row="0" Orientation="Horizontal" >
        <!-- <Label x:Name="measureLabel1"    Margin="2"  Foreground="GreenYellow" FontStyle="Normal" FontSize="11" FontStretch="UltraCondensed" Height="25" Target="{Binding}" IsEnabled="True"/> -->
        <ComboBox x:Name="cboTheme" ToolTip="Update Theme" Margin="2,3,2,0" SelectionChanged="cboThemeChanged" Foreground="GreenYellow" HorizontalAlignment="center" SelectedItem="Oscilloscope"  Height="28" Width="92">
            <ComboBox.Background>

                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>

            </ComboBox.Background>
        </ComboBox>
        <Line Margin="2,3,2,0" Stroke="Gray" Y2="25"/>
        <Button Click="PrintToXpsClick" ToolTip="Print Graph"  Foreground="GreenYellow"  Margin="2,3,2,0"  Content="Print"  Height="28" >

            <Button.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FFB3CBBB" Offset="1" />
                </LinearGradientBrush>
            </Button.Background>
        </Button>



        <Button Click="SaveAsPngClick" ToolTip="Save To PNG" Foreground="GreenYellow"  Margin="2,3,2,0"  Content="Save to PNG" Height="28" >
            <Button.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </Button.Background>
        </Button>
        <Button Click="CopyToClipboardClick" ToolTip="Copy To ClipBoard" Foreground="GreenYellow"  Margin="2,3,2,0"  Content="Copy to Clipboard" Height="28">
            <Button.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </Button.Background>
        </Button>
        <Line Margin="2,3,2,0" Stroke="Gray" Y2="25"/>

        <ToggleButton Click="ZoomExtendsClick" ToolTip="Extends Zoom" Margin="2,3,2,0"  Foreground="GreenYellow" Height="28" >
            <StackPanel Orientation="Horizontal">
                <Image Margin="3" Source="/Abt.Controls.SciChart.Example;component/Resources/Images/fit_to_size.png" Stretch="None"/>
                <TextBlock Margin="3" Text="Extends Zoom"/>

            </StackPanel>

            <ToggleButton.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </ToggleButton.Background>
        </ToggleButton>



        <ToggleButton Click="ZoomClick" ToolTip="Zoom Curves" Margin="2,3,2,0"  Foreground="GreenYellow" Height="28" >
            <StackPanel Orientation="Horizontal">
                <Image Margin="3" Source="/Abt.Controls.SciChart.Example;component/Resources/Images/zoom.png" Stretch="None"/>
                <TextBlock Margin="3" Text="Zoom"/>

            </StackPanel>
            <ToggleButton.Background>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </ToggleButton.Background>
        </ToggleButton>
        <ToggleButton x:Name="btnPan" ToolTip="Pan"
                      Margin="2,3,2,0"  Foreground="GreenYellow" Height="28"
                      Content="Pan"

                      IsChecked="{Binding IsEnabled,ElementName=panModifier,
                                          Mode=TwoWay}"
                      SciChart:ToggleButtonExtensions.GroupName="ModifiersGroup">

            <ToggleButton.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FF979D99" Offset="1" />
                </LinearGradientBrush>
            </ToggleButton.Background>
        </ToggleButton>
        <CheckBox  Margin="2,3,2,0" Checked="ZoomExtentsY_Checked" Content="ZoomY" Foreground="GreenYellow" Unchecked="ZoomExtentsY_Checked" Height="14" >

        </CheckBox>
        <CheckBox  Margin="2,3,2,0" Checked="ZoomExtentsX_Checked" Foreground="GreenYellow" Content="ZoomX" Unchecked="ZoomExtentsX_Checked" Height="14">
        </CheckBox>
        <Line Margin="2,3,0,0" Stroke="Gray" Y2="25"/>
        <CheckBox  Margin="2,3,2,0" Name="chkBx_Threshold" Checked="chkBx_Threshold_Checked" Foreground="GreenYellow" Content="Alarm" Unchecked="chkBx_Threshold_Unchecked" Height="14">
        </CheckBox>

        <StackPanel.Background>
            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                <GradientStop Color="Black" Offset="0" />
                <GradientStop Color="Black" Offset="1" />
            </LinearGradientBrush>
        </StackPanel.Background>





    </StackPanel>


    <!-- Define the SciChartSurface -->


    <!-- Create an X Axis -->



</Grid>
</UserControl>
0 votes
6k views

I need to set VerticalLineAnnotations without a label.

My setting is:

const verticalLineAnnotation = new VerticalLineAnnotation({
stroke: "ff2626",
strokeThickness: 3,
x1: -1,
showLabel: false,
isEditable: true,
isHidden: true
});

When the user needs the annotation the VerticalLineAnnotation is made visible by setting isHidden = false. After setting it to false an exception is thrown with following content: “TypeError: Cannot read properties of undefined (reading ‘left’)”.

1 vote
16k views

Comparing Performance for a Fifo Chart yields unexplained outcome. Fastest Renderer: high quality renderer. Slowest: direct3d.
My problem is not that they don’t reach the tested performance but that the high quality renderer looks fastest. I would expect direct3d to be the fastest.

Can anyone explain this or possibly find an error in my code or reasoning?

I attach sample code.
First picture is in debug build and the second in release build. In release the software renderers are not so far apart any more but still noticeable.

Explanation of test:

I used the FifoSample from the samples suite and changed it for performance tests.

There are 2 projects. One is the control in WpfControl using SciChart the other one is hosting the control in WpfControlHost. (This setup is only this complicated for testing because it will by my setup later.)

I got the following outcome. Essentially high quality renderer is fastest. Taking less time. Frequency is the highest. Then comes the high performance renderer and finally the direct3d renderer.

What is the test supposed to do (if I didn’t make a mistake!):

The goal is to reach 110.000 Hz sample rate (worker_DoWork.hertz * this._multiplier). Putting in 10 values at once for each series on an iteration round. Iterations try to reach 11.000/sec.

In source code: (method: worker_DoWork)hertz = 11.000 and this._multiplier = 10

Measurements are done by Microsoft StopWatch Class where 1second is documented as = StopWatch.Ticks/StopWatch.Frequency (of Processor).

To switch the renderers I uncomment the sections in UserControl1.xaml and run a test in debug or release build without Visual Studio attached.

  • Uwe Hafner asked 11 years ago
  • last active 1 year ago
0 votes
12k views

Is there a way to provide custom text for the labels in a PieChartSegment? I want to format the text, but haven’t been able to find a label formatter for the pie charts.

1 vote
8k views

I have a real time updated chart with very large data size and I am facing the slow client problem. i.e. The data sending speed is faster than the data receiving and handling speed which causes memory growing up issue. I am trying to use Web Workers to increase the data handling speed in frontend. I have found a related post:

https://www.scichart.com/questions/wpf/is-xydataseries-safe-to-being-changed-in-a-separate-thread

It seems possible to update XyDataSeries in the background thread with WPF. My UI is built with NextJS. I tried to use Web Workers to implement multiple threads. But I found that it can’t pass the SciChartSurface or XyDataSeries to the worker thread. Could you show me an example on how to update XyDataSeries in the worker thread with Web Workers?

  • Quyen Sy asked 3 years ago
  • last active 3 years ago
0 votes
12k views

Hi

Please can you give me a guide as to how to pull out the Android EEG channel example into a standalone project so that I can use it and build on it.

I have tried but I am getting errors.

Thanks

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

enter image description here

There is a problem with cursor axis label – it is completely wrong (always too big). I don’t have any custom label provider set for this axis.
It is funny that on cursor tooltip the value is correct (here I use CustomXYSeriesInfoProvider).

The same thing happens on Volume, but here I have a custom NumericLabelProviderVolume and I have debugged formatCursorLabel() in it and found out that there are always two subsequent calls of this function. With first call the incoming parameter (Comparable dataValue) is correct, but then in the second call this value is wrong and it overwrites previous right formatted value. I don’t now where does this value come from.

  • Primoz asked 7 years ago
  • last active 7 years ago
0 votes
0 answers
10k views

When the X-axis mouse scroll to zoom in or out, the use of MouseWheel=”mouseWheelZoomModifier_MouseWheel” monitoring is invalid, how to do the mouse wheel zoom, dynamic loading more data, the mouse wheel shrink, do not need to reduce the data, because in some cases the one-time loading data is too large

0 votes
13k views

Hi,

I have a function that needs to export the chart when it’s rendered.

    ...
    sciChartSurface.Rendered += SciChartSurface_Rendered;
}

private void SciChartSurface_Rendered(object sender, EventArgs e)
    {
        var surface = sender as SciChartSurface;
        if (surface != null)
        {
            surface.ExportToFile(ImageFullFilename, ExportType.Png);


            surface.Rendered -= SciChartSurface_Rendered;
            ...
        }
    }

However the export to file hangs…

Any ideas how to fix this?

Update

Changing to the following code works…

private async void SciChartSurface_Rendered(object sender, EventArgs e)
    {
        var surface = sender as SciChartSurface;
        if (surface != null)
        {
            await Task.Run(() =>
            {
                Thread.Sleep(2000);
            });
            surface.ExportToFile(ImageFullFilename, ExportType.Png);


            surface.Rendered -= SciChartSurface_Rendered;
            ...
        }
    }

So if I’m too early in the lifecycle of the render, where in the cycle can I be sure it’s done?

1 vote
13k views

In Scichart 2, we had some code that added some annotations in the SCIAnimation completion block. Here’s a snippet. We need the self.renderAnnotations() to happen AFTER the chart data range is set, because we only draw annotations that will fit within the individual bar stack elements.

        SCIUpdateSuspender.usingWithSuspendable(sciChartSurface) {
            if hasBarData {  
                self.sciChartSurface?.renderableSeries.add(columnCollection)
                let animation = SCIWaveRenderableSeriesAnimation(duration: 1, curveAnimation: .easeOut)
                animation.completionHandler = {
                    self.renderAnnotations()
                    self.configurationButtons?.forEach { $0.isUserInteractionEnabled = true }
                }
                columnCollection.addAnimation(animation)
            }

Here’s the current rewrite to run under Scichart 4. With this code, yAxisLeft.visibleRange has not been updated to the correct data range when renderAnnotations() is called.

Uncommenting the 3 animator-related lines near the bottom doesn’t make a difference, and my listener function is never called.

I’ve also tried wrapping the renderAnnotations() call in a DispatchQueue.main.asyncAfter() call. That sometimes works, and sometimes results in renderAnnotations() not being called at all.

How do I get renderAnnotations() (and the following line looping on configurationButtons) to run, reliably, after the axis range setup is complete?

How do I get my wave animation back?

        SCIUpdateSuspender.usingWith(sciChartSurface) {
            if hasBarData { 
                self.sciChartSurface?.renderableSeries.add(columnCollection)
                    self.renderAnnotations()
                self.configurationButtons?.forEach { $0.isUserInteractionEnabled = true }
//                let animator = SCIAnimations.createWaveAnimator(for: columnCollection)
//                animator.add(self)
//                animator.start()
            }
0 votes
14k views

Hey guys,

I have been working on an application (with an internal library for building plots, and an adapter that creates the SciChart ViewModel implementation). All of my code makes heavy use of .Net 4.5’s Async API.

What I’ve noticed is that invoking the constructor on a RenderableSeries without the Dispatcher triggers the STA InvalidOperationException in PresentationCore. (Note that this is all happening during ViewModel construction, and before any changes have been made to the UI).

Is there any guidance on which parts of the SciCharts API require use of the UI thread?

  • dsantimore asked 13 years ago
  • last active 1 year ago
1 vote
5k views

I’m using an example of RealtimeTickingStockCharts

https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Examples/src/components/Examples/Charts2D/CreateStockCharts/RealtimeTickingStockCharts

I’ve added a modifier

new YAxisDragModifier({
            dragMode: EDragMode.Scaling,
        }),

I see icon changed to arrows but scaling does not work. What should I check ?

0 votes
12k views

Hi every one,

I played around with the example SciChart_StackedColumnSideBySide from Scichart. And I saw something strange here:

When I try to add a empty series (Eg: I don’t append data into indoneziaDataSeries), and run the app.
I unchecked all series and rechecked all, and I found that all series cannot be showed (as the image below).

Image

  • Quan Tran asked 10 years ago
  • last active 10 years ago
0 votes
10k views

Hi…
I want to define ticks which start from some value. First I try to use customer TickProvider to calculate my owner tick array.
When tick counts are small, it look good in a small size windows.
But when the tick counts are large, the tick display fail. It only has one tick normal and others only have”-” but no label. If I change the windows size to larger, all ticks just display normal. (please see the attached file~~)
Can customer tickprovider support the default tick display mechanism to auto display just some ticks?

(in small windwos and large windows, the visible range is the same)

  • ychch yang asked 10 years ago
  • last active 10 years ago
0 votes
0 answers
13k views

Hi,

I’m trying to enable the use of multiple VerticalLineAnnotations and show the corresponding SeriesInfo in an extra legend to the user. Utilizing the RolloverModifier Tooltips example, this works quite easily for the position and values of the VerticalLineAnnotations. However, I would like to show differences (X and Y) between the values of two VerticalLineAnnotations in the same manner.

My approach was to subclass ChartDataObject and add an ObservableCollection of a custom class (SeriesDifferenceInfo) providing properties, which exhibit DeltaX and DeltaY for binding in the surface. For keeping this collection up to date when adding or removing a VerticalLineAnnotation, I registered for the CollectionChanged event of SeriesInfo in my subclassed ChartDataObject and wanted to update the Collection of SeriesDifferenceInfo subsequently. But somehow this event appears not to be triggered on a change in the list of SeriesInfo. Am I doing something wrong or is this intended behaviour? Of course, I could simply call a method UpdateDifferenceCollection(), when adding/removing a VerticalLineAnnotation, but is this really neccessary?

Also, the next problem is triggering PropertyChanged for the DeltaX and DeltaY values when the values of one SeriesInfo changed. I guess this could be done by listening to e.g. a drag event of VerticalLineAnnotation, but is there a more straightforward way to do this?

Best regards
Phil

0 votes
11k views

Hi,
I downloaded your Android Examples project to evaluate whether it’ll be a good fit for real time updates.
Replaced SetRunTimeLicenseKey call with my trial keys.
Designer time window displays Sorry!you have not set a LicenseKey message.
RunTime displays your trial license expired.

Any help on this would be great.

Thanks

  • Raji S asked 8 years ago
  • last active 6 years ago
0 votes
12k views

Hello,

I’be tried a small sample application where I instantiate a SciChart surface and some series.

I then added our Runtime License Key like it is explained here.

I gave the executable to two different persons. The first one got to see the charts but he got the “powered by SciChart logo”.
The second one wasn’t able to see the charts and got an “expired license” message.

I would understand seeing that if the user were running an application through Visual Studio or has a trial license, but I’m expecting them to be able to run the app normally when adding the Runtime License.

Any help would be appreciated.

Thank you very much.

Kind regards,
Sebastian

Showing 101 - 150 of 5k results