Pre loader

not able to bind Observablecollection of XYdataseries to sci chart

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

I have a observable collection of Dataseries.XYDataSeries<double,double> and i want to bind this collection to Scichart
surface data series
in one of your Example i find that observable collection bind with Atteached property so i have create a AP for that
but when i bind this property with chart it not bind data with scichart

                    <s:SciChartSurface.RenderableSeries>
                        <s:FastLineRenderableSeries   AntiAliasing="False" 
                                                    ResamplingMode="None"
                                                    Stroke="{Binding Stroke,Mode=OneWay}">

                            <s:FastLineRenderableSeries.RolloverMarkerTemplate>
                                <ControlTemplate>
                                    <Ellipse Width="7"
                                             Height="7"
                                             Fill="White" />
                                </ControlTemplate>
                            </s:FastLineRenderableSeries.RolloverMarkerTemplate>
                        </s:FastLineRenderableSeries>

                       </s:SciChartSurface.RenderableSeries>

Attache property code

public static readonly DependencyProperty AllowOnlyStringProperty =
DependencyProperty.RegisterAttached(“AllowOnlyString”, typeof(ObservableCollection<IXyDataSeries<double, double>>), typeof(TextblockExtension), new PropertyMetadata(default(ObservableCollection<IXyDataSeries<double, double>>), AllowOnlyString));

    private static void AllowOnlyString(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {

        var attachedSurface = d as SciChartSurface;
        if (attachedSurface == null) return;

        var sourceItems = e.NewValue as ObservableCollection<IXyDataSeries<double, double>>;
        if (sourceItems == null)
        {

            return;
        }

    }
Version
4.5
Images
  • You must to post comments
1
0

Hi Rahul

Are you aware of our SeriesBinding API?

We have a built in MVVM API to allow binding from SciChartSurface.RenderableSeries to an ObservableCollection of ViewModels.

Many documentation pages above + examples.

Best regards,
Andrew

  • You must to post comments
0
0

Hi Andrew,

                     Thanks for reply and same also working, but how can i given Dataseries name in this collection just like same property available in FastLineRenderableSeries 
  • Andrew Burnett-Thompson
    I’m sorry, I really don’t know what you mean, and what you want to achieve. Can you rephrase?
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies