I have a SciChartLegend below my chart that was using the default item template in v6.4, and I could change the color of my legend labels simply by setting the Foreground property of the SciChartLegend. However, when I updated to SciChart 6.5.1, the font of my legend labels changed to all black. If I investigate my UI using Snoop, I see the following Binding error on the TextBlock.Foreground property for one of my legend items:
System.Windows.Data Error: 4 : Cannot find source for binding with reference ‘RelativeSource FindAncestor, AncestorType=’SciChart.Charting.Visuals.RenderableSeries.LegendPlaceholder’, AncestorLevel=’1”. BindingExpression:Path=Foreground; DataItem=null; target element is ‘TextBlock’ (Name=”); target property is ‘Foreground’ (type ‘Brush’)
I also tried v6.5.0, and this behavior did not occur – it is new in v6.5.1
Below is the definition of my legend.
<s:SciChartLegend x:Name="legend"
LegendData="{Binding ElementName=LegendModifier, Path=LegendData}"
Orientation="Horizontal"
BorderBrush="White"
FontSize="14"
BorderThickness="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ShowVisibilityCheckboxes="True">
<s:SciChartLegend.ItemsPanel>
<ItemsPanelTemplate>
<chartUtils:UniformWrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</s:SciChartLegend.ItemsPanel>
</s:SciChartLegend>
- Brandon Dybala asked 2 years ago
- You must login to post comments
Hi, I seem to be getting exactly the same issue. Previously I was using V6.3.0 which had no issue, now I jumped to V8.3.0 and am getting this exception.
System.Windows.Data Warning: 4 : Cannot find source for binding with reference ‘RelativeSource FindAncestor, AncestorType=’SciChart.Charting.Visuals.RenderableSeries.LegendPlaceholder’, AncestorLevel=’1”. BindingExpression:Path=Foreground; DataItem=null; target element is ‘TextBlock’ (Name=”); target property is ‘Foreground’ (type ‘Brush’)
Has the problem reappeared in the latest release?
- Miles Merckel answered 2 months ago
- last edited 2 months ago
- You must login to post comments
Hi Brandon,
Thank you for your patience with this issue.
I’m glad to inform you that we have published a fix for the reported issue within a new SciChart Nightly build.
The changes are available in SciChart v7.0.1.27123 and newer.
Here is how to get our nightly builds:
https://support.scichart.com/index.php?/Knowledgebase/Article/View/17232/37/getting-nightly-builds-with-nuget
Please try it out and let us know your feedback.
- Lex answered 1 year ago
- You must login to post comments
Please login first to submit.