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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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
    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.