示例#1
0
        void Page_Loaded(object sender, RoutedEventArgs e)
        {
            #region Data preparation
            const int N = 200;

            int[] thiknesses = new int[10];

            for(int i=0;i<10;i++)
                thiknesses[i] = i+1;

            Point[] points = new Point[N];
            double step = 10 / (double)N;

            for(int i=0;i<N;i++) {
                points[i].X = -5 + i*step;
                points[i].Y = Math.Exp(points[i].X);
            }

            EnumerableDataSource<Point> dataSource = points.AsDataSource<Point>();
            dataSource.SetXYMapping(point => point);
            #endregion

            graph = new LineGraphWithPoints(dataSource, "Graph Description");
            graph.LineThickness = 3;
            graph.LineColor = Colors.Red;

            
            MainPlotter.Children.Add(graph);
            MainPlotter.FitToView();

            TextBoxDescription.Text = graph.Description;
            if (MainPlotter.Legend != null)
                TextBoxDescriptionLength.Text = MainPlotter.Legend.AllowedDescriptionLength.ToString();
        }
示例#2
0
        void Page_Loaded(object sender, RoutedEventArgs e)
        {
            #region Data preparation
            const int N = 200;

            int[] thiknesses = new int[10];

            for (int i = 0; i < 10; i++)
            {
                thiknesses[i] = i + 1;
            }

            Point[] points = new Point[N];
            double  step   = 10 / (double)N;

            for (int i = 0; i < N; i++)
            {
                points[i].X = -5 + i * step;
                points[i].Y = Math.Exp(points[i].X);
            }

            EnumerableDataSource <Point> dataSource = points.AsDataSource <Point>();
            dataSource.SetXYMapping(point => point);
            #endregion

            graph = new LineGraphWithPoints(dataSource, "Graph Description");
            graph.LineThickness = 3;
            graph.LineColor     = Colors.Red;


            MainPlotter.Children.Add(graph);
            MainPlotter.FitToView();

            TextBoxDescription.Text = graph.Description;
            if (MainPlotter.Legend != null)
            {
                TextBoxDescriptionLength.Text = MainPlotter.Legend.AllowedDescriptionLength.ToString();
            }
        }