Simple line graph with no markers using WPF Toolkit Chart for WPF

Feb 1, 2010 at 3:03 PM
Edited Feb 1, 2010 at 3:04 PM

I'm trying to create a simple line graph with no markers using the Chart control in the WPF toolkit.  I have a lot of data points, and the line looks very clunky with tons and tons of markers on it.  All I really need is a way for the user to visualize the line, not to examine every individual data point.

So far I haven't had much luck with this.  Here's my line:

<charting:Chart x:Name="chart" Grid.Row="1">
    <charting:LineSeries ItemsSource="{Binding}"
                         DependentValueBinding="{Binding Proficiency, Converter={StaticResource mult}, ConverterParameter=100.0}"
                         IndependentValuePath="Num" 
                         Title="Proficiency"
                         >
        <charting:LineSeries.DependentRangeAxis>
            <charting:LinearAxis
                        Orientation="Y"
                        Title="Proficiency"
                        Minimum="0"
                        Maximum="110.0"
                        Interval="5.0"
                        ShowGridLines="True"/>
        </charting:LineSeries.DependentRangeAxis>
    </charting:LineSeries>
    <charting:Chart.Axes>
        <!-- Shared horizontal axis -->
        <charting:LinearAxis
                        Orientation="X"
                        Title="Number of questions"
                        Interval="5"
                        ShowGridLines="True"/>
    </charting:Chart.Axes>
</charting:Chart>


My initial attempts have been focused on setting LineSeries.DataPointStyle.  For example, I tried this:

<charting:LineSeries ItemsSource="{Binding}"
                     DependentValueBinding="{Binding Proficiency, Converter={StaticResource mult}, ConverterParameter=100.0}"
                     IndependentValuePath="Num" 
                     Title="Proficiency"
                     >
    <charting:LineSeries.DataPointStyle>
        <Style TargetType="{x:Type charting:LineDataPoint}">
            <Setter Property="Visibility" Value="Collapsed" />
        </Style>
    </charting:LineSeries.DataPointStyle>

...hoping that the data point would simply disappear.  I do get a simple line when I do that, but instead of the nice gradient picked by the Chart by default, the line suddenly becomes orange.  And if I have a second line series, they both become orange in that case, making the legend fairly useless.

Any thoughts?

Thanks,

David Cater

PS: Cross-posted in the MSDN forums at http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/215ac129-2b3e-45a3-833a-3990b6f9f0fd