setting ZIndex when using ChartSeriesProvider

2 posts, 0 answers
  1. Joe
    Joe avatar
    11 posts
    Member since:
    May 2014

    Posted 05 Jan 2015 Link to this post

    Hello,

    When displaying scatter plots, I like to use the following three properties on my ScatterSeries:
    ClipToBounds=False, ClipToPlotArea=False, and ZIndex=1000 
    to ensure the points don't get clipped by the axes and boundary scrollbars.  See attached pic for the result, when using a single series.

    I'm not quite sure how to set the ZIndex of the scatter series when using a ChartSeriesProvider though for dynamic series.  It lets me set the ClipToBounds and ClipToPlotArea properties, but not the ZIndex using attached properties.

    <telerik:ChartSeriesProvider Source="{Binding MultiSeriesData}">
        <telerik:ChartSeriesProvider.SeriesDescriptors>
            <telerik:ScatterSeriesDescriptor ItemsSourcePath="Data" XValuePath="X" YValuePath="Y">
                <telerik:ScatterSeriesDescriptor.Style>
                    <Style TargetType="telerik:ScatterPointSeries" BasedOn="{StaticResource ScatterPointSeriesStyle}">
                        <Setter Property="ClipToBounds" Value="False" />
                        <Setter Property="ClipToPlotArea" Value="False" />
                <!-- I'd like to be able to do the following, but it causes an error -->
                <!-- <Setter Property="ZIndex" Value="1000" /> -->
                    </Style>
                </telerik:ScatterSeriesDescriptor.Style>
            </telerik:ScatterSeriesDescriptor>
        </telerik:ChartSeriesProvider.SeriesDescriptors>
    </telerik:ChartSeriesProvider>

    Any suggestion on how to set the ZIndex of the dynamic scatter series?  It doesn't matter to me if they're all the same value, they just need to be higher than the chart boundary scrollbars.
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 06 Jan 2015 Link to this post

    Hello Joe,

    The reason you cannot set the ZIndex property within a setter is that it is not a dependency property. Bindings to it would not work either. You can create an attached property and in the changed handler you can get the series and change it's ZIndex in code.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top