Beispiel #1
0
        public Matrix_Model
        (
            int plot_index,
            string[] op_tit,
            List <ScatterSeries> list_matrix_series,
            List <ScatterSeries> list_work_series,
            OxyPlot.Wpf.PlotView matrix2D_work_plot,
            Work_Model work_model
        )
        {
            Title = op_tit[plot_index];
            index = plot_index;

            IsLegendVisible         = false;
            PlotAreaBorderThickness = new OxyThickness(1, 0, 0, 1);
            PlotMargins             = new OxyThickness(0, 0, 0, 0);
            Padding = new OxyThickness(5);

            Background     = OxyColors.White;
            SelectionColor = OxyColors.Crimson;

            Axes.Add(new LinearAxis
            {
                Position  = AxisPosition.Bottom,
                TickStyle = OxyPlot.Axes.TickStyle.None,
                //MajorGridlineStyle = LineStyle.Dash,
                //MinorGridlineStyle = LineStyle.Dash,
                MaximumPadding = 0.1,
                MinimumPadding = 0.1,
                IsPanEnabled   = false,
                IsZoomEnabled  = false,
                FontSize       = 0.1,
                SelectionMode  = OxyPlot.SelectionMode.Multiple
            });
            Axes.Add(new LinearAxis
            {
                Position  = AxisPosition.Left,
                TickStyle = OxyPlot.Axes.TickStyle.None,
                //MajorGridlineStyle = LineStyle.Dash,
                //MinorGridlineStyle = LineStyle.Dash,
                MaximumPadding = 0.1,
                MinimumPadding = 0.1,
                IsPanEnabled   = false,
                IsZoomEnabled  = false,
                FontSize       = 0.1,
                SelectionMode  = OxyPlot.SelectionMode.Multiple
            });

            Load_Mouse_Events(list_matrix_series, list_work_series, work_model, matrix2D_work_plot);
        }
Beispiel #2
0
        private void Create_Model
        (
            int plot_index,
            string[] x_axis,
            string[] y_axis,
            string[] plot_title,
            List <ScatterSeries> list_matrix_series,
            List <ScatterSeries> list_work_series
        )
        {
            Work_Model work_model = new Work_Model
                                    (
                plot_index,
                plot_title,
                x_axis,
                y_axis,
                list_work_series,
                list_matrix_series,
                list_matrix_models
                                    );

            Matrix_Model matrix_model = new Matrix_Model
                                        (
                plot_index,
                plot_title,
                list_matrix_series,
                list_work_series,
                matrix2D_work_plot,
                work_model
                                        );

            matrix_model.Series.Add(list_matrix_series[plot_index]);

            list_matrix_models.Add(matrix_model);
            list_work_models.Add(work_model);

            matrix2D_matrix_plot.Model = matrix_model;
        }
Beispiel #3
0
        private void Load_Mouse_Events
        (
            List <ScatterSeries> list_matrix_series,
            List <ScatterSeries> list_work_series,
            Work_Model work_model,
            OxyPlot.Wpf.PlotView matrix2D_work_plot
        )
        {
            Series series = null;

            this.MouseDown += (s, e) =>
            {
                if (e.ChangedButton == OxyMouseButton.Left)
                {
                    Tab_Workspace.id = index;

                    if (model_pressed == false)
                    {
                        work_model.Series.Add(list_work_series[Tab_Workspace.id]);
                        model_pressed = true;
                    }

                    matrix2D_work_plot.Model = work_model;
                    series = work_model.Series[0];
                    series.SelectionMode = OxyPlot.SelectionMode.Multiple;

                    for (int i = 0; i < list_matrix_series[Tab_Workspace.id].Points.Count; i++)
                    {
                        if (list_matrix_series[Tab_Workspace.id].IsItemSelected(i))
                        {
                            list_work_series[Tab_Workspace.id].SelectItem(i);
                        }
                    }
                    work_model.Background = OxyColors.White;

                    InvalidatePlot(false);
                    e.Handled = true;
                }
            };

            this.MouseUp += (s, e) =>
            {
                Background = OxyColors.White;

                InvalidatePlot(false);
                e.Handled = true;
            };

            this.MouseEnter += (s, e) =>
            {
                PlotAreaBorderColor = OxyColors.Crimson;

                InvalidatePlot(false);
                e.Handled = true;
            };

            this.MouseLeave += (s, e) =>
            {
                Background          = OxyColors.White;
                PlotAreaBorderColor = OxyColors.Black;

                InvalidatePlot(false);
                e.Handled = true;
            };
        }