private XYMultipleSeriesDataset GetDateDemoDataset() { XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); const int nr = 10; long value = new Java.Util.Date().Time - 3 * TimeChart.Day; Random r = new Random(); for (int i = 0; i < SERIES_NR; i++) { TimeSeries series = new TimeSeries("Demo series " + (i + 1)); for (int k = 0; k < nr; k++) { series.Add(new Java.Util.Date(value + k * TimeChart.Day / 4), 20 + r.Next() % 100); } dataset.AddSeries(series); } return dataset; }
protected XYMultipleSeriesDataset BuildDateDataset(String[] titles, IList<Date[]> xValues, IList<double[]> yValues) { XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); int length = titles.Length; for (int i = 0; i < length; i++) { TimeSeries series = new TimeSeries(titles[i]); Date[] xV = xValues[i]; double[] yV = yValues[i]; int seriesLength = xV.Length; for (int j = 0; j < seriesLength; j++) { series.Add(xV[j], yV[j]); } dataset.AddSeries(series); } return dataset; }