Пример #1
0
        public void Graph(double start, double end, double dx)
        {
            Series series = new Series();
            for (double x = start; x < end; x += dx) {
                double y = Evaluate(x);
                Debug.Print(x.ToString() + ", " + y.ToString());
                if (!double.IsNaN(y) && y < 1.0e10 && y > -1.0e10) {
                    series.Points.Add(new DataPoint(x, y));
                } else Debug.Print(x.ToString() + ", " + y.ToString() + ", " + "could not be graphed");
            }
            series.ChartType = SeriesChartType.Line;
            series.XAxisType = AxisType.Primary;
            series.YAxisType = AxisType.Primary;

            series.ChartArea = "ChartArea1";
            series.Legend = "Legend1";
            Graph graph = new Graph(series);
            graph.ShowDialog();
        }