Pre loader

Tag: WPF

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0 votes
7k views

If I set AutoRange = “Always” myHorizontalLineAnnotation draws fine. When I set it to “Never” – which I want – my HorizontalLineAnnotation won’t draw. How do I do this? ty

  <s:SciChartSurface.YAxis>
        <s:NumericAxis AutoRange="Never"
                       VisibleRange="{Binding ElementName=this, Path=YMinMax}"

        <s:HorizontalLineAnnotation HorizontalAlignment="Stretch"
                                    Y1="{Binding ElementName=this, Path=CurrentHigh}"
                                    Stroke="{Binding ElementName=this, Path=ToleranceColor}"
                                    StrokeThickness="1" />
0 votes
16k views

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

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

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

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

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

0 votes
10k views

I have introduced a real time chart in my WPF Application. The chart starts plotting points from the left of the chart ( close to Y-Axis).

I would like it to start plotting from the right of the chart ( Away from Y-Axis) and as when points start adding up, I would like the points to slide to the left ( Towards Y-Axis).

Similar to how performance tab in Task Manager displays the CPU utilization.

1 vote
11k views

Hi SciCharters,
I would like to create a color coded 2D scatter plot.
My approach is the IPointMarkerPaletteProvider interface. It works, but I have experienced a huge performance difference when I individually colored every datapoint of my 2D chart and using a static color.
When I use the same provider but only a single color there is no performance issue at all.

Here is the relevant code of my PointMarkerPaletteProvider interface:

 public PointPaletteInfo? OverridePointMarker(IRenderableSeries rSeries, int index, IPointMetadata metadata)
    {
            var myMetaData= metadata as MyRecordMetadata;
            var colorBarPosition = GetColorBarPosition(myMetaData.PlotValue);

            _pointMarkerColorOverrides.Fill = _ColorBar[colorMapPosition];
            _pointMarkerColorOverrides.Stroke = _ColorBar[colorMapPosition];
             return _pointMarkerColorOverrides;
    }

The _ColorBar contains only 256 values and the Color is selected according to the myMetaData.PlotValue in GetColorBarPosition().
The series is plotted as expected, but it takes “ages”(seconds for 4000 data points) for rendering it on the chart.
If I replace the assignments of _pointMarkerColorOverrides.Stroke and _pointMarkerColorOverrides.Fill with one static color, there’s no performance issue at all.

I was just curious if that is the expected behaviour? Would it be better (in terms of performance) to switch to another chart type (e.g. heatmap chart) to plot color coded values?

  • Tim asked 7 years ago
  • last active 7 years ago
1 vote
11k views

Hi – I have a scrolling sine wave and would like to put a numeric value at the high point of each peak. Is this possible? I’ve attached a pic of what I need. ty

0 votes
10k views

XAxis Labels

I want to have a label on the x axis for each custom annotations. Is this possible. if so how do i do that.

Thanks

0 votes
10k views

I am have a vertical stacked chart setup which shares the same x- axis ranges. I am trying to find a way to add vertical lines in both the charts at once and further I need the vertical lines to be dragged in sync. When one vertical line annotation is dragged, I need the same movement to happen in the other chart as well. I can share a prototype if you want. Please suggest a solution.

0 votes
10k views

I am trying to call the ZoomBy() method of SciChart control from ViewModel. The ZoomBy() is easily available in the xaml.cs file like below:

// TODO: Need to implement zoom using MVVM
    private void BtnZoomIn_Click(object sender, RoutedEventArgs e)
    {
        TemperatureGraph.ChartModifier.XAxis.ZoomBy(-0.1, -0.1);
    }

The same functionality I need to implement using the ViewModel pattern.

However the ZoomExtents method is easily being called using ViewportManager of SciChart control. E.g. below: XAML file

<RocheButton Name="BtnZoomOut" DockPanel.Dock="Top" Icon="{IconResource Icon=ZoomOut}" HorizontalAlignment="Right" Command="{Binding ZoomOutCommand}" />    
<s:SciChartSurface x:Name="TemperatureGraph" Grid.Column="0" s:ThemeManager.Theme="BrightSpark"  
                           RenderableSeries="{s:SeriesBinding TemperatureGraphViewModel}" DockPanel.Dock="Bottom"
                           ViewportManager="{Binding ViewportManager}">

And the ViewModel Code:

public class TemperatureSummaryGraphViewModel : ViewModelBase
    {
        #region Private Members

        private IXyDataSeries<TimeSpan, double> TemperatureDataSeries = new XyDataSeries<TimeSpan, double>();
        private IXyDataSeries<TimeSpan, double> AcquisitionPointDataSeries = new XyDataSeries<TimeSpan, double>();
        private DefaultViewportManager _viewportManager = new DefaultViewportManager();
        private ICommand _zoomOutCommand;

        #endregion

        #region Constructor

        public TemperatureSummaryGraphViewModel()
        {
            ZoomOutCommand = new DelegateCommand(() => ZoomOutTemperatureGrpah());
            GenerateDummySeries();

            TemperatureGraphViewModel.Add(new LineRenderableSeriesViewModel()
            {
                DataSeries = TemperatureDataSeries,
                StyleKey = "LineSeriesStyle0"
            });

            TemperatureGraphViewModel.Add(new XyScatterRenderableSeriesViewModel()
            {
                DataSeries = AcquisitionPointDataSeries,
                StyleKey = "ScatterSeriesStyle0"
            });
        }

        #endregion

        #region Public Properties

        public ObservableCollection<IRenderableSeriesViewModel> TemperatureGraphViewModel { get; } = new ObservableCollection<IRenderableSeriesViewModel>();

        public IViewportManager ViewportManager
        {
            get
            {
                return _viewportManager;
            }

            set
            {
                if (ReferenceEquals(value, _viewportManager))
                {
                    return;
                }

                _viewportManager = (DefaultViewportManager)value;
                OnPropertyChanged("ViewportManager");
            }
        }

        public ICommand ZoomOutCommand
        {
            get
            {
                return _zoomOutCommand;
            }

            set
            {
                if (ReferenceEquals(value, _zoomOutCommand))
                {
                    return;
                }

                _zoomOutCommand = value;
                OnPropertyChanged(nameof(ZoomOutCommand));
            }
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// To generate dummy data
        /// // TODO: Need to integrate it with RunEditor with the actual data
        /// </summary>
        public void GenerateDummySeries()
        {
            double y = 80.5, yVar = 30.0;

            TemperatureDataSeries.Append(TimeSpan.FromMinutes(1), 40.0);
            TemperatureDataSeries.Append(TimeSpan.FromMinutes(2), 80.5);
            for (int x = 2; x < 50; x++)
            {
                TemperatureDataSeries.Append(TimeSpan.FromMinutes(x), y);

                yVar *= -1;
                y += yVar;
            }

            for (var i = 5.4; i < 50; i += 2)
            {
                AcquisitionPointDataSeries.Append(TimeSpan.FromMinutes(i), 60.0);
            }
        }

        public void ZoomOutTemperatureGrpah()
        {
            _viewportManager.ZoomExtents();
        }

        #endregion
    }
}

This code is working fine and zooming out the scichart control to 100%.

I want to implement the same using the ZoomBy().

Please help!

0 votes
8k views

I’m trying to render Histograms at runtime where the bins’ information like upper and lower bounds and width are known. However when I set the DataPointWidth to 0.2 for example, the bin spacing is different. Here is my code and XAML:

        // We can create a histogram with evenly spaced bins 
        // by specifying the lower bound, the upper bound, 
        // and the number of bins:
        var histogram = Histogram.CreateEmpty(values.Min(), values.Max(), numberOfBins);
        double width = (values.Max() - values.Min()) / numberOfBins;
        histogram.Tabulate(values);

        foreach (var bin in histogram.BinsAndValues)
        {
            XyDataSeries<double, double> dataSeries = new XyDataSeries<double, double>();
            dataSeries.Append(bin.Key.LowerBound, bin.Value);
            pointList.Add(new ColumnRenderableSeriesViewModel() { DataSeries = dataSeries, StrokeThickness = 2, Stroke = Colors.Gray, Fill = Brushes.CornflowerBlue, DataPointWidth = 0.2 });
        }

        ChartData = new ObservableCollection<IRenderableSeriesViewModel>(pointList);

        <Style x:Key="BaseColumnStyle" TargetType="s:FastColumnRenderableSeries">
        <Setter Property="Opacity" Value="0.3"/>
        <Setter Property="StrokeThickness" Value="2"/>
    </Style>

    <Style x:Key="BlueColumnStyle" BasedOn="{StaticResource BaseColumnStyle}" TargetType="s:FastColumnRenderableSeries">
        <Setter Property="Fill" Value="CornflowerBlue"/>
    </Style>
    <!--  Define styles for the SciChartSurface  -->
    <Style x:Key="SciChartSurfaceStyle" TargetType="s:SciChartSurface">
        <Setter Property="Background" Value="White"/>
        <Setter Property="Padding" Value="20"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontSize" Value="20"/>
        <Setter Property="FontFamily" Value="Arial Black"/>
        <Setter Property="FontWeight" Value="Bold"/>
    </Style>

    <!--  Define styles for the GridLinesPanel  -->
    <Style x:Key="GridLinesPanelStyle" TargetType="s:GridLinesPanel">
        <Setter Property="Background" Value="White"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Black"/>
    </Style>

    <!--  Using the LayoutTransform is much more apropriate in this point  -->
    <!--  the RenderTransform is used for demonstration purposes only,  -->
    <!--  for the compatibility with Silverlight reasons  -->
    <Style x:Key="AxisLabelStyle" TargetType="s:DefaultTickLabel">
        <!--<Setter Property="RenderTransform">
            <Setter.Value>
                <RotateTransform Angle="-15"/>
            </Setter.Value>
        </Setter>-->
        <Setter Property="Margin" Value="0"/>
    </Style>

    <!--  Define styles for the X and Y Axes  -->
    <Style x:Key="AxisStyle" TargetType="s:AxisBase">
        <Setter Property="FontSize" Value="18"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="TitleFontSize" Value="12"/>
        <Setter Property="TitleFontWeight" Value="Bold"/>
        <Setter Property="TickTextBrush" Value="Black"/>
        <Setter Property="DrawMajorBands" Value="False"/>
        <Setter Property="DrawMinorGridLines" Value="False"/>
        <Setter Property="DrawMinorTicks" Value="False" />
        <Setter Property="DrawMajorTicks" Value="False"/>
        <Setter Property="TickLabelStyle" Value="{StaticResource AxisLabelStyle}"/>
        <Setter Property="MajorGridLineStyle">
            <Setter.Value>
                <Style TargetType="Line">
                    <Setter Property="Stroke" Value="LightGray"/>
                    <Setter Property="StrokeThickness" Value="1"/>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>
</UserControl.Resources>
<Grid>
    <s:SciChartSurface x:Name="histogram" ChartTitle="{Binding ChartTitle}" RenderableSeries="{s:SeriesBinding ChartData}"
                       Style="{StaticResource SciChartSurfaceStyle}" GridLinesPanelStyle="{StaticResource GridLinesPanelStyle}">
        <s:SciChartSurface.XAxis>
            <s:NumericAxis AxisTitle="{Binding XAxisTitle}" Style="{StaticResource AxisStyle}" AutoRange="Always"/>
        </s:SciChartSurface.XAxis>
        <s:SciChartSurface.YAxis>
            <s:NumericAxis AxisTitle="{Binding YAxisTitle}" AxisAlignment="Left" Style="{StaticResource AxisStyle}"/>
        </s:SciChartSurface.YAxis>
    </s:SciChartSurface>
</Grid>

How can I make the bin spacing the same independent of bin width? See my attachment of two different histograms with the DataPointWidth for each.

  • Dave Frey asked 7 years ago
  • last active 7 years ago
1 vote
7k views

I’m currently in process of selecting a charting framework. I’ve been evaluating SciChart for some time now and have a few questions.
One of them is how can I automate chart operations: both commands and querying. Do you expose some kind of API for End-To-End tests? I’m specifically interested in this kind of tests.
Thanks?

P.S. Alternatively is there any screenshot-comparing API over the charts? That could be a decisive alternative as well.

0 votes
8k views

Hi,

There are some methods exposed in the API, ZoomBy and ZoomExtent which can programmatically be called from the code behind.
I am binding the series using IRenderableSeriesViewModel in MVVM pattern. Can we zoom the sciChart surface on a button click in ModelView?

Appreciating your help on this.

Thanks

1 vote
11k views

I am looking to do some custom formatting of the Heatmap.

Is it possible to show no text if the values are the minimum, and format these buckets to a predefined colour e.g. transparent?

Then I am only showing those buckets with values.

I am using the HeatmapChartwithText as a basis for my prototype at the moment.

This thread looked promising but wasn’t quite what I was looking for, and this thread was last updated a year ago and couldn’t find anything else on the subject so figured it was worth re-asking…

0 votes
11k views

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

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

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

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

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

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

0 votes
10k views

My idea was to have two FastLineRenderableSeries that both share the same XyDataSeries. One series will display the data as-is as an absolute value, while the other will display the same data relative to some arbitrary value. Each series would get it’s own axis.

Is there a way to accomplish what I’m trying to do, or is there another approach that accomplishes the same thing?

  • Dan Pilat asked 7 years ago
  • last active 7 years ago
0 votes
13k views

I have a WPF app where a UserControl is created at startup. The control contains two SciChartSurface objects, both initially invisible. About every 10th time I start the application it hangs on the thread with this call stack:

mscorlib.dll!System.Collections.Generic.ObjectEqualityComparer<System.__Canon>.Equals(System.__Canon x, System.__Canon y)    
mscorlib.dll!System.Collections.Generic.List<System.IComparable>.Contains(System.IComparable item)   
SciChart.Charting.dll!SciChart.Charting.Numerics.TickProviders.TimeSpanTickProviderBase.c5b456a75ec2eca07ab2f0cf38c30f4f2(SciChart.Data.Model.IRange cb7f8a302c4d43c2cfce28a7f59c09882, SciChart.Charting.Model.IAxisDelta<System.TimeSpan> cf1435e1ac3c185934e905ec126bcd3fa)   
SciChart.Charting.dll!SciChart.Charting.Numerics.TickProviders.TimeSpanTickProviderBase.GetMajorTicks(SciChart.Charting.Visuals.Axes.IAxisParams axis)   
SciChart.Charting.dll!SciChart.Charting.Numerics.TickProviders.TickProvider<System.IComparable>.caf851e93289795305ee933ce4bbca448(SciChart.Charting.Visuals.Axes.IAxisParams c050e7b647895decc0313c2786c4fc396)  
SciChart.Charting.dll!SciChart.Charting.Visuals.Axes.AxisCore.CalculateTicks()   
SciChart.Charting.dll!SciChart.Charting.Visuals.Axes.AxisBase.OnDraw(SciChart.Drawing.Common.IRenderContext2D renderContext, SciChart.Charting.Visuals.RenderableSeries.IRenderPassData renderPassData)  
SciChart.Charting.dll!A.c68de5aaca24f8f81d98aed29fac3caff.c6a7d2b5be124728330bbf562594a9bb9(SciChart.Charting.Visuals.ISciChartSurface c17037e8328cd0abc02d2a6957dfa450c, SciChart.Charting.Services.RenderPassInfo c16b8d70d2b6ecad8f9fca7ac3f5177b8, SciChart.Drawing.Common.IRenderContext2D c41db0419b661c8ac05a2aa6a1ea66092)   
SciChart.Charting.dll!A.c68de5aaca24f8f81d98aed29fac3caff.RenderLoop(SciChart.Drawing.Common.IRenderContext2D renderContext)     
SciChart.Charting.dll!SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()  
SciChart.Charting.dll!SciChart.Charting.Visuals.SciChartSurface.c86fb714e67e4ff799a0a0b43ef420019()  
SciChart.Charting.dll!SciChart.Charting.Visuals.SciChartSurface.OnRenderSurfaceDraw(object sender, SciChart.Drawing.Common.DrawEventArgs e)  
SciChart.Drawing.dll!SciChart.Drawing.Common.RenderSurfaceBase.OnDraw()  
SciChart.Drawing.dll!SciChart.Drawing.Common.RenderSurfaceBase.OnRenderTimeElapsed()     
SciChart.Drawing.dll!SciChart.Drawing.Common.RenderSurfaceBase.OnRenderSurfaceBaseLoaded(object sender, System.Windows.RoutedEventArgs e)    
PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs)  
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised)

The CPU spikes and the app never responds. Any thoughts as to why this might happen?

  • Dan Pilat asked 7 years ago
  • last active 7 years ago
0 votes
10k views

I’m adding an annotation to a chart with a DateTime x-axis. Without a label the annotation is successfully added. However, if I specify a label I get an InvalidOperationException when Add() is called. The exception message is “The Type this is a test is not a valid Comparable Type”}:

                var annotation = new VerticalLineAnnotation
                {
                    VerticalAlignment = VerticalAlignment.Stretch,
                    ShowLabel = true,
                    X1 = time.DateTime,
                    Stroke = System.Windows.Media.Brushes.Orange,
                    LabelPlacement = LabelPlacement.TopRight,
                    LabelValue = "this is a test",
                    LabelsOrientation = Orientation.Vertical
                };

                MyChart.Annotations.Add(annotation);

The LabelValue is obviously of type string and non-null and indeed of type IComparable. Any reason I can’t add it?

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

Hi,

Please see the 2 images attached. I would like to reproduce something similar to what’s on the images using scichart ie. being able to select/unselect certain parts of the series by placing a control on certain datapoints (being able to add a checkbox to the surface would be great). What options do I have?

One more question, Is it possible to add a label to LineAnnotations?

Thanks.

0 votes
12k views

Hi,
I’m prototyping an application with two visible data series and an individual Y-axis for each data series. See the enclosed image.
The Stroke color of each data series, the TickTextBrush and the BorderBrush of the y-axis are updated by normal data Binding through the MVVM pattern.
The problem is that I am not able to data bind the Stroke property of the MajorTickLineStyle for the individual Y-axis.
Do You know if there is a workaround for this through data binding?
The project is enclosed.

  • andreasrep asked 7 years ago
  • last active 7 years ago
1 vote
19k views

Hi.

I am evaluating the SciChart control – so far it looks very promising.

I have a FastHeatMapRenderableSeries that is analyzed and a FastLineRenderableSeries line is drawn through the chart.

The user needs to be able to correct the analysis, and this is done by “drawing” in the heatmap.

As far as I could tell, the ChartModifierBase gives med the necessary hooks to track the user’s mouse movements – but I would like to give some visual feedback by changing the cursor, for instance to Cursors.Pen (Cursors from the Microsoft namespace)

Is this possible? I would want to enable drawing when user presses Ctrl, the disable it when user releases Ctrl…

0 votes
0 answers
16k views

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

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

2 votes
11k views

I’ve been trying to get SciChart to work with good performance and as part of my experimentation am trying to see how RenderPriority.Manual works. As far as I can tell, it doesn’t.

I haven’t been able to find much in terms of samples or docs. According to the little documentation here:
https://www.scichart.com/documentation/v4.x/SciChart.Charting~SciChart.Charting.Visuals.RenderPriority.html

It says

Manual — Never redraws automatically. You must manually call
InvalidateElement() or ZoomExtents() on the SciChartSurface in order
to get it to redraw

Now, when I try to call either of those functions on my SciChartSurface, nothing visually happens. I’ve tried other Invalidate methods as well, and still no refresh love.

I’ve attached the small sample application that repro’s the issue.

Please let me know what I’m doing wrong.

Thanks,
Brian

1 vote
7k views

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

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


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

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

and code

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

I have a custom annotation class that I would like to bind the geometries.

<Path.Data>

</Path.Data>

    public GeometryGroup Elements
    {
        get { return _elements; }
        set
        {
            _elements = value;
            InvokePropertyChanged("Elements");
        }
    }

When I create the class in code it only works if Path was set in xaml, doesn’t work if set in code.

            Path p = new Path();
            p.Data = Geometry.Parse("m 0 0 10 0 10 10 0 10 z");             
            GeometryGroup g = new GeometryGroup();
            g.Children.Add(p.RenderedGeometry);
            CustomPathAnnotation cpa = new CustomPathAnnotation()
            {
                Elements = g,
                X1 = .55,
                Y1 = .5, 
                CoordinateMode = AnnotationCoordinateMode.Relative,
                XAxisId = "DefaultAxisId",
                YAxisId = "DefaultAxisId",
                Visibility = Visibility.Visible
            };
            ChartAnnotation.Add(cpa);
0 votes
0 answers
9k views

Hi,

I have been struggling to print a page( xaml UserControl) containing charts and some other informations using PrintDialog. I can print but I have got issues (see the attached images)

  1. The quality of the FastLineRenderableSeries is really low (looks like blurred) even though the StrokeThickness is set to its lowest value which is 1.

  2. The verticalLines do not cover the entire graph (see the image) even though they are drawn correctly before printing. See on the image attached, their labels are well presented on the X axis but they dont extend to the axis.

  3. The graph (FastLineRenderableSeriesis ) looks like is floating, before printing it looks all good (zoomed to extents / covering the whole frame) when printed it’s like there is a space added (all that which is below the blue line) which makes the graph look like it is floating.

I have seen in this forum some other questions and answers on how to print a graph (and only a graph) but not graphs and some other informations on a xaml page which is what I would want.

Here is the Image of the printed paper:
Printed Paper Image

and the image with labels of what’s not Ok:
enter image description here

This is what I do to print:

PrintDialog prnt = new PrintDialog();
    if (prnt.ShowDialog() == true)
    {
        Size pageSize = new Size(prnt.PrintableAreaWidth , prnt.PrintableAreaHeight );
        MyUserControl.Measure(pageSize);
        PrntFrm.Arrange(new Rect(0, 0, pageSize.Width, pageSize.Height));
        prnt.PrintVisual(MyUserControl, "Rapport");
    }

Thanks for helping.

Kilosa M.

0 votes
11k views

Hi!
I have the following xaml code for HorizontalLineAnnotations. I have a viewmodel with simple properties for WasteMaxValue etc.
I don’t get any binding errors. Sometimes everything works as expected when I start up. Sometimes the lines show up but they wont follow when I resize the view (and the graph). Sometimes the lines don’t show up at all.
If I do a very fast “pan” with the mouse so that the graph data moves outside the graph, the lines show up and they follow when I resize the view and the graph. Have you experienced this before? Is it an obvious error?

            <s:SciChartSurface.Annotations>
                <s:HorizontalLineAnnotation HorizontalAlignment="Stretch" 
                    Y1="{Binding WasteMaxValue}" Stroke="Red" StrokeThickness="2">
                </s:HorizontalLineAnnotation>
                <s:HorizontalLineAnnotation HorizontalAlignment="Stretch" 
                    Y1="{Binding WasteMinValue}" Stroke="Red" StrokeThickness="2">
                </s:HorizontalLineAnnotation>
                <s:HorizontalLineAnnotation HorizontalAlignment="Stretch" 
                    Y1="{Binding WarningMaxValue}" Stroke="Yellow" StrokeThickness="2">
                </s:HorizontalLineAnnotation>
                <s:HorizontalLineAnnotation HorizontalAlignment="Stretch" 
                    Y1="{Binding WarningMinValue}" Stroke="Yellow" StrokeThickness="2">
                </s:HorizontalLineAnnotation>
                <s:HorizontalLineAnnotation HorizontalAlignment="Stretch" 
                    Y1="{Binding SetValue}" Stroke="Green" StrokeThickness="2">
                </s:HorizontalLineAnnotation>
        </s:SciChartSurface.Annotations>
1 vote
8k views

Current, I am working an WPF application which using SciChart to draw many charts including a Stacked column chart.
In my case, there are many StackedColumnRenderableSeries in a chart, one of them has less data points then others do and this chart will be rendered incorrectly in a strange way, espcially when I zoomed in and panned it.
You can get source code for my example project from attached files.

Have anybody ever got this issue before?

What is the best way to resolve it?

Thank you for your support!

The last data series has 1 data point
The last data series has no data point
The last data series has no data point (after zooming)

1 vote
11k 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 8 years ago
  • last active 8 years ago
1 vote
9k views

I have just finished my first pass evaluation of the SciChart performance. When drawing a lesser number of points (<100000), SciChart outperforms two other packages I have evaluated. However, when drawing more points (200,000 – 2,000,000), SciChart does not meet the performance of the other packages.

The evaluation involved selecting a different number of lines and number of points per line. The transition to worse performance occurred in the following setups:

Line Count Points/Line Loop Count Total Time (ms)
2 100,000 25 1890
5 100,000 25 4670
2 1,000,000 10 7400
2 10,000,000 10 74000

These setups average out to about 0.37 usec per point. This is where the other packages outperformed SciChart, as their per point times kept improving.

I have tried to follow all of the performance tips I found on your website. I have included the code used to evaluate SciChart and would appreciate any help in improving the results.

Thanks,
Dave

  • Dave Leach asked 8 years ago
  • last active 8 years ago
0 votes
0 answers
7k views

How can i set an interval for milliseconds for a real time graph with Auto scale set as always

0 votes
16k views

Hi

I have to build a financial chart, and the Y label must be always multiplied by 0.25 , as you can see in the image attached.
I didn’t find how to reach this goal in the documentation and in the knowledgebase articles either.

Could you please help me?

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

Hi,
I’ve been trying to use CustomPointMarker to build a custom candle, but I need something like

CurrentRenderPassData.YCoordinateCalculator.GetCoordinate(yValue) to know the coordinates of a certain y value in the screen.

I look up CustomPointMarker documentation, but I haven’t found anything.

could you please help me?

Thank you

  • lorenzo522 asked 8 years ago
  • last active 8 years ago
0 votes
7k views

HI,
I’m new in scichart. I would like to ask you if it’s possible to build a graph with custom candles.
I want to build a footprint graph, something like this:

http://footprintchart.com/wp-content/uploads/2011/06/Shade_Dominant_Side.png

could you tell me if It’s possible to build this kind of graph and suggest me some links with documentation?

Thank you

  • lorenzo522 asked 8 years ago
  • last active 8 years ago
0 votes
11k views

Hello I am curenntly using three REAL Time Charts (FiFo) in my WPF application and I am running into performance issues, which result in UI stuttering. I tried to optimize my performance using your very informative article on performance (Rendering,Stroke,Buffer etc.), but it did not help much, so I wondered if you might be able to help me.

I currently use three graphs and each of them has two different sets of data applied. The size of my FiFo graphs is 100 samples, with a dt= 0.01 (100Hz). I assume the OnNewData event is triggered at that rate as well?

My current code looks like this:

private void OnNewData(object sender, EventArgs e)
    {

        if (TaskManager.tempObject. != null)
        {
            lock (TaskManager.tempObject)
            {
                y0 = Math.Abs(TaskManager.tempObject.LaserPosRel - TaskManager.tempObject.AxisPos);
                y1 = TaskManager.tempObject.AxisPos;
                y2 = TaskManager.tempObject.AxisSpeed;
                y3 = TaskManager.tempObject.AxisAcc;
                y4 = y1;
                y5 = TaskManager.tempObject.LaserPosRel;

            }
        }


        using (sciChartSurface1.SuspendUpdates())
        {
            _series0.Append(t, y0);


        }

        using (sciChartSurface2.SuspendUpdates())
        {

            _series1.Append(t, y1);
            _series2.Append(t, y2);
            _series3.Append(t, y3);


        }

        using (sciChartSurface3.SuspendUpdates())
        {

            _series4.Append(t, y4);
            _series5.Append(t, y5);

        }

        // Increment current time
        t += dt;
    }

I wondered if you have any proposals how to enhance my code, regarding performance?
Would it make a difference if I would Append the series in a new thread? I was not sure of this, since it is stated
in the FAQ that SciChart already uses it’s own threads for rendering.

Any help is appreciated, thanks in advance!

best regards

nils

  • nesphit asked 8 years ago
  • last active 8 years ago
0 votes
7k views

Hi!

I have the following code for a vertical slice modifier

    <s:VerticalSliceModifier Name="sliceModifier"
                                             ReceiveHandledEvents="True"
                                             >
                        <s:VerticalSliceModifier.VerticalLines>
                            <s:VerticalLineAnnotation Style="{StaticResource sliceStyle}"
                                                      X1="{Binding ParentViewModel.SliceModifierPosition, Mode=TwoWay}" />
                        </s:VerticalSliceModifier.VerticalLines>

 </s:VerticalSliceModifier>

This results in a nullreference exception. When I remove the VerticalLines, there is no nullreference exception, also no vertical lines.
As far as I can see ParentViewModel.SliceModifierPosition, does not have a value at the time.

I tried setting the visibility of the slicemodifier to collapsed, but it did not help the exception. Is there any to remove the slicemodifier for the time when X1 is not valid (using MVVM and not binding the slicemodifier itself)?

nullreference exception location
Abt.Controls.SciChart.ChartModifiers.VerticalSliceModifier.TB()
: Abt.Controls.SciChart.ChartModifiers.VerticalSliceModifier.OnAttached()
: Abt.Controls.SciChart.ChartModifiers.ModifierGroup.TB(IChartModifier C)
: Abt.Controls.SciChart.Common.Extensions.EnumerableExtensions. <a href="IEnumerable1 , Action1″>
: Abt.Controls.SciChart.ChartModifiers.ModifierGroup.TB(IEnumerable`1 C)
0 votes
8k views

Hi i am new to SCiChart and i was wondering if there is an option to double click on screen and make it full screen or maybe some sort of un-dock it or open it in new window full screen?
Thx

Showing 151 - 185 of 185 results