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
1070
Displaying data on the same day using an XamDataChart and PointSeries
posted

I am seeing some strange behavior with the XamDataChart for data occurring on the same day. I have created the following simple XAML and code-behind to show this issue. I have 4 data points to display and I am using a PointSeries to display it. There are two data points for 02/01/2014 one with a value of 1000 and the second with a value of 3000. The XamDataChart will only ever draw the smaller of the two values. The order of the data does not seem to have any affect. I cannot get theXamDataChart to draw the data point with a value of 3000 for 02/01/2014. Below is my sample XAML and code-behind.

<ig:XamDataChart>

    <ig:XamDataChart.Axis>
        <ig:CategoryDateTimeXAxis x:Name=”xAxis”
                                  ItemsSource=”{Binding}“ DateTimeMemberPath=”Date”
                                  MinimumValue=”01/01/2014” MaximumValue=”05/01/2014” />
        <igNumericYXAxis x:Name=”yAxis” MinimumValue=”0” MaximumValue=”5000” />
    <ig:XamDataChart.Axis>

    <ig:XamDataChart.Series>
        <ig:PointSeries MarkerType=”Circle” ItemsSource=”{Binding}” ValueMemberPath=”Value1”
                        XAxis=”{Binding ElementName = xAxis}” YAxis=”{Binding ElementName yAxis}” />
    </ig:XamDataChart.Series>

</ig:XamDataChart>

public partial class MainWindow : Window {
  public MainWindow(){
    InitializeComponents();
    DataContext = ChartData.GenerateData();
  }
}

public class CharData{
  public DateTime Date {get; set;}
  public long Value1 {get; set;}
 
  public static ObservableCollection<ChartData> GenerateData() {
    ObservableCollection<ChartData> data = new ObservableCollection<ChartData>(){
      new ChartData() {
        Date = DateTime.Parse(“02/01/2014”),
        Value1 = 1000
      },
      new ChartData() {
        Date = DateTime.Parse(“03/01/2014”),
        Value1 = 2000
      },
      new ChartData() {
        Date = DateTime.Parse(“04/01/2014”),
        Value1 = 3000
      },
      new ChartData() {
        Date = DateTime.Parse(“02/01/2014”),
        Value1 = 3000
      },
    };
    return data;
  }
}

  • 138253
    Verified Answer
    Offline posted

     

    Hello Eric,

     

    Thank you for your post. I have been looking into it and I can say that this is the intended behavior of the category series. It will only have one representative point for each x band and this is by design. You could implement a custom series that displays all markers, and use that to render the markers if you are sure you want all markers to be displayed. Here more information on creating custom series can be found:

     

    http://help.infragistics.com/Help/NetAdvantage/WPF/2012.2/CLR4.0/html/xamDataChart_Creating_Custom_Series.html

     

    Please let me know if this helps you or you have further questions on this matter.

     

    Looking forward for your reply.