Pre loader

PointMarkersSelection for Realtime data fixed X and Y data with changing Y values.

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
0

Hello Team,

I am using Sci 2D chart(version 8.9.0.28766) in c# .net WPF MVVM. I have 3 Fastline series with more than 16400 points changing every 2 sec with fixed x and y axis. I am following the SciChart_PointMarkersSelection example to use point markers.
Issue I am facing,

  1. the point disappears as the data changes. I want the points to be persistent and moving with the new y values.
  2. I want to add the fixed x values and changing y values of the selected points in a data grid
  3. The user should be able to change the x values in the data grid and the point should move accordingly.
  4. I want to get the data back to the observable collection in the View model.

The example is does not have realtime data changing every 2 min and the point marker x and y values are displayed on the UI as List.

Is this the right option to use PointMarkersSelection modifier? If not please suggest any alternative method to achieve the above goals.

I was thinking of putting the selected points in to a scatter chart and add it to the same IRenderableSeriesViewModel and update the corresponding y values as the new data comes in.
But my problem is, how should i get the nearest actual point in the data set and send it from UI to the view model to populated the scatter chat?

Version
8.9.0.28766
Images
  • You must to post comments
0
0

Hi Priyanka,

Thank you for contacting us.
I am sorry for the delayed response.

Following your questions in order:
1) Unfortunately, the issue is not clear enough. Could you please share a short video showing the described behavior?

2) We have a “CustomModifiersSandbox” example project published in our “SciChart.Wpf.Examples” GitHub repository:
SciChart.Wpf.Examples_Sandbox_CustomerExamples_CustomModifiersSandbox at SciChart_v8_Dev · ABTSoftware_SciChart.Wpf.Examples
featuring the custom SimpleDataPointEditModifier which allows to drag data points in Y direction:
SciChart.Wpf.Examples_Sandbox_CustomerExamples_CustomModifiersSandbox_SimpleDataPointEditModifier.cs at SciChart_v8_Dev · ABTSoftware_SciChart.Wpf.Examples
Please try it out and let us know if it’s what you are looking for.

3) Also not clear enough. We would appreciate a video or mockup showing the desired behavior.

4) Again, please explain this in more details so we could provide you with a proper solution.

Kind regards,
Lex S., MSEE
SciChart Technical Support Engineer

  • You must to post comments
0
0

Hello Lex,
Thank you for the reply.
I have not yet seen the example you have mentioned. I will have a look and get back to you on that.

I tried attaching the video but was unable to attach it evenafter ziping due to the size limit. So I am sending screen shots.
What you see in the photos is achived by using Behaviors(at the end there is the code for your reference) and scatter chart. I am programatically maintaining the list of selected points (using HitTestInfo) , adding it to the scatter chart and updating the y values as the new data of line chart comes in.

The selected points are added to the datagird on the right side of the screen. It displays the selected X value followed by changing Y values. The user can type and update the X value in the datagrid and click on update button to move the point and get relevant Y values in the grid.

I was hoping for a more simple stright forward way of doing it. As I have to add more details like finding the delta of first x value and second x value similarlly delta of first Y value and second Y and so on. I hope my requirement is clear this time.

Regards,
Priyanka Asawa

public static class SciChartClickBehavior
{
public static readonly DependencyProperty MouseLeftButtonUpCommandProperty =
DependencyProperty.RegisterAttached(
“MouseLeftButtonUpCommand”,
typeof(ICommand),
typeof(SciChartClickBehavior),
new PropertyMetadata(null, OnMouseLeftButtonUpCommandChanged));

public static void SetMouseLeftButtonUpCommand(DependencyObject obj, ICommand value)
=> obj.SetValue(MouseLeftButtonUpCommandProperty, value);

public static ICommand GetMouseLeftButtonUpCommand(DependencyObject obj)
=> (ICommand)obj.GetValue(MouseLeftButtonUpCommandProperty);

private static void OnMouseLeftButtonUpCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is SciChartSurface sciChart)
{
sciChart.MouseLeftButtonUp -= OnMouseLeftButtonUp;
if (e.NewValue is ICommand)
sciChart.MouseLeftButtonUp += OnMouseLeftButtonUp;
}
}

private static void OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (sender is SciChartSurface sciChart)
{
var command = GetMouseLeftButtonUpCommand(sciChart);
if (command != null && command.CanExecute(e))
command.Execute(e);
}
}
}

Attachments
  • You must to post comments
0
0

Hello Priyanka,

Thank you for the clarification.
I’m sorry for such a delayed response.

We discussed your requirements.
By default, SciChart expects the DataSeries to be sorted in the X-direction. Setting the AcceptsUnsortedData property to “true” for the DataSeries will allow you to edit both X and Y values. However, it will decrease the overall chart performance.
Please see the following article for more information:
SciChart WPF Documentation – Data Performance Tips _ WPF Chart Documentation

As for saving the modified DataSeries, this will require further investigation from our side.
Could you please prepare a small example project reproducing what you’ve tried so far (it can contain a simplified DataSeries – just with a few data points) and share it with us for further analysis?
You can also submit it as a support request if you don’t wish to share the code in public.
To do so you can either fill in the Contact Us for on our website:
Contact Us For Support _ We’re Here To Help _ SciChart

Or click the Submit a Ticket button at our Support portal:
Submit a ticket _ SciChart Technical Support

Kind regards,
Lex S., MSEE
SciChart Technical Support Engineer

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.