Пример #1
0
        public ChartControlTest()
        {
            InitializeComponent();

            points = new SeriesPointCollection();

            AreaSeries2D series = new AreaSeries2D();

            series.Points = points;
            chart.Series.Add(series);

            points.Add(new SeriesPoint()
            {
                Argument = 0, Value = 10
            });
            points.Add(new SeriesPoint()
            {
                Argument = 1, Value = 30
            });
            points.Add(new SeriesPoint()
            {
                Argument = 2, Value = 23
            });
            points.Add(new SeriesPoint()
            {
                Argument = 3, Value = 15
            });
        }
        public ChartControlTest()
        {
            InitializeComponent();

            points = new SeriesPointCollection();

            AreaSeries2D series = new AreaSeries2D();
            series.Points = points;
            chart.Series.Add(series);

            points.Add(new SeriesPoint() { Argument = 0, Value = 10 });
            points.Add(new SeriesPoint() { Argument = 1, Value = 30 });
            points.Add(new SeriesPoint() { Argument = 2, Value = 23 });
            points.Add(new SeriesPoint() { Argument = 3, Value = 15 });
        }
 static void UpdateGraph(SeriesPointCollection points, double value)
 {
     while (points.Count > 20)
     {
         points.RemoveAt(0);
     }
     points.Add(new SeriesPoint(DateTime.Now.TimeOfDay.TotalSeconds, value));
 }
Пример #4
0
        private void btn_AddPoint_Click(object sender, RoutedEventArgs e)
        {
            Random r = new Random(DateTime.Now.Millisecond);

            for (int i = 0; i < 1000; i++)
            {
                int n = r.Next(100);
                points.Add(new SeriesPoint()
                {
                    Argument = 0, Value = (double)n
                });
            }
            txt_PointsCount.Text = points.Count.ToString();
        }