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

0
0

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>
Version
6.5.1
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.