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
825
Position Marker Labels
posted

I would like to position the marker label, that you see above, inside the columns. Is this possible? And, if so, I would like to be able to do this with code behind.

Parents
  • 895
    Verified Answer
    posted

    Hello flowerdj,

    Here is a code sample:

         <Grid>
            <Grid.Resources>
                <Style TargetType="igWebChart:ColumnChartDataPointTemplate">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="igWebChart:ColumnChartDataPointTemplate">
                                <Border Background="{TemplateBinding Fill}">
                                    <TextBlock HorizontalAlignment="Center"
                                               VerticalAlignment="Center"
                                               FontSize="20"
                                               Foreground="White"
                                               Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataPoint.Value}" />
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

            </Grid.Resources>


            <igWebChart:XamWebChart>
                <igWebChart:XamWebChart.Series>
                    <igWebChart:Series ChartType="Column"
                                       StrokeThickness="3">
                        <igWebChart:Series.DataPoints>
                            <igWebChart:DataPoint Value="5" />
                            <igWebChart:DataPoint Value="6" />
                            <igWebChart:DataPoint Value="7" />
                        </igWebChart:Series.DataPoints>
                    </igWebChart:Series>
                </igWebChart:XamWebChart.Series>
            </igWebChart:XamWebChart>
        </Grid>

     

    Position the text anywhere you like.

Reply Children