public void Execute(TestParameters testParameters, TimeSpan duration, Action <double> fpsResult) { // Setup var dataset = new DataSeriesSet <double, double>(); _xyDataSeries = new XyDataSeries <double, double>(); dataset.Add(_xyDataSeries); sciChart.DataSet = dataset; this.scatterSeries.AntiAliasing = testParameters.AntiAliasing; ResamplingMode resamplingMode; if (!Enum.TryParse(testParameters.SamplingMode.ToString(), out resamplingMode)) { resamplingMode = ResamplingMode.None; } this.scatterSeries.ResamplingMode = resamplingMode; _generator = testParameters.DataDistribution == DataDistribution.Uniform ? (RandomPointsGenerator) new BrownianMotionPointsGenerator(0, 100, -50, 50) : new CorrelatedDataPointsGenerator(0, 100, -50, 50); sciChart.XAxis.VisibleRange = new DoubleRange(0, 100); sciChart.YAxis.VisibleRange = new DoubleRange(-50, 50); var initialData = _generator.GetRandomPoints(testParameters.PointCount); _xyDataSeries.Append(initialData.XData, initialData.YData); // Execute _testRunner = new DispatcherTimerRunner(duration, () => OnAppendData(testParameters.PointCount), fpsResult); sciChart.Rendered += _testRunner.OnSciChartRendered; _testRunner.Run(); }
public void Execute(TestParameters testParameters, TimeSpan duration, Action <double> fpsResult) { // Setup var dataset = new DataSeriesSet <double, double>(); _xyDataSeries = new XyDataSeries <double, double>() { FifoCapacity = testParameters.PointCount }; dataset.Add(_xyDataSeries); sciChart.DataSet = dataset; this.lineSeries.AntiAliasing = testParameters.AntiAliasing; ResamplingMode resamplingMode; if (!Enum.TryParse(testParameters.SamplingMode.ToString(), out resamplingMode)) { resamplingMode = ResamplingMode.MinMax; } this.lineSeries.ResamplingMode = resamplingMode; _generator = new RandomLinesGenerator(); var initialData = _generator.GetRandomLinesSeries(testParameters.PointCount); _xyDataSeries.Append(initialData.XData, initialData.YData); // Execute _testRunner = new DispatcherTimerRunner(duration, OnAppendData, fpsResult); sciChart.Rendered += _testRunner.OnSciChartRendered; _testRunner.Run(); }
public void Execute(TestParameters testParameters, TimeSpan duration, Action <double> fpsResult) { var testParams = testParameters as LineAppendTestParameters; ResamplingMode rMode; if (!Enum.TryParse(testParams.SamplingMode.ToString(), out rMode)) { rMode = ResamplingMode.MinMax; } line0.AntiAliasing = testParameters.AntiAliasing; line0.ResamplingMode = rMode; line1.AntiAliasing = testParameters.AntiAliasing; line1.ResamplingMode = rMode; line2.AntiAliasing = testParameters.AntiAliasing; line2.ResamplingMode = rMode; var dataset = new DataSeriesSet <double, double>(); dataset.Add(_mainSeries); dataset.Add(_maLowSeries); dataset.Add(_maHighSeries); sciChart.DataSet = dataset; xBuffer = new double[testParams.IncrementPoints]; yBuffer = new double[testParams.IncrementPoints]; maLowBuffer = new double[testParams.IncrementPoints]; maHighBuffer = new double[testParams.IncrementPoints]; // Execute // // Prime the chart with initial points using (sciChart.SuspendUpdates()) AppendData(testParams.PointCount, testParams.Noisyness); // Start the test runner _testRunner = new CompositionTestRunner(duration, () => OnAppendData(testParams.Noisyness), fpsResult); sciChart.Rendered += _testRunner.OnSciChartRendered; _testRunner.Run(); }
private static void OnDataSeriesDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var sciChartSurface = d as SciChartSurface; if (sciChartSurface == null) { return; } if (e.NewValue == null) { sciChartSurface.RenderableSeries.Clear(); return; } using (sciChartSurface.SuspendUpdates()) { sciChartSurface.RenderableSeries.Clear(); var random = new Random(); var itr = (IEnumerable <IDataSeries>)e.NewValue; var renderSeries = new List <IRenderableSeries>(); // 1.7.2 specific var dataset = new DataSeriesSet <double, double>(); foreach (var dataSeries in itr) { if (dataSeries == null) { continue; } // 1.7.2 specific dataset.Add(dataSeries); var rgb = new byte[3]; random.NextBytes(rgb); var renderableSeries = new FastLineRenderableSeries() { ResamplingMode = ResamplingMode.MinMax, SeriesColor = Color.FromArgb(255, rgb[0], rgb[1], rgb[2]), DataSeries = dataSeries, }; renderSeries.Add(renderableSeries); } // 1.7.2 specific sciChartSurface.DataSet = dataset; sciChartSurface.RenderableSeries = new ObservableCollection <IRenderableSeries>(renderSeries); } }