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
20
XamDataChart Line handle NULL value
posted

the codes like this:

 class cExDataNode
        {
            private object f_val;

            public object F_val
            {
                get { return f_val; }
                set { f_val = value; }
            }
            private DateTime dtm;

            public DateTime Dtm
            {
                get { return dtm; }
                set { dtm = value; }
            }

        }
        List<cExDataNode> ls_rownodes;


        private void OnSampleLoaded(object sender, RoutedEventArgs e)
        {
            DateTime tm = DateTime.Now;
            ls_rownodes = new List<cExDataNode>();
            for (int i = 0; i < 100; i++)
            {
                cExDataNode dp = new cExDataNode();
                dp.Dtm = tm.AddSeconds(i);
                dp.F_val = i * 10;
                ls_rownodes.Add(dp);
            }

            ls_rownodes[0].F_val = 0;
            ls_rownodes[1].F_val = 0;
            ls_rownodes[2].F_val = 0;
            ls_rownodes[3].F_val = null;
            ls_rownodes[4].F_val = null;
            ls_rownodes[5].F_val = 0;
            ls_rownodes[6].F_val = 0;
            ls_rownodes[7].F_val = 0;
            ls_rownodes[8].F_val = 0;
            ls_rownodes[9].F_val = 0;
            ls_rownodes[10].F_val = 0;
            ls_rownodes[90].F_val = null;

 

            this.DataContext = ls_rownodes;

        }

 

 <ig:XamDataChart x:Name="DataChart">
            <ig:XamDataChart.Axes>
                <ig:CategoryDateTimeXAxis x:Name="categoryXAxis" ItemsSource="{Binding}" Label="{}{Dtm:hh:mm:ss.fff}" DateTimeMemberPath="Dtm"
                                               DisplayType="Continuous">
                    <ig:CategoryDateTimeXAxis.LabelSettings>
                        <ig:AxisLabelSettings Location="OutsideBottom" Extent="45" VerticalAlignment="Center" Visibility="Visible" />
                    </ig:CategoryDateTimeXAxis.LabelSettings>
                </ig:CategoryDateTimeXAxis>
                <ig:NumericYAxis x:Name="numericYAxis" Label="{}{:F1}">
                    <ig:NumericYAxis.LabelSettings>
                        <ig:AxisLabelSettings Location="OutsideLeft" Extent="60" Visibility="Visible" />
                    </ig:NumericYAxis.LabelSettings>
                </ig:NumericYAxis>
            </ig:XamDataChart.Axes>
            <ig:XamDataChart.Series>
                <ig:LineSeries  ValueMemberPath="F_val" MarkerType="None" ItemsSource="{Binding}"  XAxis="{Binding ElementName=categoryXAxis}" YAxis="{Binding ElementName=numericYAxis}" Thickness="2.5" UnknownValuePlotting="LinearInterpolate">
                </ig:LineSeries>
            </ig:XamDataChart.Series>
        </ig:XamDataChart>

and the result:

 ???, the infargistics SL DV ver is 11.2 trial