public static unsafe void DrawScatterSeries1(IntPtr pointer, List <Point2> data, MarkerType mkty, double mksize, byte r, byte g, byte b)
        {
            GCHandle handle = GCHandle.FromIntPtr(pointer);

            if (handle.IsAllocated)
            {
                PlotModel model = handle.Target as PlotModel;
                if (model != null)
                {
                    List <double> ydata = new List <double>();
                    List <double> xdata = new List <double>();
                    for (int i = 0; i < data.Count; i++)
                    {
                        xdata.Add((double)data[i].X);
                        ydata.Add((double)data[i].Y);
                    }

                    List <double> txdata = new List <double>();
                    List <double> tydata = new List <double>();

                    txdata.Add(xdata[0]);
                    tydata.Add(ydata[0]);

                    for (int i = 1; i < data.Count; i++)
                    {
                        if (xdata[i] - xdata[i - 1] > 1.5)
                        {
                            if (txdata.Count > 0)
                            {
                                model.AddLineSeries(txdata, tydata, OxyColor.FromRgb(r, g, b), LineStyle.Dash);
                                txdata.Clear();
                                tydata.Clear();
                            }
                            txdata.Add(xdata[i]);
                            tydata.Add(ydata[i]);
                        }
                        else
                        {
                            txdata.Add(xdata[i]);
                            tydata.Add(ydata[i]);
                        }
                    }

                    if (txdata.Count > 0)
                    {
                        model.AddLineSeries(txdata, tydata, OxyColor.FromRgb(r, g, b), LineStyle.Dash);
                        txdata.Clear();
                        tydata.Clear();
                    }

                    model.AddScatterSeries(xdata, ydata, OxyColor.FromRgb(r, g, b), mkty, mksize);
                }
            }
        }
        public static unsafe void DrawScatterSeries(IntPtr pointer, List <double> data, byte r, byte g, byte b)
        {
            GCHandle handle = GCHandle.FromIntPtr(pointer);

            if (handle.IsAllocated)
            {
                PlotModel model = handle.Target as PlotModel;
                if (model != null)
                {
                    List <double> xdata = Enumerable.Range(0, data.Count - 1).Select(x => (double)x).ToList();
                    model.AddScatterSeries(xdata, data, OxyColor.FromRgb(r, g, b), MarkerType.Triangle, 1.0);
                }
            }
        }
        public static unsafe void DrawScatterSeries(IntPtr pointer, float *data, int length, byte r, byte g, byte b)
        {
            GCHandle handle = GCHandle.FromIntPtr(pointer);

            if (handle.IsAllocated)
            {
                PlotModel model = handle.Target as PlotModel;
                if (model != null)
                {
                    List <double> ydata = new List <double>();
                    List <double> xdata = Enumerable.Range(0, length - 1).Select(x => (double)x).ToList();
                    for (int i = 0; i < length; i++)
                    {
                        ydata.Add((double)data[i]);
                    }
                    model.AddScatterSeries(xdata, ydata, OxyColor.FromRgb(r, g, b), MarkerType.Triangle, 1.0);
                }
            }
        }
        public static unsafe void DrawScatterSeries(IntPtr pointer, List <Point2> data, byte r, byte g, byte b)
        {
            GCHandle handle = GCHandle.FromIntPtr(pointer);

            if (handle.IsAllocated)
            {
                PlotModel model = handle.Target as PlotModel;
                if (model != null)
                {
                    List <double> ydata = new List <double>();
                    List <double> xdata = new List <double>();
                    for (int i = 0; i < data.Count; i++)
                    {
                        xdata.Add((double)data[i].X);
                        ydata.Add((double)data[i].Y);
                    }
                    model.AddScatterSeries(xdata, ydata, OxyColor.FromRgb(r, g, b), MarkerType.Triangle, 3.0);
                }
            }
        }
Exemplo n.º 5
0
 public static void AddScatterSeries(this PlotModel model, IEnumerable <double> xSeries, IEnumerable <double> ySeries)
 {
     model.AddScatterSeries(xSeries, ySeries, OxyColors.Automatic);
 }