예제 #1
0
파일: Plot.cs 프로젝트: KvMadan/GraphDemo2
        public Plot(Read rr, ComboBox xBox, ComboBox yBox, Chart chart)
        {
            int indX = xBox.SelectedIndex;
            int indY = yBox.SelectedIndex;

            float[,] data = rr.get_Data();
            int nLines   = rr.get_nLines();
            int nColumns = rr.get_nColumns();

            string [] header = rr.get_Header();

            chart.Series.Clear(); //ensure that the chart is empty
            chart.Series.Add("Series0");
            chart.Series[0].ChartType = SeriesChartType.Line;
            chart.ChartAreas[0].AxisX.LabelStyle.Format = "{F2}";
            chart.ChartAreas[0].AxisX.Title             = header[indX];
            chart.ChartAreas[0].AxisY.Title             = header[indY];

            float x_grids = 6;

            float[] ext = get_Extrema(data, nLines, nColumns, indX);
            chart.ChartAreas[0].AxisX.MajorGrid.Interval     = (ext[1] - ext[0]) / x_grids;
            chart.ChartAreas[0].AxisX.LabelStyle.Interval    = (ext[1] - ext[0]) / x_grids;
            chart.ChartAreas[0].AxisX.MajorTickMark.Interval = (ext[1] - ext[0]) / x_grids;

            chart.Legends.Clear();
            for (int j = 0; j < nLines; j++)
            {
                chart.Series[0].Points.AddXY(data[j, indX], data[j, indY]);
            }
        }
예제 #2
0
파일: Plot.cs 프로젝트: sol-prog/GraphDemo2
        public Plot(Read rr, ComboBox xBox, ComboBox yBox, Chart chart)
        {
            int indX = xBox.SelectedIndex;
            int indY = yBox.SelectedIndex;
            float[,] data = rr.get_Data();
            int nLines = rr.get_nLines();
            int nColumns = rr.get_nColumns();
            string []header = rr.get_Header();

            chart.Series.Clear(); //ensure that the chart is empty
            chart.Series.Add("Series0");
            chart.Series[0].ChartType = SeriesChartType.Line;
            chart.ChartAreas[0].AxisX.LabelStyle.Format = "{F2}";
            chart.ChartAreas[0].AxisX.Title = header[indX];
            chart.ChartAreas[0].AxisY.Title = header[indY];

            float x_grids = 6;
            float[] ext = get_Extrema(data, nLines, nColumns, indX);
            chart.ChartAreas[0].AxisX.MajorGrid.Interval = (ext[1] - ext[0]) / x_grids;
            chart.ChartAreas[0].AxisX.LabelStyle.Interval = (ext[1] - ext[0]) / x_grids;
            chart.ChartAreas[0].AxisX.MajorTickMark.Interval = (ext[1] - ext[0]) / x_grids;

            chart.Legends.Clear();
            for (int j = 0; j < nLines; j++)
            {
                chart.Series[0].Points.AddXY(data[j, indX], data[j, indY]);
            }
        }
예제 #3
0
        public Plot(Read rr, ComboBox xBox, ComboBox yBox, Chart chart)
        {
            int indX = xBox.SelectedIndex;
            int indY = yBox.SelectedIndex;
            float[,] data = rr.get_Data();
            int nLines = rr.get_nLines();

            chart.Series.Clear(); //ensure that the chart is empty
            chart.Series.Add("Series0");
            chart.Series[0].ChartType = SeriesChartType.Line;

            chart.Legends.Clear();
            for (int j = 0; j < nLines; j++)
            {
                chart.Series[0].Points.AddXY(data[j, indX], data[j, indY]);
            }
        }
예제 #4
0
        public Plot(Read rr, ComboBox xBox, ComboBox yBox, Chart chart)
        {
            int indX = xBox.SelectedIndex;
            int indY = yBox.SelectedIndex;

            float[,] data = rr.get_Data();
            int nLines = rr.get_nLines();

            chart.Series.Clear(); //ensure that the chart is empty
            chart.Series.Add("Series0");
            chart.Series[0].ChartType = SeriesChartType.Line;

            chart.Legends.Clear();
            for (int j = 0; j < nLines; j++)
            {
                chart.Series[0].Points.AddXY(data[j, indX], data[j, indY]);
            }
        }