Example #1
0
        public void MadeChart(Chart chart, int band, int[] chartData)
        {
            Series series = new Series {ChartType = SeriesChartType.SplineArea};
            Title title;
            switch (_type)
            {
                case 2:
                    title = new Title
                    {
                        Text = "遥感图像累计直方图 · 波段:" + band,
                        TextStyle = TextStyle.Shadow,
                        Font = new Font(new FontFamily("微软雅黑"), 10)
                    };
                    break;

                case 1:
                default:
                    title = new Title
                    {
                        Text = "遥感图像直方图 · 波段:" + band,
                        TextStyle = TextStyle.Shadow,
                        Font = new Font(new FontFamily("微软雅黑"), 10)
                    };
                    break;
            }

            for (int i = 1; i < chartData.Length; i++)
            {
                series.Points.AddXY(i, chartData[i]);
            }

            chart.Series.Add(series);
            chart.Titles.Add(title);
            chart.Refresh();
        }