private static IHlcDataSeries <double, double> GetHlcDataSeries(IEnumerable <double> data) { var dataSeries = new HlcDataSeries <double, double>(); dataSeries.Append(data, data, data.Select(x => x + 1.0), data.Select(x => x - 0.3)); return(dataSeries); }
public ErrorSeriesExampleViewModel() { // Generate some data to display var data = DataManager.Instance.GetFourierSeriesZoomed(1.0, 0.1, 5.0, 5.15); // Append data to series. SciChart automatically redraws DataSeries0 = new HlcDataSeries <double, double>(); DataSeries1 = new HlcDataSeries <double, double>(); FillSeries(DataSeries0, data, 1.0); FillSeries(DataSeries1, data, 1.3); }
private void FillSeries(HlcDataSeries <double, double> hlcDataSeries, DoubleSeries sourceData, double scale) { var xData = sourceData.XData; var yData = sourceData.YData.Select(x => x * scale).ToArray(); // Generate some random error data. Errors must be absolute values, // e.g. if a series has a Y-value of 5.0, and YError of =/-10% then you must enter YErrorHigh=5.5, YErrorLow=4.5 into the HlcDataSeries var random = new FasterRandom(); var yErrorHigh = yData.Select(y => y + random.NextDouble() * 0.2); var yErrorLow = yData.Select(y => y - random.NextDouble() * 0.2); // HlcDataSeries requires X, Y, High, Low. // For Error bars the High, Low becomes the High Low error, // while X,Y is the location of the error hlcDataSeries.Append(xData, yData, yErrorHigh, yErrorLow); }