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;
}
}
- Rahul asked 7 years ago
- You must login to post comments
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
- Rahul answered 7 years ago
-
I’m sorry, I really don’t know what you mean, and what you want to achieve. Can you rephrase?
- You must login to post comments
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
- Andrew Burnett-Thompson answered 7 years ago
- You must login to post comments
Please login first to submit.