Pre loader

Category: WPF

Welcome to the SciChart Forums!

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

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1 vote
3k views

Axis in ChartControl sets the interval.
XAxis

1 vote
3k views

hello.
I added an OverView and scrollbar below the main chart, referring to the CustomOverviewView example.
Graph and scroll functions work without problems.
I want to show the main chart annotations in the OverView.
How can I solve my problem?
have a good day!

0 votes
0 answers
3k views

Hello,

I created a custom chart modifier that moves a vertical line to the position where the user clicks on the scichart surface (I used OnModifierMouseUp to listen to this event), everything works well except the event fires also when the user scrolls or clicks on the scrollbar i defined for the x Axis (I guess because it is part of the surface anyway).

Is there a way to avoid the scrollbar interaction to fire this event? I’d like for it to be fired only when the user clicks directly on the data/surface rather than the scrollbar itself

Thanks a lot

1 vote
3k views

Hi,
I am writing to request some helps about VisibleRange.

I am drawing simple line graphs using NumericAxis and XyDataSeries<long,double>.
I should control axis range so I used XVisibieRange with Int64Range.
But I have an error that It cannot be applied.

How can I control VisibleRange with long type data??

  • CholJin Ko asked 5 months ago
  • last active 5 months ago
1 vote
3k views

Hi,

i have a SciChartSurface with DateTimeAxis as xAxis and a NumericAxis as yAxis.
The fifo capacity is 500 points.

Now what i want to archieve is that when i zoom in that the visible range updates in a matter that its moving with the fifo and not to be frozen and at some point in time see how the data points are discarded.
I already implemented a CustomRubberBandZoomModifier which disables autoranging on Zoom and enables it after Zoom to Extents.

How could i archieve this like shown in the attached image?

Thank you already in advance.

  • Armin Wild asked 5 months ago
  • last active 4 months ago
1 vote
3k views

Hello,

I’m trying to include a legend modifier for a collection of LineRenderableSeriesViewModel, everything works fine except I’m not able to set the series Name to show in the legend, because this view Model doesn’t have a Name property to set so all I get is the series markers (and visibility checkboxes but don’t really need those), does someone know how to show these names?

I tried extending said ViewModel with a custom one adding a Name property but didn’t work.

Thanks a lot,

Marco

1 vote
3k views

Hello,

Normally, if I have a ScichartSurface with a X- and Y-Axis, were both axis AutoRange- properties are set to Always, the surface displays the entire data by adjusting the Visible ranges of the axis after new data has been appended.

This also works if there are multiple Data-Series on the ScichartSurface.

In my case, I have two FastLineRenderableSeries on my Surface. Each of them receiving new data via the Append-function while the x- and y-axis are continuously adjusted automatically to display all the datapoints of both Datasets.

So far so good…

But what would I have to do if I wanted one of the two Datasets to be ignored by the Autorange properties of the x- and y-Axis?

I have already tried to set the X- and YAxisID of one dataset to null, hoping I could make both axis ignore this Dataset while they are adjusting their Visible ranges. However, this only led to error messages.

I could also try to write my own ViewPortManagers and overwrite the OnCalculateNewXRange and OnCalculateNewYRange funvtions, but that seems a little bit excessive.

Is there an easy way to achieve the desired behavior?

Thanks.

1 vote
3k views

I have two SciChartSurfaces

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

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

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

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

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

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

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

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

Thanks
Andrew Milford

1 vote
4k views

Is there any option to hide the axis title of NumericAxis3D in ZxAxisPlane. Want to hide the title highlighted in the attached image.

  • Ammar Khan asked 5 months ago
  • last active 3 months ago
0 votes
0 answers
1k views

Hello!

I have got an exception on databinding an AxisCollection and then sorting a ListBox with charts inside.

Element already has a logical parent. It must be detached from the old parent before it is attached to a new one.
at MS.Internal.Controls.InnerItemCollectionView.AssertPristineModelChild(Object item)
at MS.Internal.Controls.InnerItemCollectionView.Insert(Int32 index, Object item)
at System.Windows.Controls.ItemCollection.Insert(Int32 insertIndex, Object insertItem)
at SciChart.Charting.Visuals.SciChartSurface.slf(IAxis ann, AxisAlignment ano, Boolean anp)
at SciChart.Charting.Visuals.SciChartSurface.slb(IAxis ane, AxisAlignment anf, Boolean ang)
at SciChart.Charting.Visuals.SciChartSurface.ske(IAxis aly)
at SciChart.Core.Extensions.EnumerableExtensions.ForEachDo[T](IEnumerable1 enumerable, Action1 operation)
at SciChart.Charting.Visuals.SciChartSurface.OnApplyTemplate()
at System.Windows.FrameworkElement.ApplyTemplate()
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.WrapPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

I am able to reproduce the issue. Please see the attachment.

I will not write more, since the example is simple.

What can i do to avoid this issue?

Thank you very much!
Paul

1 vote
1k views

Good day,

we are using the VerticalSliceModifier for sorted data and it works very good.

<local:VerticalSliceModifierExt x:Name="SliceModifier">
<s:VerticalSliceModifier.VerticalLines>
    <chartModifier:SnappyVerticalLine x:Name="VerticalLine"
                          ShowLabel="False"
                          X1="0"
                          Y1="0"
                          CoordinateMode="Absolute"
                          IsEditable="True">
    </chartModifier:SnappyVerticalLine>
</s:VerticalSliceModifier.VerticalLines>

Please see the image “Example Vertical Slice Modifier”.

The challange is to have something similar for unsorted data.

One of the issues are multiple intersections. Please see the image “Multiple Intersections” where i would like be able to select what intersections shall be highlighted.

The next challange is the usage of multiple series and synchronization based on a different property (t for time). Please see “Multiple Series” image.

We already have IPointMetadata with X,Y and t to be able to find the data point to highlight.

My question: Is there already some modifier chat can help with this requirements or what would be a clean solution if we need to develop a custom modifier.

Thank you in advance
Paul

1 vote
2k views

Am trying to get the same look and feel of the cursor modifier on both the charts.

  • am not able to get the tool tip to show on the other side.
  • am not able to get the get horizontal lines.
  • P S asked 5 months ago
  • last active 5 months ago
1 vote
3k views

Hello,

i’m trying to build a chart using a Stripe Data series, on the X axis i have a DatetimeAxis while on Y axis i have a Numeric.

I have an observable collection of IRenderableSeriesViewModel, and when i try to add a StripeRenderableSeriesViewModel if the dataseries contains many elements (>2000) it logs this exception below:

Exception thrown: ‘System.InvalidCastException’ in System.Private.CoreLib.dll
SciChartSurface didn’t render, because an exception was thrown:
Message: Invalid cast from ‘Double’ to ‘DateTime’.
Stack Trace: at System.Double.System.IConvertible.ToDateTime(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at SciChart.Charting.Model.DataSeries.StripeDataSeries2.rwx(ResamplingParams gib, StripePointSeries gic)
at SciChart.Charting.Model.DataSeries.StripeDataSeries
2.ToPointSeries(ResamplingParams resamplingParams, ResamplingMode resamplingMode, IPointResamplerFactory factory, IPointSeries lastPointSeries)
at dih.lay(AxisCollection gg, IRenderableSeries gh, RenderPassInfo gi, IPointResamplerFactory gj, Boolean gk, IDataSeries& gl, IndexRange& gm, IPointSeries& gn, Int32& go)
at dih.lax(ISciChartSurface gd, Size ge, Boolean gf)
at dih.RenderLoop(IRenderContext2D renderContext)
at SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()
Exception thrown: ‘System.Threading.SynchronizationLockException’ in SciChart.Drawing.dll
SciChartSurface didn’t render, because an exception was thrown:
Message: Object synchronization method was called from an unsynchronized block of code.
Stack Trace: at System.Threading.Monitor.Exit(Object obj)
at irv.hds(jbq r, SCRTRenderContext s)
at jbv.Dispose()
at SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()

Binding and data i’m pretty sure are ok since with fewer data it works fine

EDIT: i was able to reproduce the issue in the wpf sample project (repo), just replace GanttChartViewModel.cs with the sample one i have attached here and it can be reproduced by navigating to the Gantt chart example

1 vote
1k views

Hello everybody,

Having two FastLineRenderableSeries objects, how can I display them on the same chart, where the X axis represents the time, but the second one with a small time delay on the x-axis (shifted)? Thanks.

1 vote
2k views

Dear SciChart team,

I’ve been using SciChart WPF 2D professional for many years now, but this week I’m having a strange problem on one of my colleague’s new laptop (Lenovo X13). The charts seem frozen.

To check if it’s a problem with my application or something else, I installed SciChart on the laptop and launched the SciChart WPF v7 example (.net framework). Then I found all the charts do not render properly.

I have searched the questions on the forum, and I found this https://www.scichart.com/questions/wpf/zoom-not-working-properly-on-one-single-computer, it seems there was someone had the same issue, but it was posted 10 years ago, so I am not sure does the intel graphics hardware still has this problem now days.

I am asking my colleague to upgrade the graphic adapter’s driver, but if you have any other idea to fix this issue, please also let me know.

Best Regards
Chris

  • Chris Chen asked 6 months ago
  • last active 6 months ago
1 vote
3k views

a

1 vote
7k views

Hello,
I’m currently rewriting a program in .net7 WPF using MVVM as much as possible.

In my MainViewModel:

I read data from a CSV file and transforming it into an ObservableCollection of LineRenderableSeriesViewModel (stored in the « RenderableSeriesViewModels » variable) . Additionally, the Y axes are transformed into ObservableCollection of IAxisViewModel (within the « Yaxes » variable).
Each series corresponds to a LineRenderableSeriesViewModel and each Y axis is represented as a NumericAxisViewModel. The X-axis is a DateTime common to all series and is declared only in XAML.

Within my view’s XAML:

I declare RenderableSeries=”{s:SeriesBinding RenderableSeriesViewModels}” and YAxes=”{s:AxesBinding YAxes}. I’ve defined a legend template to add several elements:
– DataContext=”{Binding RenderableSeries}”
– A checkbox to toggle serie visibility (IsVisible binding).
– A checkbox to toggle Y-axis visibility for the serie (YAxis.Visibility binding).
– A color picker to change the color of a serie, bound to “Stroke”, “YAxis.TickTextBrush”, and “YAxis.BorderBrush”
– A slider for adjusting serie thickness (StrokeThickness binding).

Results:

Each element acts on the graph as expected: RenderableSeries updates and the graph refreshes correctly.

In the MainViewModel, RenderableSeriesViewModels and YAxes are not updated for all elements:
– “IsVisible” and “StrokeThickness” for the concerned series are instantly modified in RenderableSeriesViewModels but “Stroke” is not.
– “YAxes” is not updated.

The code for the LegendTemplate and a screenshot of the resulting legend are in the attachements.

Could you please help me to understand what I do wrong?

0 votes
0 answers
7k views

Several legends are displayed using LegendModifier.

  1. Using ScrollViewer.VerticalScrollBarVisibility=”Auto”, it was possible to move using mouse scrolling, bar grabbing, etc., but it did not work when the border was dragged in a screen touch environment. Is there a way to drag on a touch monitor?

  2. It is being displayed using Orientation=”Horizontal”, but there is a limit to displaying it on one line due to the large number of legends. What document can I refer to if I want to change it to display as multi-line? I think the MVVM method would be best.

  • Lee Ji Un asked 6 months ago
  • last active 6 months ago
0 votes
2k views

My code is as below

for (int i = 0; i < plot.ZData.Length; i++)
{
var xData = plot.XData[i];
var yData = plot.YData[i];
for (int j = 0; j < xData.Length; j++)
{
dataSeries[i, j] = yData[j];
}
}

Here Z values and X values are linear and Y values are in Logarthimic scale.
I have used Z and Y axis as NumericAxis3D and X is LogarithmicNumericAxis3D .

Is something wrong here? Please suggest.

1 vote
4k views

The format of the set DateTimeAxis x-axis is (“yyyy-MM-dd hh:mm:ss”), but when the chart is enlarged, if the range is short, it changes to (“hh:mm:ss”). I want to display year/month/day information as well, even if the range is short. Please answer with the MVVM model.

  • Lee Ji Un asked 6 months ago
  • last active 6 months ago
1 vote
0 answers
5k views

Hi,

We have a waterfall chart where we plot spectrums of XData length 2097153 and of multiple slices. It takes forever to plot this chart. Our application hangs. I tried multiple resampling algorithms as given in the link https://github.com/ABTSoftware/SciChart.Wpf.Examples/blob/SciChart_v6_Release/Sandbox/CustomerExamples/ResamplingOfGridDataSeries3D/ResamplingOfGridDataSeries3D.xaml.cs

But this changes the plot’s appearance completely which makes plot unusable.
Please can you suggest how I can plot this chart with decent performance.

Regards,
Deepashree

1 vote
5k views

Hi,

I want to add a heatmap control (vertical bar) Image attached. This bar should display the energy levels of the waterfall. Basically how the Y axis varies as per the color. How can I achieve this?

1 vote
0 answers
7k views

(Edited to add code blocks)
I am trying to draw 4 series simultaneously on a chart. I have 2 Scatter plot series, a FastLineRenderableSeries (Which I’ll call the trendline) and I have a FastErrorBarsRenderableSeries which I’ll call the uncertainty. The scatter plots always draw.

When I draw the scatter plots and the trendline, everything looks right. As soon as I add any points to the HlcDataSeries in the uncertainty, though, the trendline disappears, and the error bars won’t draw. It’s very strange.
Below is my xaml and code (edited for clarity).


   void SetData(int channels, MyDataSet incomingData){
        var n = incomingData.Count;
        var unc = new List<Point>(n); //Point has x y coords and uncertainty
        double[] xValues = new double[n], yValues = new double[n];
        for (int i = 0; i < n; i++)
        {
            var x = incomingData[i].X.Value; //Incoming data has x y coords 
                                                                  //with uncertainties in each direction
            var y = incomingData[i].Y.Value;
            xValues[i] = x;
            yValues[i] = y;
            var yVal = incomingData[i].Y;
            if (yVal is not { Uncertainty: not null and not 0 }) continue;
            unc.Add(incomingData[i]);
        }
        if (xValues.Any())
            PointData = new XyDataSeries<double>(xValues, yValues);
        var xList = new double[channels];
        var yList = new double[channels];
    if (incomingData.CalibrationCoefficients == null)
    {
            incomingData.Fit(); //Generate coefficients
    }
    for (var i = 0; i < channels; i++)
    {
          xList[i] = i;
          yList[i] = incomingData.GetY(i); //Apply Coefficients
     }
    LineData = new XyDataSeries<double>(xList, yList);
    unc.Add(new Point(1, 0, 100, 50)); //x, x uncertainty, y, y uncertainty
    unc.Add(new Point(10, 0, 100, 50));//Adding bogus data to ensure uncertainty
    unc.Add(new Point(100, 0, 1000, 50));
    unc.Add(new Point(1000, 0, 500, 50));
    unc.Add(new Point(5000, 0, 250, 50));
    if (unc.Any())
    {
        UncertaintyData = new HlcDataSeries<double, double>();
        var hlc = (HlcDataSeries<double, double>)UncertaintyData;
        foreach (var t in unc)
        {
            var uncertainty = Math.Abs(t.Y.Uncertainty);
            var y = t.Y.Value;
            hlc.Append(t.X.Value, y,
                y- uncertainty,
                y+ uncertainty);
        }
    }

}

And my Xaml:


 <s:SciChartSurface MinWidth="200" MinHeight="200" 
                                   Name="ChartSurface" Padding="0"  
                                   Style="{Binding CurrentChartStyle}" >
            <s:SciChartSurface.RenderableSeries>
 <!-- Scatter plots omitted for brevity -->
                <s:FastErrorBarsRenderableSeries DataSeries="{Binding UncertaintyData}" 
                                                 ErrorDirection="YAxis"
                                                 Stroke="Blue"
                                                 StrokeThickness="2"
                                                 LastErrorBarWidth="7"
                                                 DataPointWidthMode="Absolute"
                                                 /> 

                <s:FastLineRenderableSeries x:Name="LineSeries" AntiAliasing="True" Stroke="Gray"
 DataSeries="{Binding LineData}" StrokeThickness="2"/>
            </s:SciChartSurface.RenderableSeries>
 <!-- Axes omitted for brevity --> 
        </s:SciChartSurface>
1 vote
5k views

Hi,

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

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

I am attaching the code of waterfall example here.

1 vote
2k views

Hi,

I’m experiencing a glitch using polar charts with small values.
In the attached example, I tried to create an arc starting at 0.0004, the problem is that up to a certain level of zoom, it works fine, then it start creating corrupted shapes. You can see all stages of the glitch in the picture.

Is this related to small values? I really have to work with small numbers, any workaround?
My client is using an older version, but I tried with mine, 7.0 and I get the same problem.

Thanks

0 votes
0 answers
5k views

Attached sample program based on AnnotationsAreEasy

The graph is on a Tab of a TabControl.
There is a custom Composite Annotation on the left side of the graph – ZoneAnnotation: consisting of a BoxAnnotation and a TextAnnotation.

Click on Chart Tab and the annotation displays correctly first time.
Click on Tab1 then Click on Chart Tab again. Now the box part of the annotation does not get drawn.
If you pan or zoom the chart it magically re-appears!

Click on Tab1 then Chart Tab again and it disappears again.

Cut down code attached is using V6.6 but this still happens on v7.0.2.27161

Is this a bug or something with the way I am defining the ZoneAnnotation?
Thanks

0 votes
5k views

Hello,

I have a SciChartSurface with multiple StackedColumnRenderableSeries. The goal is to create a column style “Stacked Graph”.

The StackedColumnRenderableSeries are created this way:

private StackedColumnRenderableSeries[] m_layers = new StackedColumnRenderableSeries[0];
  -------
    while (num  > m_layers.Length)
              {                
                  StackedColumnRenderableSeries layer = new StackedColumnRenderableSeries()
                  {
                      DataPointWidth = 0.9,                  
                      Fill = new SolidColorBrush(DefaultMainColorOfCurrentSetting),
                      Stroke = Colors.Black,
                      ShowLabel = false  
                  };
  
                      layer.DataSeries = new XyDataSeries<double, double>();
                      layer.DataSeries.AcceptsUnsortedData = true;
  
                  m_sciChartSurface.RenderableSeries.Add(layer);
                 
                  List<StackedColumnRenderableSeries> temp = m_layers.ToList();
                  temp.Add(layer);
                  m_layers = temp.ToArray();
                 
              }
  

Later, they are fed data with this function:

void addBar(double[] layerValues)
          {
  
              using (m_sciChartSurface.SuspendUpdates())
              {   
                  for (int i = 0; i < m_layers.Length; i++)
                  {
                      XyDataSeries<double, double> data = (XyDataSeries<double, double>)m_layers[i].DataSeries;   
                      data.Append(m_currentTimepoint, layerValues[i]);
                  }
              }
  
              m_currentTimepoint++;
          }
  
  private int m_currentTimepoint = 1;
  

If I use this function within the class constructor, everything works as expected (see attached image).

However, sometimes, I receive the error message “”System.ArgumentException” in SciChart.Charting.dll The StackedColumnRenderableSeries type requires that all stacked stacked series with the same StackedGroupId have the same XValues.”

I fail to see the meaning of this message, since, the x-Value is the same for each part of the new column. Its “m_currentTimepoint”.

Additional Information:

This visualization is part of a medical monitoring software we are currently developing. If we use test data to call the addBar-Function (directly from the constructor, for example), the error does not appear. However, if we use data from our medical sensors, it appears. In both cases, the addBar-Function receives valid data (no NaN´s or such things)

The function is not called often, about once every 10 seconds.

Thank you

1 vote
2k views

Hi,

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

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

Kind regards,
Boštjan

1 vote
3k views

Hi, I’m interested in putting WPF controls like buttons, data grids, sliders, etc. inside the chart.
Is that possible?

1 vote
2k views

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

1 vote
0 answers
3k views

When using VisibleRange, I want to prevent the letters 0 and 360 from overlapping. I want to see 0 or only 360. please tell me how

  • HyunHo Lee asked 7 months ago
  • last active 7 months ago
1 vote
2k views

If I plot a SciChart3DSurface using UniformGridDataSeries3D to plot a SolidMesh – what is the maximum number if data points I can plot?

If I plot 16385 on x and 32 on z I get the debug message:

SciChart3DSurface didn’t render, because an exception was thrown:
Message: Grid mesh size exceeds hardware texture size

Is 16K the limit?

I came across this
https://abtsoftware.myjetbrains.com/youtrack/issue/SC3D-326
which seems to indicate maybe larger might be possible?

and I found on this page:
https://www.scichart.com/requirements-for-3d-surface-mesh-charts/#!

The current limit for the size of the 3D Surface Mesh chart is limited by the maximum texture size on your GPU, which in most cases is 40964096 and on some GPUs is larger, up to 16k * 16k.*

Is it possible at runtime to find out what the limit is (if it depends on the users hardware) so I can adapt the data if running on a lower capability platform rather than throwing an exception or displaying a blank graph?

Thanks

1 vote
3k views

Hello, everyone.

I want to add annotations for analyzing 3d charts.
In order to do that, it is necessary to be able to make several marks on the X-axis, Y-axis, and Z-axis, and I would like to know the best practices.

please check the attached picture. It is similar with cursor but it’s fixed.
I found Custom Geometry documents.
https://www.scichart.com/documentation/win/current/webframe.html#Adding%20Cubes%20and%20Custom%20Geometry%20to%20the%20Chart.html
but I am not sure this is for the best.

Thanks,
Kim, JinSeok.

1 vote
5k views

I need to serialize annotations. Not all the chart properties, but just Annotations.

I’ve tried to serialize the AnnotationCollection, as well as a List and neither works.

  • kelias asked 7 months ago
  • last active 7 months ago
1 vote
5k views

Hi SciChart,

We are experiencing a SciChart XPS export issue.

I am using a FlowDocumentPageViewer with a FlowDocument containing SciChart graphs. My goal is to export all pages of the FlowDocument to an XPS file using the XamlRenderSurface to save in vector graphics. However, I’m facing an issue where only the currently selected page exports correctly, while the other pages display empty graphs.

By default, we employ the VisualXcceleratorRenderSurface for all SciChart render surfaces. Before exporting, I programmatically switch them to XamlRenderSurface to save in vector graphics. This approach works well when all the graphs have been rendered on-screen at least once with the new surface type before exporting. However, if a graph hasn’t been rendered on-screen before exporting, it appears empty, and only the graphs from the selected page export correctly. You can find code snippets below.

XAML code:

<s:SciChartSurface
    x:Name="PART_Surface"
    ...
    RenderSurface="{TemplateBinding RenderType, Converter={StaticResource RenderTypeConverter}}"
    ...

Converter:

public class RenderTypeConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        // Set render settings
        return (RenderType)value switch
        {
            RenderType.DirectX => new VisualXcceleratorRenderSurface(),
            RenderType.HighQuality => new HighQualityRenderSurface(),
            RenderType.HighSpeed => new HighSpeedRenderSurface(),
            RenderType.Vector => new XamlRenderSurface(),
            _ => new HighSpeedRenderSurface(),
        };
    }
    ...
}

Export:

private void ExportVector(string fullPath)
{
    // Sets the RenderType to Vector for all surfaces
    // This invokes RenderTypeConverter to set the RenderSurface to XamlRenderSurface
    // Since they are bound in the XAML code
    SetAxesSurfacesRenderToVector();

    XPS_Export_AllPagesOfFlowDocument(fullPath);

    // DirectX is always the default for all surfaces that we use
    ResetAxesSurfacesToDirectX();
}
private void XPS_Export_AllPagesOfFlowDocument(string fullPath)
{
    using (var package = Package.Open(fullPath, FileMode.Create))
    {
        using (var xpsDocument = new XpsDocument(package, CompressionOption.Maximum))
        {
            var xpsSerializationManager = new XpsSerializationManager(new XpsPackagingPolicy(xpsDocument), false);
            var documentPaginator = ((IDocumentPaginatorSource)FlowDocument)?.DocumentPaginator;
            xpsSerializationManager.SaveAsXaml(documentPaginator);

            xpsDocument.Close();
        }
    }
}

The binding and the converter works for all offscreen elements, yet the they won’t take effect until rendered on screen at least once.
I have to select each page manually, after setting all graphs to use XamlRenderSurface, so each would be rendered on screen at least once before the export.

My question is: How can I export XamlRenderSurfaces that are off-screen and haven’t been rendered on-screen before the export process?

You can find an image below showcasing the problem.

Thank you and looking forward to your reply!

Best Regards,
Kaloyan Krastev

1 vote
5k views

I tried to create an WPF application that used a graph with LineRenderableSeriesViewModel and XYDataSeries to display real-time data. Cursor inspection was added to the chart as shown in the picture to make it easier to view the data. After some time I found out that when inspecting the cursor, if you move it quickly inside the chart, the CPU load increases several times.

Is there any elegant way to preserve performance with such manipulations?

My computer has a pretty good build but on weaker computers it causes some problems.

  • Processor: AMD Ryzen 7 5825U with Radeon Graphics 2.00 GHz
  • RAM: 16.0 GB (14.8 GB usable)
  • System: Windows 11 Pro (21H2)
1 vote
5k views

In this thread

running-in-linux

it mentions

SciChart (as of July 2023) currently targets the following platforms
WPF, with c# .net or netCore or .NET 6/7

I cannot find libraries for .NET7!
When I try to use netcoreapp3.1 libraries or net452 libraries I get a runtime error that it is unable to open the dll. Or is something else going wrong? I can see the relevant dll’s are copied to the output folder.

1 vote
5k views

Hello again,

I would like to ask if there is a way to give a border (stroke and thickness) to horizontal and vertical line annotations.

I assume it has something to do with setting the WPF-style of the annotation element, but I’m running into a lot of errors while experimenting with this approach.

Is there an easy-to-understand example around?

Thank you verry much.

1 vote
5k views

Hello

In Tutorial 06b – Realtime Updates, I want change the <s:SciChartSurface.XAxis> from <s:NumericAxis/> to <s:DateTimeAxis/> . I have tried a lot, but it still doesn’t work.

Could you please help me to do this work.

Thank you very much.

  • Zhi Zhang asked 8 months ago
  • last active 8 months ago
1 vote
5k views

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

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

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

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

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

  • Ben Green asked 8 months ago
  • last active 8 months ago
1 vote
0 answers
7k 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
5k views

On graphs with many axes it can often be difficult to read as the tics don’t line up with grid-lines.

What I would like to try is having a fixed number of grid lines (either a set number or based on the size of the graph) and then having all axis ticks aligned with the grid. To make the ticks human friendly I would then want to slightly zoom out each axis so that tics become nice numbers.

I am imagining it would also need to slightly adjust the zoom levels each time user interactions interact with the graph, i.e. if the user was to use a rubberband modifier to zoom in, I would expect I would need to hook in somehow to zoom out very slightly to get nice numbers on the tics, as they can no longer float about to nice values.

Is there any easy way I could experiment with something like this.

  • Hugoagogo asked 8 months ago
  • last active 6 months ago
0 votes
7k views

Setting VisibleRange in xaml or in code behind does not seem to work. It always defaults to (0.1, 100)

 <s:SciChartSurface x:Name="positiveScaleChart"
                    Loaded="OnLogarithmicAxisViewLoaded">

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

     <s:SciChartSurface.XAxis>
         <s:NumericAxis TextFormatting="0"
                        VisibleRange="0, 100"
                        AutoRange="Never" />
     </s:SciChartSurface.XAxis>

     <s:SciChartSurface.YAxis>
         <s:LogarithmicNumericAxis AxisAlignment="Left"
                                   TextFormatting="0"
                                   AutoRange="Never"
                                   VisibleRange="-1, 10000">

         </s:LogarithmicNumericAxis>
     </s:SciChartSurface.YAxis>
 </s:SciChartSurface>



 public partial class LogarithmicAxisView : UserControl
 {
     public LogarithmicAxisView()
     {
         InitializeComponent();
     }

     private void OnLogarithmicAxisViewLoaded(object sender, RoutedEventArgs e)
     {
         var posDataSeries0 = new XyDataSeries<double, double>();

         var data1 = new DoubleSeries();

         for (int i = 0; i < 100; ++i)
         {
             data1.Add(new XYPoint() { X = i, Y = Math.Pow(i, 3) });
         }

         posDataSeries0.Append(data1.XData, data1.YData);
         positiveScaleChart.RenderableSeries[0].DataSeries = posDataSeries0;
         positiveScaleChart.YAxis.VisibleRange = new DoubleRange(-1, 10000);
     }
 }
  • Ben Green asked 8 months ago
  • last active 8 months ago
1 vote
7k views

We’re currently using the DataPointSelectionModifier which works great, however, we need some slight tweaks to it’s behaviour

  • The ability to disable marquee selection on demand (whilst still being able to multi select points by clicking each point)
  • Swap the Ctrl/Shift key combos

I was wondering if the source for the DataPointSelectionModifier could be made available for people to adapt to suit their needs? else it means trying to create it from scratch.

Perhaps you could post it in an area that only customers could access?

  • Ben Green asked 8 months ago
  • last active 8 months ago
0 votes
5k views

Hello,

I’m relatively new to SciChart and I’m facing a challenge with customizing the appearance of a dynamically created series that is bound to a SciChartSurface using SeriesBinding in WPF.

I have a VerticalSliceModifier in my XAML where I define a VerticalLineAnnotation. My series is created in code as a MountainRenderableSeriesViewModel and then bound to the chart using SeriesBinding. Here’s the relevant code snippets:

<s:SciChartSurface
    Grid.Row="1"
    Background="Transparent"
    BorderThickness="0"
    RenderableSeries="{s:SeriesBinding Series}"
    Annotations="{s:AnnotationsBinding Annotations}">

    <s:VerticalSliceModifier ShowTooltipOn="Never" Foreground="White" Name="sliceModifier">
        <s:VerticalSliceModifier.VerticalLines>
            <s:VerticalLineAnnotation X1="{Binding Number}" Style="{StaticResource sliceStyle}" />
        </s:VerticalSliceModifier.VerticalLines>
    </s:VerticalSliceModifier>

</s:SciChartSurface>


public class MountainRenderableSeriesViewModel
{
    public DataSeriesViewModel<double, double> DataSeries { get; set; }
    public DataTemplate RolloverMarkerTemplate { get; set; }
    // Other properties...

    public MountainRenderableSeriesViewModel()
    {
        // Initialize your DataSeries and other properties

        // Set the RolloverMarkerTemplate for this series
        RolloverMarkerTemplate = Application.Current.Resources["CustomRolloverMarkerTemplate"] as DataTemplate;
    }
}

My challenge is that I want to customize the RolloverMarkerTemplate for this dynamically created series. Most of the examples I’ve found show how to use RolloverMarkerTemplate with a statically defined series, but I cannot figure out how to assign it when the series is created in a ViewModel and bound to the chart using SeriesBinding.

Any guidance or code examples on how to achieve this customization would be greatly appreciated.

1 vote
7k views

Hello.

I have a XYRenderableDataSeries with point markers with a fill color.

I also have a DataPointSelectionModifier which allows me to select clusters up to 5 from the series.

I want that when I select a cluster from the series, the points selected from the series should be colored for that specific cluster. i.e. all the cluster colors should be different. Also, when I select another cluster, the colors in the points selected from 1st cluster or other clusters should be preserved.

Here’s the XAML code :

<s:XyScatterRenderableSeries DataSeries="{Binding ScatterData}">
                    <s:XyScatterRenderableSeries.PointMarker>
                        <s:EllipsePointMarker  Width="3" Height="3" Fill="#AAFFFFFF" Stroke="SteelBlue" StrokeThickness="2"/>
                    </s:XyScatterRenderableSeries.PointMarker>
                    <s:XyScatterRenderableSeries.SelectedPointMarker>
                        <s:EllipsePointMarker Fill="{Binding ClusterColor, Mode=TwoWay}"
                                              Width="12"
                                              Height="12" />
                    </s:XyScatterRenderableSeries.SelectedPointMarker>
                </s:XyScatterRenderableSeries>

<s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:DataPointSelectionModifier Name="PointMarkersSelectionModifier"
                                                  IsEnabled="{Binding IsManualClustering}"
                                                  SelectionChanged="PointMarkersSelectionModifier_SelectionChanged"
                                                  SelectionFill="#B1B5B2B2" 
                                                  SelectionStroke="#009E9C9C" />
                    <s:MouseWheelZoomModifier IsEnabled="True" />
                    <s:RubberBandXyZoomModifier IsEnabled="False" />
                </s:ModifierGroup>
            </s:SciChartSurface.ChartModifier>

I tried to find examples but could not find any. Please let me know if we can reach a solution to this in some way.

Thank you.

  • Ammar Khan asked 8 months ago
  • last active 8 months ago
1 vote
7k views

We are using the VerticalLineAnnotation and want to change it’s location (X1 property) in the viewmodel.

Annotations are bound like this:

<s:SciChartSurface
           ...
           Annotations="{s:AnnotationsBinding Annotations}"

to the property:

public ObservableCollection<IAnnotationViewModel> Annotations { get; private set; }

The collection contains this association:

this.nowAnnotation = new VerticalLineAnnotationViewModelEx()
        {
            X1 = TimeSpan.FromSeconds(0),
            StyleKey = "NowAnnotationStyle"
        };

To change the location we change the value of X1:

nowAnnotation.X1 = value;

Calling that didn’t have a direct effect on the UI unless the user does any action which redraws the chart.

We created a style which sets an attached property to pass the VerticalLineAnnotation to the view model, this works fine.

<Style TargetType="s:VerticalLineAnnotation" x:Key="NowAnnotationStyle">
                    <Setter Property="viewModels:VerticalLineAnnotationViewModelEx.PassIAnnotation" Value="True" />
                </Style>

And we added a Refresh method to VerticalLineAnnotationViewModelEx and call it after setting X1:

nowAnnotation.X1 = value;
nowAnnotation.Refresh();

The first implementation of the Refresh method we did was:

public void Refresh()
    {
        this.Annotation.Refresh();
    }

From the documentation this should redraw the annotation without redrawing the whole chart, but it had no effect.
https://www.scichart.com/documentation/win/current/webframe.html#SciChart.Charting~SciChart.Charting.Visuals.Annotations.AnnotationBase~Refresh.html

It only started working after changing to this:

public void Refresh()
    {
        this.Annotation.ParentSurface.InvalidateElement();
    }

Is there a better way to do it, shouldn’t the first implementation work?

The complete code of VerticalLineAnnotationViewModelEx

public class VerticalLineAnnotationViewModelEx : VerticalLineAnnotationViewModel
{
    public static readonly DependencyProperty PassIAnnotationProperty = DependencyProperty.RegisterAttached(
        "PassIAnnotation", typeof(bool), typeof(VerticalLineAnnotationViewModelEx),
        new PropertyMetadata(default(bool), OnPassIAnnotationChanged));

    public IAnnotation Annotation { get; private set; }

    private static void OnPassIAnnotationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        var verticalLineAnnotation = (VerticalLineAnnotation)d;
        ((VerticalLineAnnotationViewModelEx)verticalLineAnnotation.DataContext).Annotation = (IAnnotation)d;
    }

    public static void SetPassIAnnotation(DependencyObject element, bool value)
    {
        element.SetValue(PassIAnnotationProperty, value);
    }

    public static bool GetPassIAnnotation(DependencyObject element)
    {
        return (bool)element.GetValue(PassIAnnotationProperty);
    }

    public void Refresh()
    {
        //this.Annotation?.Refresh();
        this.Annotation?.ParentSurface.InvalidateElement();
    }
}
1 vote
7k views

Hi~
How to create dotted line cursor like a dashed line curve?
Thanks.

  • kim2 kim asked 8 months ago
  • last active 8 months ago
0 votes
7k views

I have created a demo app with the relevant code.

I have a tab control with 2 tabs, each one with a version of the SciChart surface showing multiple graphs stacked on top of each other.
The first (LAT) uses the standard WPF ListBox with each item contains a surface.
The second (ECG) uses a vertically stacked YAxis (from the customer examples).

Scenario
Select the second tab (ECG).
Press the Create button to create 50 waveforms.
(note – only a single graph is created)
Select the first tab, then select the 2nd tab.
(all 50 graphs are created)

HELP
I am unable to upload the .zip file (with the demo) or an images.
I select the file – but it does not upload

1 vote
7k views

Code changes :
– Grab the SciChart_ScatterChart example

 <s:SciChartSurface Name="sciChart"
                Grid.Column="1"
                Padding="0"
                BorderThickness="0">

 <s:SciChartSurface.RenderableSeries>
     <s:XyScatterRenderableSeries x:Name="scatterRenderSeries0"
                                  Opacity="0.67">
         <s:XyScatterRenderableSeries.PointMarker>
             <s:EllipsePointMarker Width="14"
                                   Height="14"
                                   Fill="{StaticResource PointMarkerFillColor}"
                                   StrokeThickness="0" />
         </s:XyScatterRenderableSeries.PointMarker>
     </s:XyScatterRenderableSeries>
 </s:SciChartSurface.RenderableSeries>

 <s:SciChartSurface.XAxis>
     <s:NumericAxis DrawMajorBands="True"
                    GrowBy="0.1, 0.1"
                    VisibleRangeLimit="0, 0"
                    VisibleRangeLimitMode="Min" />
 </s:SciChartSurface.XAxis>

 <s:SciChartSurface.YAxis>
     <s:NumericAxis DrawMajorBands="True"
                    GrowBy="0.1, 0.1"
                    VisibleRangeLimit="0, 0"
                    VisibleRangeLimitMode="Min" />
 </s:SciChartSurface.YAxis>

 <s:SciChartSurface.ChartModifier>
     <s:ModifierGroup>
         <s:ZoomPanModifier ClipModeX="ClipAtMin" />
         <s:MouseWheelZoomModifier />
     </s:ModifierGroup>
 </s:SciChartSurface.ChartModifier>

Repro steps :

  • Zoom out using the wheel
  • Try to pan
  • Notice that it appears to apply an unwanted zoomToExtents operation

Can I also ask why there is still no ClipModeY for the ZoomPanModifier? there are a few posts relating to this with workarounds, but none of them seem to work as far as I can tell without weird side affects.

  • Ben Green asked 8 months ago
  • last active 8 months ago
Showing 51 - 100 of 3k results