chartswindows-runtimewinrt-xamlsilverlight-toolkitwinrt-xaml-toolkit

Hide DataPoints in chart control from WinRT XAML Toolkit


Is it possible to hide the data points in the chart control from the WinRT XAML Toolkit from CodePlex? I'm using a LineSeries and only want a line without the dots.


Solution

  • This seems to work. Though I am not yet sure why it makes my lines orange...

    <charting:Chart
        x:Name="LineChart2"
        Title="Line Chart Without Data Points"
        Margin="70,0">
        <charting:LineSeries
            Title="Population"
            IndependentValueBinding="{Binding Name}"
            DependentValueBinding="{Binding Value}"
            IsSelectionEnabled="True">
            <charting:LineSeries.DataPointStyle>
                <Style
                    TargetType="charting:LineDataPoint">
                    <Setter
                        Property="BorderThickness"
                        Value="0" />
                    <Setter
                        Property="IsTabStop"
                        Value="False" />
                    <Setter
                        Property="Width"
                        Value="0" />
                    <Setter
                        Property="Height"
                        Value="0" />
                    <Setter
                        Property="Template">
                        <Setter.Value>
                            <ControlTemplate
                                TargetType="charting:LineDataPoint">
                                <Grid
                                    x:Name="Root"
                                    Opacity="0" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </charting:LineSeries.DataPointStyle>
        </charting:LineSeries>
    </charting:Chart>