Hello,
I’m relatively new to SciChart and I’m facing a challenge with customizing the appearance of a dynamically created series that is bound to a SciChartSurface using SeriesBinding in WPF.
I have a VerticalSliceModifier in my XAML where I define a VerticalLineAnnotation. My series is created in code as a MountainRenderableSeriesViewModel and then bound to the chart using SeriesBinding. Here’s the relevant code snippets:
<s:SciChartSurface
Grid.Row="1"
Background="Transparent"
BorderThickness="0"
RenderableSeries="{s:SeriesBinding Series}"
Annotations="{s:AnnotationsBinding Annotations}">
<s:VerticalSliceModifier ShowTooltipOn="Never" Foreground="White" Name="sliceModifier">
<s:VerticalSliceModifier.VerticalLines>
<s:VerticalLineAnnotation X1="{Binding Number}" Style="{StaticResource sliceStyle}" />
</s:VerticalSliceModifier.VerticalLines>
</s:VerticalSliceModifier>
</s:SciChartSurface>
public class MountainRenderableSeriesViewModel
{
public DataSeriesViewModel<double, double> DataSeries { get; set; }
public DataTemplate RolloverMarkerTemplate { get; set; }
// Other properties...
public MountainRenderableSeriesViewModel()
{
// Initialize your DataSeries and other properties
// Set the RolloverMarkerTemplate for this series
RolloverMarkerTemplate = Application.Current.Resources["CustomRolloverMarkerTemplate"] as DataTemplate;
}
}
My challenge is that I want to customize the RolloverMarkerTemplate for this dynamically created series. Most of the examples I’ve found show how to use RolloverMarkerTemplate with a statically defined series, but I cannot figure out how to assign it when the series is created in a ViewModel and bound to the chart using SeriesBinding.
Any guidance or code examples on how to achieve this customization would be greatly appreciated.
- Eira Jeremy asked 8 months ago
- last edited 8 months ago
-
Hi there, posting backlinks or spam won’t be tolerated and your account will be banned. All posts from new users are manually reviewed. Please refrain from using our forums as an SEO backlink builder.
- You must login to post comments
There is a documentation page which describes how to do this here:
Worked Example – Bind Tooltip Templates or Attached Properties in MVVM
- Andrew Burnett-Thompson answered 8 months ago
- You must login to post comments
Please login first to submit.