public MainWindow()
        {
            InitializeComponent();
            //Histogram h = new Histogram();
            ////RankOrder h = new RankOrder();
            //Dataset1d d = new Dataset1d() { 20, 21, 2.2, 2.3, 3.333, 3.5, 13, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };
            //h.Domain = d;
            //h.Draw();

            LineChart h = new LineChart();
            TimeSeries ts = new TimeSeries();
            for (int i = 0; i < 30; i++) {
                ts.Add(DateTime.Now, rand.Next(5) * rand.NextDouble());
                Thread.Sleep(1000);
            }
            h.TimeSeries = ts;
            this.Content = h;
        }
Beispiel #2
0
 public TimeSeries GetDiffs()
 {
     double lastVal = double.NaN;
     TimeSeries ts = new TimeSeries();
     ///Notice that this for loop iterates forward in time
     for (int i = Domain.Count() - 1; i >= 0; i--) {
         double y = Range[i] / lastVal - 1;
         if (double.IsNaN(lastVal)) y = 0;
         ts.Add(Domain[i], y);
         lastVal = Range[i];
     }
     return ts;
 }