I am using the MVVM pattern.
I need the ability to create and style a variable number of line series in a chart.
In order to accomplish this I am binding the RenderableSeries to a collection in my view model.
<SciChart:SciChartSurface
x:Name="historicalChart"
Grid.Row="1"
Grid.Column="0"
telerik:RadDragAndDropManager.AllowDrop="True"
RenderableSeries="{Binding HistoricalRenderableSeries, Mode=TwoWay}"
DataSet="{Binding ChartData, Mode=TwoWay}" SciChart:ThemeManager.Theme="ExpressionLight">
</SciChart:SciChartSurface>
And then I am setting the various styles like SeriesColor and StrokeThickness in my view model.
I am now trying to color the points on each line to match the color of the line using a control template.
<ControlTemplate x:Key="ChartShowPointTemplate">
<Ellipse Height="6" Width="6">
<Ellipse.Style>
<Style TargetType="{x:Type Ellipse}">
<Setter Property="Visibility" Value="Visible"/>
<!–<Setter Property="Fill" Value="Green"/>–>
<Setter Property="Fill" Value="{Binding Path=SeriesColor, Converter={StaticResource ColorToBrushConverter}, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type SciChart:FastLineRenderableSeries}}}"/>–>
</Style>
</Ellipse.Style>
</Ellipse>
</ControlTemplate>
But I get the following error:
System.Windows.Data Error: 4 : Cannot find source for binding with reference ‘RelativeSource FindAncestor, AncestorType=’Abt.Controls.SciChart.FastLineRenderableSeries’, AncestorLevel=’1”.
BindingExpression:Path=SeriesColor; DataItem=null; target element is ‘Ellipse’ (Name=”); target property is ‘Fill’ (type ‘Brush’)
I have tried many several options to try and get this work.
If I hard code to GREEN I do see green points on my line.
Any ideas?
- sdemooy asked 12 years ago
- You must login to post comments
I am considering applying server-side licensing for my javerScript application.
In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)
However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)
I wonder if there is a sample code implemented in C++ for server-side licensing.
Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?
- Andrew Burnett-Thompson answered 12 years ago
-
Hi Andrew, Could you please attach your PointMarkerStyling.zip attachment again? Link seems to have broken. Thanks!
- You must login to post comments
Please login first to submit.