1
Vote

Charting - How to remove line data points

description

I have a Line Series chart with Line data points in it. how do i clear the old data points when i bind it new data.

my Code is
                        <chartingToolkit:Chart Name="LowCusumChart" >
                            <chartingToolkit:Chart.Resources>
                                <Style x:Key="LCuRules" TargetType="{x:Type chartingToolkit:LineDataPoint}">
                                    <Setter Property="Template" >
                                        <Setter.Value>
                                            <ControlTemplate x:Name="LCTemplate" TargetType="{x:Type chartingToolkit:LineDataPoint}">
                                                <Canvas x:Name="LNPlotArea" Margin="0,5,0,5" >
                                                    <Border BorderBrush="Purple" BorderThickness="2" Visibility="{Binding Path= CRules, Converter={StaticResource NullVisibility}}">
                                                        <Label  Foreground="Purple"  Content="{Binding Path=CRules}"  />
                                                    </Border>

                                                </Canvas>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Background" Value="Black" />
                                </Style>

                            </chartingToolkit:Chart.Resources>
                            <chartingToolkit:Chart.Series>                                      
                                <chartingToolkit:LineSeries Name="LowCusumSeries" Title="Cusum" IndependentValueBinding="{Binding Path= EntryDate}" DependentValueBinding="{Binding Path=Cusum}"  >                                           
                                </chartingToolkit:LineSeries>
public class CusumChart
{
public string EntryDate { get; set; }
public double? Cusum { get; set; }
public string CRules { get; set; }.
public bool CsrVisible { get; set; }
}

ObservableCollection<CusumChart> Values {get;set;}

Values.Add(new CusumChart {EntryDate="28/03/2017", Cusum=3.2,CRules="CsrRule",CsrVisible=true});

comments