SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

2 votes
89 views

Hello,

This is my data structure which needs to be plotted using XyScatterRenderableSeries:

public class Measurement
    {
        public Color Color { get; set; }
        public double X { get; set; }
        public double Y { get; set; }
    }

I need to plot a list of measurements. It can be done in one series but each point color needs to be read from measurement data. To achieve that I’ve used a custom PaletteProvider and the result is satisfactory:

single series

It looks good but there is a huge problem with a performance. If I try to pan, zoom etc. the application horribly slows down.
Also I’ve tried to group measurements by Color and then plot a couple of series with specified color but the result is the same.

I am attaching a simple application which shows the problem.
Hope anyone can help me.

Best regards,
Darek

0 votes
61 views

I have 2 series of data in my chart like this:

<s3D:SciChart3DSurface.RenderableSeries>

</s3D:SciChart3DSurface.RenderableSeries>

My question is, how can I bind multiple series to the RenderableSeries of the SciChartSurface instead, because that requires an ObservableCollection , which is not the same as the XyzDataSeries3D the series are being bound to.

0 votes
182 views

I try to add data series and have them rendered on a chart surface. The surface and entire chart library is wrapped in an mvvm-based api. The sci chart control and wrapping library are rendered on a document panel. I add new data series via the viewmodel and here is where I have some unexpected behavior:

a) When being on a different document panel, meaning the chart control is NOT visible, and when I add a new data series via view model and then view the document panel that hosts the sci chart control, no chart series are rendered on the chart but I do see the correct legend data (such as chart series name, color, stroke thickness). Please see below screen shot “Capture1.jpg” .

b) When I make the sci chart control visible by viewing the document panel that hosts the sci chart control and then via a button and command add the very same data series via my chart control’s view model the charts are correctly rendered. Please see “Capture2.jpg”.

My question is why is that the case? I basically expose a method in my chart library view model that lets me add data and if I invoke that methods while being on a document panel that does not host the chart control the added data series is not rendered on the chart. But strangely the correct chart legend data are displayed and also the chart control itself is correctly rendered. No problems when the hosting document panel is active and the very same method is invoked.

Basically what I currently observe is that the data series are not rendered at all as long as the chart control is not “in view” or the hosting document panel is not selected. I am sure programmatically all references and bindings are correct.

I have spend many hours debugging this issue and do not seem to find an answer. Any pointers?

Thanks a lot,
Matt

Edit:

Here is how I bind the content control to the view model of my sci chart charting library (user control)

<ContentControl Grid.Row="1" Content="{Binding ChartControl, Mode=OneWay}" />

…and the view model is instantiated in the hosting view model constructor:

public MainWindowViewModel()
{
   ChartControl = new SciChartControlViewModel();

    ExitApplicationCommand = new RelayCommand(OnExitApplicationCommand);
    LoadDataSeriesFromFilesCommand = new RelayCommand(OnLoadDataSeriesFromFilesCommand);
    RefreshDataSeriesFromFilesCommand = new RelayCommand(OnRefreshDataSeriesFromFilesCommand);


    Test();

}

…Test() performs the following action:

private void Test()
{
    var quotes = new List<Quote>();
    List<DateTime> timeStamps = new List<DateTime>();
    List<double> values = new List<double>();
    List<SciChartAnnotation> annotations = new List<SciChartAnnotation>();
    Random rand = new Random((int)DateTime.Now.Ticks);
    DateTime currentDt = DateTime.Now;
    double currentValue = 0;

    for (int index = 0; index <= 50000; index++)
    {
        var randomValue = rand.NextDouble();
        currentDt = currentDt + TimeSpan.FromSeconds(randomValue);
        currentValue = currentValue + randomValue - 0.5;

        if (index % 1000 == 0)
        {
            var buySell = rand.NextDouble() > 0.5 ? SciChartAnnotationDirection.Buy : SciChartAnnotationDirection.Sell;
            annotations.Add(new SciChartAnnotation(buySell, currentDt, currentValue, "Index:" + index));
        }

        timeStamps.Add(currentDt);
        values.Add(currentValue);

        quotes.Add(new Quote(){DataProviderId = "Provider1", SymbolId = "Symbol1", QuoteType = QuoteType.BidAsk, CompressionType = TimeCompressionType.NoCompression, CompressionUnits = 0, TimeStamp = currentDt, Bid = currentValue, Ask= currentValue + 0.05, });

    }

    ChartControl.AddDataSet("Pane1", "0.00000", quotes, annotations);
    //ChartControl.AddDataSet("MattSeries", ChartType.Scatter, 1, "0.00000", timeStamps, values);

}

…it basically tries to render chart series and annotations.

Strangely, as mentioned before, the series legends render correctly and the annotations also all render correctly but the chart series do not! Could this be a bug?

  • bbmat asked 4 months ago
  • last active 2 months ago
1 vote
439 views

Hello,

Out team have several question about the framework:

  1. Is there a way to make SCIChartSurfaceView background transparent so that the user could see underlying views? We tried using background brush of clear color on SCIChartSurface and making SCIChartSurfaceView backgroundColor transparent but no avail.

  2. Is it possible to add translate/rotate/scale animation to markers/annotations from code?

  3. When using gradient brush with mountain renderable series we found a strange visual artifact (“Gradient artifact” image). Is there a way to fix it?

Best regards,
Vasiliy

0 votes
3k views

Hello,

I wonder what the most efficient way is to completely reset (clean up) a SciChartGroup? I add all kinds of panes, add data series, add renderable series on different panes. Now, with a single call I like to reset the SciChartSurface to its original state (empty). I want to have all panes removed, as well as references the sciChartGroup may hold to panes, and references the panes hold to different renderable series and data series. I tried to clear ChartPaneViewModels, an observable collection that holds objects of type BaseChartPaneViewModel (which in turn implements IChildPane and ViewModelBase) but that did not have any effect. My SciChartGroup binds via ItemsSource to ChartPaneViewModels

What is your recommendation how to best reset the whole sciChartGroup?

Thanks,
Matt

  • bbmat asked 3 years ago
  • last active 3 years ago
1 vote
4k views

Hi,

I have a chart showing data sets composed of multiple renderable series. Each data set is displayed using one FastLineRenderableSeries and three XyScatterRenderableSeries. All four series show in the legend for each data set, but I would only like to show the FastLineRenderableSeries in the legend for each data set. How can I do this?

I’ve seen the legendModifier.GetLegendDataFor property, but that can only be set to show options from this enum

public enum SourceMode
{
    AllSeries = 0,
    AllVisibleSeries = 1,
    SelectedSeries = 2,
    UnselectedSeries = 3,
}

which aren’t what I need. Some kind of flag on the renderable series saying whether they should be shown in the legend, or some way to specify the items source for the legend would be good.

Thanks!

1 vote
4k views

How can I only show Legends when the corresponding RenederableSeries is visible.
If the corresponding RenderableSeries is not visible then that Legend shouldn’t be shown.
Keep in mind my users will be able to hide and show RenderableSeries during runtime.

My xaml code is:

                                            <s:LegendModifier x:Name="legendModifier" ShowVisibilityCheckboxes="False" Orientation="Vertical" ShowLegend="{Binding ParentViewModel.ShowLegends, Mode=TwoWay}" Margin="10" />
                                        <s:SeriesSelectionModifier>
                                            <s:SeriesSelectionModifier.SelectedSeriesStyle>
                                                <Style TargetType="s:BaseRenderableSeries">
                                                    <Setter Property="StrokeThickness" Value="3"/>
                                                </Style>
                                            </s:SeriesSelectionModifier.SelectedSeriesStyle>
                                        </s:SeriesSelectionModifier>
0 votes
0 answers
4k views

In the chart, I may need programmally add one RenderableSeries, and add data into its dataseries. But how to fire the ‘OnPropertyChangeEvent’ programmaly for the lively added RenderableSeries?

In the example, a binding between dataseries in the view and a property in the model is created manually. Then we change the data and fire the ‘OnPropertyChangeEvent’ event in the model. How to achieve this affect programmally?

best regards
Chunxi

  • chunxi asked 3 years ago
  • last active 3 years ago
Showing 8 results
This template supports the sidebar's widgets. Add one or use Full Width layout.