Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
StackedFragmentSeries MarkerTemplate
posted

Hello,

I have created a xamdatachart with a couple of stacked fragment columns, I would like to show the values of this data inside the columns. (fixed, not tooltips)

What I have found so far is that I can use the MarkerTemplate for this, however if say, the mid column fragment value is 0 (or another small amount) this will overlap with my bottom fragment's value. I figured it was possible to move the markerTemplate's with a Margin, however I would like it to be dynamic instead of fixed with margins. My idea is that it would be something like verticalalignment="center",  but could not find anything near this.

This is the code I am using:

<ig:XamDataChart x:Name="ChartControlPerformance" Grid.Column="0" Legend="{Binding ElementName=xmLegend}">
<ig:XamDataChart.Axes>
<ig:NumericYAxis x:Name="ChartControlPerformanceYaxis" MinimumValue="0"/>
<ig:CategoryXAxis x:Name="ChartControlPerformanceXaxis" ItemsSource="{Binding}" Label="{}{TimeSpan}" />
</ig:XamDataChart.Axes>
<ig:XamDataChart.Series>
<ig:StackedColumnSeries XAxis="{Binding ElementName=ChartControlPerformanceXaxis}"
YAxis="{Binding ElementName=ChartControlPerformanceYaxis}"
ItemsSource="{Binding}">
<ig:StackedColumnSeries.Series>
<ig:StackedFragmentSeries x:Name="PerformanceProductionColumn" ValueMemberPath="Production" Title="Productie" Brush="Green" MarkerBrush="Green" MarkerOutline="Green"
Outline="Green">
<ig:StackedFragmentSeries.MarkerTemplate>
<DataTemplate>
<Grid VerticalAlignment="Center">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Margin="2" Text="{Binding Item.Production}" Foreground="White" FontSize="12" HorizontalAlignment="Center" />
</StackPanel>
</Grid>
</DataTemplate>
</ig:StackedFragmentSeries.MarkerTemplate>
</ig:StackedFragmentSeries>
<ig:StackedFragmentSeries x:Name="PerformanceDowntimeColumn" ValueMemberPath="Downtime" Title="Stilstandverlies" Brush="Orange" MarkerBrush="Orange" MarkerOutline="Orange"
Outline="Orange">
<ig:StackedFragmentSeries.MarkerTemplate>
<DataTemplate>
<Grid>
<StackPanel HorizontalAlignment="Right">
<TextBlock Margin="2" Text="{Binding Item.Downtime}" Foreground="White" FontSize="12" HorizontalAlignment="Center" />
</StackPanel>
</Grid>
</DataTemplate>
</ig:StackedFragmentSeries.MarkerTemplate>
</ig:StackedFragmentSeries>
<ig:StackedFragmentSeries x:Name="PerformanceSpeedLossColumn" ValueMemberPath="PerformanceLoss" Title="Prestatieverlies" Brush="Red" MarkerBrush="Red" MarkerOutline="Red"
Outline="Red">
<ig:StackedFragmentSeries.MarkerTemplate>
<DataTemplate>
<Grid>
<StackPanel HorizontalAlignment="Left">
<TextBlock Margin="2" Text="{Binding Item.PerformanceLoss}" Foreground="White" FontSize="12" HorizontalAlignment="Center" />
</StackPanel>
</Grid>
</DataTemplate>
</ig:StackedFragmentSeries.MarkerTemplate>
</ig:StackedFragmentSeries>
</ig:StackedColumnSeries.Series>
</ig:StackedColumnSeries>
<ig:LineSeries x:Name="LineSeriesPerformancePlanning" ItemsSource="{Binding}" ValueMemberPath="Planning" Title="Planning" Thickness="5" MarkerType="None"
XAxis="{Binding ElementName=ChartControlPerformanceXaxis}" Background="Black" Brush="Black" Outline="Black"
YAxis="{Binding ElementName=ChartControlPerformanceYaxis}" IsHighlightingEnabled="True" IsTransitionInEnabled="False">
<ig:LineSeries.MarkerTemplate>
<DataTemplate>
<Grid Margin="0,0,0,22">
<StackPanel HorizontalAlignment="Left">
<TextBlock Margin="2" Text="{Binding Item.Planning}" Foreground="Black" FontSize="12" HorizontalAlignment="Center" />
</StackPanel>
</Grid>
</DataTemplate>
</ig:LineSeries.MarkerTemplate>
</ig:LineSeries>
</ig:XamDataChart.Series>
</ig:XamDataChart>

I would like to know if it is possible to move a MarkerTemplate to the verticalcenter of a StackedFragmentSeries column.