예제 #1
0
        private void Display(LabelledSeries<Tuple<double, double>>[] dataSeries)
        {
            var scene = new ILScene();

            if (dataSeries == null)
                return;
            var PlotColors = new[] { Color.Blue, Color.Red, Color.Violet, Color.Brown, Color.Green, Color.Gold, Color.Olive };

            for (var i = 0; i < dataSeries.Length; i++)
            {
                var timeSeriesItem = dataSeries[i];
                var colorIndex = i % (PlotColors.Length - 1);
                var plotColor = PlotColors[colorIndex];
                var count = timeSeriesItem.Series.Length;
                if (count > 0)
                {
                    var plotCube = new ILPlotCube();
                    ILArray<float> array = GetMatrix(new[] { timeSeriesItem.Series.Select(s => (float)s.Item1).ToArray(), timeSeriesItem.Series.Select(s => (float)s.Item2).ToArray(), timeSeriesItem.Series.Select(s => (float)0).ToArray() });
                    plotCube.Add(new ILPoints
                    {
                        Positions = array,
                        Color = plotColor
                    });

                    scene.Add(plotCube);
                }
            }

            plotter.Scene = scene;
            plotter.Refresh();
        }
예제 #2
0
        private void Display(LabelledSeries<Tuple<double, double>>[] dataSeries)
        {
            var plotModel = new PlotModel();
            var xAxis = new LinearAxis
            {
                Position = AxisPosition.Bottom
            };

            plotModel.Axes.Add(xAxis);
            plotModel.Axes.Add(new LinearAxis());
            plotModel.LegendBorder = OxyColors.Black;
            plotModel.LegendBorderThickness = 1;

            if (dataSeries == null)
                return;
            var LineColors = new[] { Colors.Blue, Colors.Red, Colors.Violet, Colors.Brown, Colors.Green, Colors.Gold, Colors.Olive };

            for (var i = 0; i < dataSeries.Length; i++)
            {
                var timeSeriesItem = dataSeries[i];
                var colorIndex = i % (LineColors.Length - 1);
                var lineColor = LineColors[colorIndex];
                var count = timeSeriesItem.Series.Length;
                if (count > 0)
                {
                    var series = new ScatterSeries();
                    series.Title = timeSeriesItem.Label;
                    series.DataFieldX = "Item1";
                    series.DataFieldY = "Item2";
                    series.MarkerType = MarkerType.Circle;
                    series.MarkerSize = 3;
                    series.MarkerFill = OxyColor.FromArgb(lineColor.A, lineColor.R, lineColor.G, lineColor.B);
                    series.ItemsSource = timeSeriesItem.Series;
                    plotModel.Series.Add(series);
                }
            }

            plotter.Model = plotModel;
        }
 private void DisplayPlot()
 {
     var rowIndex = this.ChartFields.IndexOf(this.chartRowField);
     var columnIndex = this.ChartFields.IndexOf(this.chartColumnField);
     if (rowIndex == -1 || columnIndex == -1)
         return;
     var series = new LabelledSeries<Tuple<double, double>>("data", data.Select(d => Tuple.Create(d[rowIndex], d[columnIndex]))) { IsScatter = true };
     this.Series = new[] {series};
     this.OnPropertyChanged("Series");
 }