WPFToolkit charts,AreaSeries

Apr 5, 2010 at 3:53 PM

I am using WPFToolkit chart.I need to use the lineseries,areaseries and display the areas(with diff colours) between the lines.

1)I need to colour area between 2 lines rather from line to x axis(avoiding merging areas).If this is possible with LineSeries then i can use LineSeries instead of AreaSeries.

(Example how i need the graph: http://www.laredopediatrics.com/images/growthchart_example_by_age_o2qq.gif

2)How can i use curves instead of lines(I need to create graphs in my project)

3)What is the best way to bind the co-ordinates.I have manyco-ordinates for may line series,for each time it has to take all coordinates.Is there any better way?

Please look at the above image,that is how i need to do the graph.

The xaml code is below.

<UserControl x:Class="Test.UserControl1.xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" Width="600" Height="500">
<Grid>
<my:Chart Margin="20" Name="chart1" LegendTitle="Chart" BorderThickness="0">
<my:Chart.Series>
<my:AreaSeries Name="Area1" Title="Area1" IndependentValueBinding="{Binding Path=Key}" DependentValueBinding="{Binding Path=Value}" ToolTip="Area1">
<my:AreaSeries.DataPointStyle>

<Style TargetType="my:AreaDataPoint">

<Setter Property="Visibility" Value="Collapsed"/>
</Style>

</my:AreaSeries.DataPointStyle>
</my:AreaSeries>
<my:AreaSeries Name="Area2" Title="Area2" IndependentValueBinding="{Binding Path=Key}" DependentValueBinding="{Binding Path=Value}" ToolTip="Area2">

<my:AreaSeries.DataPointStyle>
<Style TargetType="my:AreaDataPoint">
<Setter Property="Background" Value="DarkGray"/>
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</my:AreaSeries.DataPointStyle>
</my:AreaSeries>
<my:LineSeries Name="line1" Title="line1" IndependentValueBinding="{Binding Path=Key}" DependentValueBinding="{Binding Path=Value}" ToolTip="line1">
<my:LineSeries.DataPointStyle>
<Style TargetType="my:LineDataPoint">
<Setter Property="Background" Value="Violet"/>
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</my:LineSeries.DataPointStyle>
</my:LineSeries>
<my:AreaSeries Name="Area3" Title="Area3" IndependentValueBinding="{Binding Path=Key}" DependentValueBinding="{Binding Path=Value}" ToolTip="Area3">
<my:AreaSeries.DataPointStyle>

<Style TargetType="my:AreaDataPoint">
<Setter Property="Background" Value="Orange"/>
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</my:AreaSeries.DataPointStyle>
</my:AreaSeries>
</my:Chart.Series>

my:Chart.Axes>
<my:LinearAxis Orientation="Y" Title="X axis Values" Minimum="10" Interval="2" Maximum="34" ShowGridLines="True"/>
<my:LinearAxis Orientation="X" Title="Y axis Values" Minimum="2" Interval="2" Maximum="19" ShowGridLines="True"/>
</my:Chart.Axes>
</my:Chart>
</Grid>
</UserControl>

Apr 8, 2010 at 4:07 PM

Hi,

This is the discussions for the CodePlex site itself. You will probably get a better response by posting this on the project's discussions.

Thanks,
Matt

Apr 13, 2010 at 12:52 PM

Thank u, I am posting this question there