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

1
0

I have created the following style for my charts legend:

   <Style  TargetType="{x:Type s:SciChartLegend}">
        <Setter Property="Background" Value="DarkGray"/>
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate DataType="{x:Type s:XyzSeriesInfo}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Ellipse Grid.Column="0" 
                              VerticalAlignment="Center"
                              Stretch="Fill"
                              Width="40"
                              Height="40"
                              StrokeThickness="3"
                              Stroke="{Binding ????, Converter={StaticResource SlitValveToBrushConverter}}" />
                        <TextBlock Grid.Column="1"
                                   Margin="5,0,10,0"
                                   HorizontalAlignment="Center"
                                   Text="{Binding SeriesName}" />
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

I want to bind the Stroke of my ellipse to the Z Value (the string part) of my DataSeries (property is called ChartItems) which is of type XyzDataSeries3D<DateTime, int, string>

How can I bind to the Z Value?

Version
4.2.4.10393
  • You must to post comments
0
0

Hi Craig

///If you bind to XyzSeriesInfo.ZValue and use a converter you can conver the Z-value into a Brush for the Ellipse Stroke.///

Actually this is wrong. I’ve looked in the code and the SeriesInfo type for 3D Charts is BaseXyzSeriesInfo3D. This has the property HitVertex which contains the XYZ coordinates of the data at the hit-test site.

So you need to bind to HitVertex and use HitVertex.Z in your converter to convert to a brush.

Let me know if this helps,

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.