This project is read-only.

Keep DataFollowChart contents on top?

Feb 16, 2011 at 4:24 PM

I have a ChartPlotter with a LineGraph and DataFollowChart inside it like so:

<d3:ChartPlotter x:Name="chartPlotterHorizontal" 
                d3:Viewport2D.UsesApproximateContentBoundsComparison="False"
                MainHorizontalAxisVisibility="Visible" 
                MainVerticalAxisVisibility="Visible" 
                ViewportClipToBoundsEnlargeFactor="1" 
                LegendVisibility="Collapsed" 
                NewLegendVisible="False"
                Margin="10">

<d3:Header Content="Horizontal Slice" VerticalAlignment="Top" Margin="5" FontFamily="Arial" FontSize="14"/>

<d3:HorizontalAxisTitle x:Name="horizontalAxisTitleHorizontalAngle" 
                        d3:Viewport2D.ContentBounds="{Binding HorizontalDomain}"
                        Content="Horizontal Angle" 
                        FontSize="11"/>

<d3:LineGraph x:Name="lineGraphHorizontalSection" 
                DataSource="{Binding HorizontalAngleDataSource}"/>

<!-- DataFollowChartHorizontal: This creates the circular marker that follows the lineGraph. It shows the X,Y position as a tooltip. -->
<d3:DataFollowChart x:Name="dataFollowChartHorizontalAngle" PointSource="{Binding ElementName=lineGraphHorizontalSection}">
    <DataTemplate>
        <Grid d3:ViewportPanel.ScreenOffsetY="20">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Rectangle RadiusX="3" RadiusY="3" Stroke="LightGray" Fill="LightYellow" Opacity=".7" Grid.Row="0" Grid.RowSpan="3"/>
            <Ellipse Width="7" Height="7" Fill="PaleVioletRed" Stroke="Red" Grid.Row="0"/>
            <TextBlock x:Name="textBlockX" Margin="5,4,5,0" Grid.Row="1" FontSize="9">
            <InlineUIContainer>
        		<TextBlock Text="x = "/>
        	</InlineUIContainer>
            <InlineUIContainer>
        		<TextBlock Text="{Binding Position.X, StringFormat=0.0###}"/> 
        	</InlineUIContainer>
        </TextBlock>
            <TextBlock x:Name="textBlockZ" Margin="5,4,5,4" Grid.Row="2" FontSize="9">
            <InlineUIContainer>
        		<TextBlock Text="z = "/>
        	</InlineUIContainer>
            <InlineUIContainer>
        		<TextBlock Text="{Binding Position.Y, StringFormat=0.0#}"/>
        	</InlineUIContainer>
        </TextBlock>
        </Grid>
    </DataTemplate>
</d3:DataFollowChart>

</d3:ChartPlotter>

Everything works great. However, when the DataFollowChart contents is down near the X axis, it goes behind the axis. How can I make it so the contents of the DataFollowChart are always on top of the graph and all of its components? I have tried putting the Grid in the DataTemplate inside a Canvas, Popup, setting the Panle.Zindex, etc... all with no luck. Thanks in advance.