Pre loader

Why is DataPointselection current.IsXAxis null?

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0
<s:DataPointSelectionModifier Name="PointMarkersSelectionModifier"
                              IsEnabled="True"
                              SelectionChanged="PointMarkersSelectionModifier_SelectionChanged"
                              SelectionFill="Blue"
                              SelectionStroke="red" />
<s:MouseWheelZoomModifier IsEnabled="True" />
<s:RubberBandXyZoomModifier IsEnabled="False" />

I am developing in a wpf environment.
When first creating a chart, DataPointSelectionModifier was added in xaml. And every time specific data was created, I manually added XyScatterRenderableSeries to the series.

public static XyScatterRenderableSeries SetChartDataFotScatter(
    double x, double y,
    NumericAxis p_xaxis,
    NumericAxis p_yaxis,
    Brush color = null,
    Brush sel_color = null,
    MyMetadata selected = null)
{
    Color blue = color == null ? (Color)Application.Current.FindResource("Blue") : ((SolidColorBrush)color).Color;
    Color red = sel_color == null ? (Color)Application.Current.FindResource("Red") : ((SolidColorBrush)sel_color).Color;

    ///차트 생성
    var scatter = new XyScatterRenderableSeries();

    ///기본 marker
    EllipsePointMarker marker = new EllipsePointMarker() { Width = 10, Height = 10, StrokeThickness = 1, Opacity = 0.6 };

    ///MyMetadata에 의한 속성 값 변경시 특수하게 작동
    if (selected != null)
    {
        Binding binding            = new Binding("IsChecked");
        binding.Source             = selected;
        binding.Converter          = ScatterCheckToColor;
        binding.ConverterParameter = blue;
        marker.SetBinding(BasePointMarker.FillProperty, binding);
        marker.SetBinding(BasePointMarker.StrokeProperty, binding);
    }
    else
    {
        marker.Fill = blue;
        marker.Stroke = blue;
    }

    scatter.PointMarker = marker;

    ///선택시 marker style
    scatter.SelectedPointMarker = new EllipsePointMarker() { Width = 10, Height = 10, Fill = red, Stroke = red, StrokeThickness = 1, Opacity = 0.6 };

    ///축 적용
    scatter.XAxisId = p_xaxis.Id;
    scatter.YAxisId = p_yaxis.Id;

    ///데이터 생성
    XyDataSeries<double, double> data = new XyDataSeries<double, double>();

    if (selected != null)
        data.Append(x, y, selected);
    else
        data.Append(x, y);

    ///데이터 적용
    scatter.DataSeries = data;
    return scatter;
}






private Dictionary<string, IRange> wgp(Point gwe, Point gwf, IEnumerable<IAxis> gwg)
{
    srq.Clear();
    IEnumerator<IAxis> enumerator = gwg.GetEnumerator();
    try
    {
        while (enumerator.MoveNext() ? true : false)
        {
            IAxis current = enumerator.Current;
            bool isXAxis = current.IsXAxis;
            IComparable comparable = current.GetDataValue((isXAxis ? true : false) ? gwe.X : gwe.Y);
            IComparable comparable2 = current.GetDataValue((isXAxis ? true : false) ? gwf.X : gwf.Y);
            if (comparable.CompareTo(comparable2) > 0)
            {
                IComparable comparable3 = comparable;
                comparable = comparable2;
                comparable2 = comparable3;
            }
            IRange value = RangeFactory.NewWithMinMax(current.VisibleRange, comparable, comparable2);
            srq.Add(current.Id, value);
        }
    }
    finally
    {
        if (enumerator != null || 1 == 0)
        {
            enumerator.Dispose();
        }
    }
    return srq;
}

Then, if you try to select the scatter part with the drag drop, a nullException error occurs. It says IAxis current =null.
Why does this error occur?

Version
v8.0.0.27737
  • Lex
    Hi Jeong, Thank you for reporting this. We would appreciate if you prepare a small sample project reproducing the reported issue and send it for investigation on our side. Thanks in advance, Lex, SciChart Technical Support Engineer
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.