Exemplo n.º 1
0
        void CreataSampleData(int nser, int npts)
        {
            _chart.BeginUpdate();
            DataSeriesCollection sc = _chart.Data.Children;

            sc.Clear();

            for (int iser = 0; iser < nser; iser++)
            {
                double phase = 0.05 + 0.1 * _rnd.NextDouble();
                double amp   = 1 + 5 * _rnd.NextDouble();

                DataSeries ds   = new DataSeries();
                double[]   vals = new double[npts];
                for (int i = 0; i < npts; i++)
                {
                    vals[i] = amp * Math.Sin(i * phase);
                }

                ds.ValuesSource = vals;
                ds.Label        = "S " + iser.ToString();
                ds.ConnectionStrokeThickness = 2;

                sc.Add(ds);
            }
            _chart.EndUpdate();
        }
Exemplo n.º 2
0
 private void ClearPlot()
 {
     DataSeriesCollection.Clear();
     PlotSeriesCollection.Clear();
     Labels.Clear();
     PlotTitles.Clear();
     PlotModel.Title = "";
     foreach (var axis in PlotModel.Axes)
     {
         axis.Reset();
     }
 }