Example #1
0
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1), VisibleRange = new SCIDoubleRange(1.1, 2.7)
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };

            var fourierSeries = DataManager.Instance.GetFourierSeries(1.0, 0.1);
            var dataSeries    = new XyDataSeries <double, double>();

            dataSeries.Append(fourierSeries.XData, fourierSeries.YData);

            var renderSeries = new SCIFastLineRenderableSeries {
                DataSeries = dataSeries, StrokeStyle = new SCISolidPenStyle(0xFF279B27, 2f)
            };

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(renderSeries);

                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCIZoomPanModifier(),
                    new SCIPinchZoomModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }
Example #2
0
        protected override void InitExample()
        {
            var fourierSeries = DataManager.Instance.GetFourierSeries(1.0, 0.1);

            var dataSeries = new XyDataSeries <double, double>();

            dataSeries.Append(fourierSeries.XData, fourierSeries.YData);

            var xAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };

            var renderSeries = new SCIFastLineRenderableSeries
            {
                DataSeries      = dataSeries,
                StrokeStyle     = new SCISolidPenStyle(0xFF99EE99, 0.7f),
                PaletteProvider = new ZeroLinePaletteProvider()
            };

            Surface.XAxes.Add(xAxis);
            Surface.YAxes.Add(yAxis);
            Surface.RenderableSeries.Add(renderSeries);

            Surface.ChartModifiers = new SCIChartModifierCollection
            {
                new SCIZoomPanModifier(),
                new SCIPinchZoomModifier(),
                new SCIZoomExtentsModifier()
            };
        }
Example #3
0
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis {
                AutoRange = SCIAutoRange.Always
            };
            var leftAxis = new SCINumericAxis {
                AxisAlignment = SCIAxisAlignment.Left, AxisId = SCIAxisAlignment.Left.ToString()
            };
            var rightAxis = new SCINumericAxis {
                AxisAlignment = SCIAxisAlignment.Right, AxisId = SCIAxisAlignment.Right.ToString()
            };

            var initialColor        = UIColor.Blue;
            var selectedStrokeStyle = new SCISolidPenStyle(ColorUtil.White, 4f);
            var selectedPointMarker = new SCIEllipsePointMarker
            {
                Width       = 10,
                Height      = 10,
                FillStyle   = new SCISolidBrushStyle(0xFFFF00DC),
                StrokeStyle = new SCISolidPenStyle(ColorUtil.White, 1f)
            };

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(leftAxis);
                Surface.YAxes.Add(rightAxis);

                for (var i = 0; i < SeriesCount; i++)
                {
                    var alignment  = i % 2 == 0 ? SCIAxisAlignment.Left : SCIAxisAlignment.Right;
                    var dataSeries = GenerateDataSeries(alignment, i);

                    var rs = new SCIFastLineRenderableSeries
                    {
                        DataSeries          = dataSeries,
                        YAxisId             = alignment.ToString(),
                        StrokeStyle         = new SCISolidPenStyle(initialColor, 2f),
                        SelectedSeriesStyle = new SCILineSeriesStyle
                        {
                            StrokeStyle = selectedStrokeStyle,
                            PointMarker = selectedPointMarker,
                        }
                    };

                    var animation = new SCISweepRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut);
                    animation.StartAfterDelay(0.3f);
                    rs.AddAnimation(animation);

                    // Colors are incremented for visual purposes only
                    var newR = initialColor.R() == 255 ? 255 : initialColor.R() + 5;
                    var newB = initialColor.B() == 0 ? 0 : initialColor.B() - 2;
                    initialColor = UIColor.FromRGB((byte)newR, initialColor.G(), (byte)newB);

                    Surface.RenderableSeries.Add(rs);
                }

                Surface.ChartModifiers.Add(new SCISeriesSelectionModifier());
            }
        }
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis {
                VisibleRange = new SCIDoubleRange(0.0, 10.0), AutoRange = SCIAutoRange.Never, AxisTitle = "Time (seconds)"
            };
            var yAxis = new SCINumericAxis {
                VisibleRange = new SCIDoubleRange(-0.5, 1.5), AxisTitle = "Voltage (mV)"
            };

            var rs0 = new SCIFastLineRenderableSeries {
                DataSeries = _series0, StrokeStyle = new SCISolidPenStyle(0xFFC6E6FF, 2f)
            };
            var rs1 = new SCIFastLineRenderableSeries {
                DataSeries = _series1, StrokeStyle = new SCISolidPenStyle(0xFFC6E6FF, 2f)
            };

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(rs0);
                Surface.RenderableSeries.Add(rs1);
            }

            Start();
        }
        protected override void InitExampleInternal()
        {
            Surface = new SCIChartSurface(_exampleViewLayout.SciChartSurfaceView);
            StyleHelper.SetSurfaceDefaultStyle(Surface);

            var axisStyle = StyleHelper.GetDefaultAxisStyle();
            var xAxis     = new SCINumericAxis {
                IsXAxis = true, Style = axisStyle
            };
            var yAxis = new SCINumericAxis {
                Style = axisStyle
            };

            var renderSeries = new SCIHeatMapRenderableSeries
            {
                //DataSeries = _dataSeries,
                Style = { }
            };

            Surface.XAxes.AddItem(xAxis);
            Surface.YAxes.AddItem(yAxis);
            Surface.AttachRenderableSeries(renderSeries);

            Surface.ChartModifier = new SCIModifierGroup(new ISCIChartModifierProtocol[]
            {
                new SCIZoomPanModifier(),
                new SCIPinchZoomModifier(),
                new SCIZoomExtentsModifier()
            });

            Surface.InvalidateElement();

            _timer.Elapsed += OnTick;
            _timer.Start();
        }
Example #6
0
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis();
            var yAxis = new SCINumericAxis();

            var stops  = new NSNumber[] { 0, 0.2f, 0.4f, 0.6f, 0.8f, 1 };
            var colors = new UIColor[] { 0xFF0000FF.ToColor(), 0xFF6495ed.ToColor(), 0xFF006400.ToColor(), 0xFF7FFF00.ToColor(), 0xFFFFFF00.ToColor(), 0xFFFF0000.ToColor() };

            var renderSeries = new SCIFastUniformHeatmapRenderableSeries
            {
                DataSeries = _dataSeries,
                Minimum    = 0,
                Maximum    = 200,
                ColorMap   = new SCIColorMap(colors, stops)
            };

            Surface.XAxes.Add(xAxis);
            Surface.YAxes.Add(yAxis);
            Surface.RenderableSeries.Add(renderSeries);

            Surface.ChartModifiers = new SCIChartModifierCollection
            {
                new SCIZoomPanModifier(),
                new SCIPinchZoomModifier(),
                new SCIZoomExtentsModifier()
            };

            Start();
        }
Example #7
0
        SCINumericAxis CommonAxisToNative(CustomViews.Visuals.Axes.AxisBase commonAxis)
        {
            var nativeNumericAxis = new SCINumericAxis
            {
                FlipCoordinates = commonAxis.FlipCoordinates
            };

            nativeNumericAxis.Style = new SCIAxisStyle
            {
                DrawMajorBands     = commonAxis.DrawMajorBands,
                DrawMinorTicks     = commonAxis.DrawMinorTicks,
                DrawMajorGridLines = commonAxis.DrawMajorGridLines,
                DrawMinorGridLines = commonAxis.DrawMinorGridLines,
                DrawLabels         = commonAxis.DrawLabels,
                DrawMajorTicks     = commonAxis.DrawMajorTicks
            };

            nativeNumericAxis.AxisAlignment = commonAxis.AxisAlignment == AxisAlignment.Left ? SCIAxisAlignment.Left :
                                              commonAxis.AxisAlignment == AxisAlignment.Top ? SCIAxisAlignment.Top :
                                              commonAxis.AxisAlignment == AxisAlignment.Right ? SCIAxisAlignment.Right :
                                              commonAxis.AxisAlignment == AxisAlignment.Bottom ? SCIAxisAlignment.Bottom :
                                              SCIAxisAlignment.Default;

            nativeNumericAxis.AutoRange = commonAxis.AutoRange == AutoRange.Never ? SCIAutoRange.Never :
                                          commonAxis.AutoRange == AutoRange.Always ? SCIAutoRange.Always : SCIAutoRange.Once;

            if (commonAxis.VisibleRange != null)
            {
                nativeNumericAxis.VisibleRange = new SCIDoubleRange(commonAxis.VisibleRange.Min, commonAxis.VisibleRange.Max);
            }

            return(nativeNumericAxis);
        }
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };

            var rSeries1 = GetScatterRenderableSeries(new SCITrianglePointMarker(), 0xFFFFEB01, false);
            var rSeries2 = GetScatterRenderableSeries(new SCIEllipsePointMarker(), 0xFFFFA300, false);
            var rSeries3 = GetScatterRenderableSeries(new SCITrianglePointMarker(), 0xFFFF6501, true);
            var rSeries4 = GetScatterRenderableSeries(new SCIEllipsePointMarker(), 0xFFFFA300, true);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(rSeries1);
                Surface.RenderableSeries.Add(rSeries2);
                Surface.RenderableSeries.Add(rSeries3);
                Surface.RenderableSeries.Add(rSeries4);

                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCIZoomExtentsModifier(),
                    new SCIPinchZoomModifier(),
                    new SCICursorModifier(),
                    new SCIXAxisDragModifier(),
                    new SCIYAxisDragModifier {
                        DragMode = SCIAxisDragMode.Pan
                    }
                };
            }
        }
Example #9
0
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis();
            var yAxis = new SCINumericAxis();

            float[] coords        = { 0, 0.2f, 0.4f, 0.6f, 0.8f, 1 };
            uint[]  colors        = { 0xFF0000FF, 0xFF6495ed, 0xFF006400, 0xFF7FFF00, 0xFFFFFF00, 0xFFFF0000 };
            var     textureOpenGl = new SCITextureOpenGL(coords, colors, colors.Length);

            var renderSeries = new SCIFastUniformHeatmapRenderableSeries
            {
                DataSeries = _dataSeries,
                Minimum    = 0,
                Maximum    = 200,
                ColorMap   = textureOpenGl
            };

            Surface.XAxes.Add(xAxis);
            Surface.YAxes.Add(yAxis);
            Surface.RenderableSeries.Add(renderSeries);

            Surface.ChartModifiers = new SCIChartModifierCollection
            {
                new SCIZoomPanModifier(),
                new SCIPinchZoomModifier(),
                new SCIZoomExtentsModifier()
            };

            Start();
        }
Example #10
0
        protected override void InitExample()
        {
            ((SingleRealtimeChartLayout)View).Start.TouchUpInside += (sender, args) => Start();
            ((SingleRealtimeChartLayout)View).Pause.TouchUpInside += (sender, args) => Pause();
            ((SingleRealtimeChartLayout)View).Reset.TouchUpInside += (sender, args) => Reset();

            var xAxis = new SCINumericAxis {
                VisibleRange = _xVisibleRange, AutoRange = SCIAutoRange.Never
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1), AutoRange = SCIAutoRange.Always
            };

            var rs1 = new SCIFastLineRenderableSeries {
                DataSeries = _ds1, StrokeStyle = new SCISolidPenStyle(0xFF4083B7, 2f)
            };
            var rs2 = new SCIFastLineRenderableSeries {
                DataSeries = _ds2, StrokeStyle = new SCISolidPenStyle(0xFFFFA500, 2f)
            };
            var rs3 = new SCIFastLineRenderableSeries {
                DataSeries = _ds3, StrokeStyle = new SCISolidPenStyle(0xFFE13219, 2f)
            };

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(rs1);
                Surface.RenderableSeries.Add(rs2);
                Surface.RenderableSeries.Add(rs3);
            }
            Start();
        }
        protected override void InitExample()
        {
            var xAxis = new SCIDateTimeAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1), TextFormatting = "dd/MM/YYYY"
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };

            var dataSeries = new XyDataSeries <DateTime, double> {
                DataDistributionCalculator = new SCIUserDefinedDistributionCalculator()
            };
            var xyyDataSeries = new XyyDataSeries <DateTime, double> {
                DataDistributionCalculator = new SCIUserDefinedDistributionCalculator()
            };
            var xyyDataSeries1 = new XyyDataSeries <DateTime, double> {
                DataDistributionCalculator = new SCIUserDefinedDistributionCalculator()
            };
            var xyyDataSeries2 = new XyyDataSeries <DateTime, double> {
                DataDistributionCalculator = new SCIUserDefinedDistributionCalculator()
            };

            DataManager.Instance.GetFanData(10, result =>
            {
                dataSeries.Append(result.Date, result.ActualValue);
                xyyDataSeries.Append(result.Date, result.MaxValue, result.MinValue);
                xyyDataSeries1.Append(result.Date, result.Value1, result.Value4);
                xyyDataSeries2.Append(result.Date, result.Value2, result.Value3);
            });

            var dataRenderSeries = new SCIFastLineRenderableSeries
            {
                DataSeries  = dataSeries,
                StrokeStyle = new SCISolidPenStyle(UIColor.Red, 1.0f)
            };

            var animation = new SCIWaveRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut);

            animation.StartAfterDelay(0.3f);
            dataRenderSeries.AddAnimation(animation);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);

                Surface.RenderableSeries.Add(createRenderableSeriesWith(xyyDataSeries));
                Surface.RenderableSeries.Add(createRenderableSeriesWith(xyyDataSeries1));
                Surface.RenderableSeries.Add(createRenderableSeriesWith(xyyDataSeries2));
                Surface.RenderableSeries.Add(dataRenderSeries);

                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCIZoomPanModifier(),
                    new SCIPinchZoomModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis();
            var yAxis = new SCINumericAxis();

            var ds1 = new XyDataSeries <double, double> {
                SeriesName = "Curve A"
            };
            var ds2 = new XyDataSeries <double, double> {
                SeriesName = "Curve B"
            };
            var ds3 = new XyDataSeries <double, double> {
                SeriesName = "Curve C"
            };
            var ds4 = new XyDataSeries <double, double> {
                SeriesName = "Curve D"
            };

            var ds1Points = DataManager.Instance.GetStraightLine(4000, 1.0, 10);
            var ds2Points = DataManager.Instance.GetStraightLine(3000, 1.0, 10);
            var ds3Points = DataManager.Instance.GetStraightLine(2000, 1.0, 10);
            var ds4Points = DataManager.Instance.GetStraightLine(1000, 1.0, 10);

            ds1.Append(ds1Points.XData, ds1Points.YData);
            ds2.Append(ds2Points.XData, ds2Points.YData);
            ds3.Append(ds3Points.XData, ds3Points.YData);
            ds4.Append(ds4Points.XData, ds4Points.YData);

            var rs1 = new SCIFastLineRenderableSeries {
                DataSeries = ds1, StrokeStyle = new SCISolidPenStyle(0xFFFFFF00, 2f)
            };
            var rs2 = new SCIFastLineRenderableSeries {
                DataSeries = ds2, StrokeStyle = new SCISolidPenStyle(0xFF279B27, 2f)
            };
            var rs3 = new SCIFastLineRenderableSeries {
                DataSeries = ds3, StrokeStyle = new SCISolidPenStyle(0xFFFF1919, 2f)
            };
            var rs4 = new SCIFastLineRenderableSeries {
                DataSeries = ds4, IsVisible = false, StrokeStyle = new SCISolidPenStyle(0xFF1964FF, 2f)
            };

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(rs1);
                Surface.RenderableSeries.Add(rs2);
                Surface.RenderableSeries.Add(rs3);
                Surface.RenderableSeries.Add(rs4);
                Surface.ChartModifiers.Add(new SCILegendModifier {
                    SourceMode = SCISourceMode.AllSeries
                });

                rs1.AddAnimation(new SCISweepRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut));
                rs2.AddAnimation(new SCISweepRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut));
                rs3.AddAnimation(new SCISweepRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut));
                rs4.AddAnimation(new SCISweepRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut));
            }
        }
Example #13
0
        protected override void InitExample()
        {
            var xAxis = new SCIDateTimeAxis {
                GrowBy = new SCIDoubleRange(0.0, 0.1)
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0, 0.1)
            };

            var dataSeries      = new XyzDataSeries <DateTime, double, double>();
            var tradeDataSource = DataManager.Instance.GetTradeticks().ToArray();

            dataSeries.Append(
                tradeDataSource.Select(x => x.TradeDate).ToArray(),
                tradeDataSource.Select(x => x.TradePrice).ToArray(),
                tradeDataSource.Select(x => x.TradeSize).ToArray());

            var lineSeries = new SCIFastLineRenderableSeries
            {
                DataSeries  = dataSeries,
                StrokeStyle = new SCISolidPenStyle(0xFFFF3333, 1f)
            };

            var lineAnimation = new SCIScaleRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOutElastic);

            lineAnimation.StartAfterDelay(0.3f);
            lineSeries.AddAnimation(lineAnimation);

            var bubbleSeries = new SCIBubbleRenderableSeries
            {
                DataSeries = dataSeries,
                //Style = new SCIBubbleSeriesStyle { Detalization = 40,  },
                ZScaleFactor     = 1,
                AutoZRange       = false,
                BubbleBrushStyle = new SCISolidBrushStyle(0x50CCCCCC),
                StrokeStyle      = new SCISolidPenStyle(0x90CCCCCC, 2f)
            };

            var bubbleAnimation = new SCIScaleRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOutElastic);

            bubbleAnimation.StartAfterDelay(0.3f);
            bubbleSeries.AddAnimation(bubbleAnimation);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(lineSeries);
                Surface.RenderableSeries.Add(bubbleSeries);

                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCIZoomPanModifier(),
                    new SCIPinchZoomModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis {
                AxisAlignment = SCIAxisAlignment.Left
            };
            var yAxis = new SCINumericAxis {
                AxisAlignment = SCIAxisAlignment.Bottom, FlipCoordinates = true
            };

            var yValues1 = new[] { 0.0, 0.1, 0.2, 0.4, 0.8, 1.1, 1.5, 2.4, 4.6, 8.1, 11.7, 14.4, 16.0, 13.7, 10.1, 6.4, 3.5, 2.5, 5.4, 6.4, 7.1, 8.0, 9.0 };
            var yValues2 = new[] { 2.0, 10.1, 10.2, 10.4, 10.8, 1.1, 11.5, 3.4, 4.6, 0.1, 1.7, 14.4, 16.0, 13.7, 10.1, 6.4, 3.5, 2.5, 1.4, 0.4, 10.1, 0.0, 0.0 };
            var yValues3 = new[] { 20.0, 4.1, 4.2, 10.4, 10.8, 1.1, 11.5, 3.4, 4.6, 5.1, 5.7, 14.4, 16.0, 13.7, 10.1, 6.4, 3.5, 2.5, 1.4, 10.4, 8.1, 10.0, 15.0 };

            var ds1 = new XyDataSeries <double, double> {
                SeriesName = "data 1"
            };
            var ds2 = new XyDataSeries <double, double> {
                SeriesName = "data 2"
            };
            var ds3 = new XyDataSeries <double, double> {
                SeriesName = "data 3"
            };

            for (var i = 0; i < yValues1.Length; i++)
            {
                ds1.Append(i, yValues1[i]);
                ds2.Append(i, yValues2[i]);
                ds3.Append(i, yValues3[i]);
            }

            var series1 = GetRenderableSeries(ds1, 0xFF567893, 0xFF567893, 0xFF3D5568);
            var series2 = GetRenderableSeries(ds2, 0xFFACBCCA, 0xFFACBCCA, 0xFF439AAF);
            var series3 = GetRenderableSeries(ds3, 0xFFDBE0E1, 0xFFDBE0E1, 0xFFB6C1C3);

            var columnsCollection = new SCIVerticallyStackedColumnsCollection();

            columnsCollection.Add(series1);
            columnsCollection.Add(series2);
            columnsCollection.Add(series3);

            var animation = new SCIWaveRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut);

            animation.StartAfterDelay(0.3f);
            columnsCollection.AddAnimation(animation);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(columnsCollection);
                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCICursorModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis {
                VisibleRange = new SCIDoubleRange(3, 6)
            };
            var yAxis = new SCINumericAxis {
                AutoRange = SCIAutoRange.Always, GrowBy = new SCIDoubleRange(0.05d, 0.05d)
            };

            var ds1 = new XyDataSeries <double, double> {
                SeriesName = "Green Series"
            };
            var ds2 = new XyDataSeries <double, double> {
                SeriesName = "Red Series"
            };
            var ds3 = new XyDataSeries <double, double> {
                SeriesName = "Gray Series"
            };
            var ds4 = new XyDataSeries <double, double> {
                SeriesName = "Gold Series"
            };

            var data1 = DataManager.Instance.GetNoisySinewave(300, 1, PointsCount, 0.25);
            var data2 = DataManager.Instance.GetSinewave(100, 2, PointsCount);
            var data3 = DataManager.Instance.GetSinewave(200, 1.5, PointsCount);
            var data4 = DataManager.Instance.GetSinewave(50, 0.1, PointsCount);

            ds1.Append(data1.XData, data1.YData);
            ds2.Append(data2.XData, data2.YData);
            ds3.Append(data3.XData, data3.YData);
            ds4.Append(data4.XData, data4.YData);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries = new SCIRenderableSeriesCollection
                {
                    new SCIFastLineRenderableSeries {
                        DataSeries = ds1, StrokeStyle = new SCISolidPenStyle(0xFF177B17, 2f)
                    },
                    new SCIFastLineRenderableSeries {
                        DataSeries = ds2, StrokeStyle = new SCISolidPenStyle(0xFFDD0909, 2f)
                    },
                    new SCIFastLineRenderableSeries {
                        DataSeries = ds3, StrokeStyle = new SCISolidPenStyle(0xFF808080, 2f)
                    },
                    new SCIFastLineRenderableSeries {
                        DataSeries = ds4, StrokeStyle = new SCISolidPenStyle(0xFFFFD700, 2f), IsVisible = false
                    },
                };
                Surface.ChartModifiers.Add(new SCICursorModifier
                {
                    Style = { ShowAxisLabels = true, ShowTooltip = true, HitTestMode = SCIHitTestMode.Interpolate }
                });
            }
        }
        protected override void InitExampleInternal()
        {
            Surface = new SCIChartSurface(_exampleViewLayout.SciChartSurfaceView);
            StyleHelper.SetSurfaceDefaultStyle(Surface);

            var xAxis = new SCINumericAxis {
                IsXAxis = true, AxisAlignment = SCIAxisAlignmentMode.Left
            };
            var yAxis = new SCINumericAxis {
                AxisAlignment = SCIAxisAlignmentMode.Bottom, FlipCoordinates = true
            };

            var yValues1 = new[] { 0.0, 0.1, 0.2, 0.4, 0.8, 1.1, 1.5, 2.4, 4.6, 8.1, 11.7, 14.4, 16.0, 13.7, 10.1, 6.4, 3.5, 2.5, 5.4, 6.4, 7.1, 8.0, 9.0 };
            var yValues2 = new[] { 2.0, 10.1, 10.2, 10.4, 10.8, 1.1, 11.5, 3.4, 4.6, 0.1, 1.7, 14.4, 16.0, 13.7, 10.1, 6.4, 3.5, 2.5, 1.4, 0.4, 10.1, 0.0, 0.0 };
            var yValues3 = new[] { 20.0, 4.1, 4.2, 10.4, 10.8, 1.1, 11.5, 3.4, 4.6, 5.1, 5.7, 14.4, 16.0, 13.7, 10.1, 6.4, 3.5, 2.5, 1.4, 10.4, 8.1, 10.0, 15.0 };

            var ds1 = new XyDataSeries <double, double> {
                SeriesName = "data 1"
            };
            var ds2 = new XyDataSeries <double, double> {
                SeriesName = "data 2"
            };
            var ds3 = new XyDataSeries <double, double> {
                SeriesName = "data 3"
            };

            for (var i = 0; i < yValues1.Length; i++)
            {
                ds1.Append(i, yValues1[i]);
                ds2.Append(i, yValues2[i]);
                ds3.Append(i, yValues3[i]);
            }

            //TODO finish after porting StackedSeries to Xamarin from iOS
            var series1 = GetRenderableSeries(ds1, UIColor.FromRGB(0x56, 0x78, 0x93), UIColor.FromRGB(0x56, 0x78, 0x93), UIColor.FromRGB(0x3D, 0x55, 0x68));
            var series2 = GetRenderableSeries(ds2, UIColor.FromRGB(0xAC, 0xBC, 0xCA), UIColor.FromRGB(0xAC, 0xBC, 0xCA), UIColor.FromRGB(0x43, 0x9A, 0xAF));
            var series3 = GetRenderableSeries(ds3, UIColor.FromRGB(0xDB, 0xE0, 0xE1), UIColor.FromRGB(0xDB, 0xE0, 0xE1), UIColor.FromRGB(0xB6, 0xC1, 0xC3));

            var columnsCollection = new SCIStackedVerticalColumnGroupSeries();

            columnsCollection.AddSeries(series1);
            columnsCollection.AddSeries(series2);
            columnsCollection.AddSeries(series3);

            Surface.AttachAxis(xAxis, true);
            Surface.AttachAxis(yAxis, false);
            Surface.AttachRenderableSeries(columnsCollection);

            Surface.ChartModifier = new SCIModifierGroup(new ISCIChartModifierProtocol[]
            {
                new SCICursorModifier(),
                new SCIZoomExtentsModifier()
            });

            Surface.InvalidateElement();
        }
        protected override void InitExampleInternal()
        {
            Surface = new SCIChartSurface(_exampleViewLayout.SciChartSurfaceView);
            StyleHelper.SetSurfaceDefaultStyle(Surface);

            var dataSeries      = new XyzDataSeries <DateTime, double, double>();
            var tradeDataSource = DataManager.Instance.GetTradeticks().ToArray();

            dataSeries.Append(
                tradeDataSource.Select(x => x.TradeDate).ToArray(),
                tradeDataSource.Select(x => x.TradePrice).ToArray(),
                tradeDataSource.Select(x => x.TradeSize).ToArray());

            var axisStyle = StyleHelper.GetDefaultAxisStyle();
            var xAxis     = new SCIDateTimeAxis {
                IsXAxis = true, GrowBy = new SCIDoubleRange(0, 0.1), Style = axisStyle
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0, 0.1), Style = axisStyle
            };

            var lineSeries = new SCIFastLineRenderableSeries
            {
                DataSeries = dataSeries,
                Style      = { LinePen = new SCIPenSolid(0xFFFF3333, 1f) }
            };

            //var stops = new[] { 0, 0.95f, 1 };
            //var colors = new int[] { Color.Transparent, Resources.GetColor(Resource.Color.color_primary), Color.Transparent };
            //var gradientFill = new RadialGradientBrushStyle(0.5f, 0.5f, 0.5f, 0.5f, colors, stops, TileMode.Clamp);
            var bubbleSeries = new SCIBubbleRenderableSeries
            {
                DataSeries = dataSeries,
                //ZScale = 3,
                //AutoZRange = false,
                Style =
                {
                    BubbleBrush = new SCIBrushLinearGradient(0x7f090048, 0x30090048, SCILinearGradientDirection.Vertical)
                }
            };

            Surface.AttachAxis(xAxis, true);
            Surface.AttachAxis(yAxis, false);
            Surface.AttachRenderableSeries(lineSeries);
            Surface.AttachRenderableSeries(bubbleSeries);

            Surface.ChartModifier = new SCIModifierGroup(new ISCIChartModifierProtocol[]
            {
                new SCIZoomPanModifier(),
                new SCIPinchZoomModifier(),
                new SCIZoomExtentsModifier()
            });

            Surface.InvalidateElement();
        }
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis();
            var yAxis = new SCINumericAxis();

            var yValues1 = new[] { 4.0, 7, 5.2, 9.4, 3.8, 5.1, 7.5, 12.4, 14.6, 8.1, 11.7, 14.4, 16.0, 3.7, 5.1, 6.4, 3.5, 2.5, 12.4, 16.4, 7.1, 8.0, 9.0 };
            var yValues2 = new[] { 15.0, 10.1, 10.2, 10.4, 10.8, 1.1, 11.5, 3.4, 4.6, 0.1, 1.7, 14.4, 6.0, 13.7, 10.1, 8.4, 8.5, 12.5, 1.4, 0.4, 10.1, 5.0, 1.0 };

            var ds1 = new XyDataSeries <double, double> {
                SeriesName = "data 1"
            };
            var ds2 = new XyDataSeries <double, double> {
                SeriesName = "data 2"
            };

            for (var i = 0; i < yValues1.Length; i++)
            {
                ds1.Append(i, yValues1[i]);
            }
            for (var i = 0; i < yValues2.Length; i++)
            {
                ds2.Append(i, yValues2[i]);
            }

            var series1 = GetRenderableSeries(ds1, 0xDDDBE0E1, 0x88B6C1C3);
            var series2 = GetRenderableSeries(ds2, 0xDDACBCCA, 0x88439AAF);

            var seriesCollection = new SCIVerticallyStackedMountainsCollection();

            seriesCollection.Add(series1);
            seriesCollection.Add(series2);

            var animation = new SCIWaveRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut);

            animation.StartAfterDelay(0.3f);
            seriesCollection.AddAnimation(animation);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(seriesCollection);
                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCICursorModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }
        private void CreateOverviewChart(out SCIBoxAnnotation leftAreaAnnotation, out SCIBoxAnnotation rightAreaAnnotation)
        {
            // Create an XAxis and YAxis for our chart
            var xAxis1 = new SCICategoryDateTimeAxis {
                AutoRange = SCIAutoRange.Always
            };
            var yAxis1 = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1), AutoRange = SCIAutoRange.Always
            };

            // Create the mountain chart for the overview , using the same price data but zoomed out
            var mountainSeries = new SCIFastMountainRenderableSeries {
                DataSeries = _ohlcDataSeries, AreaStyle = new SCILinearGradientBrushStyle(0x883a668f, 0xff20384f, SCILinearGradientDirection.Vertical)
            };

            // Create some annotations to visualize the selected area on the main price chart
            leftAreaAnnotation = new SCIBoxAnnotation
            {
                CoordinateMode = SCIAnnotationCoordinateMode.RelativeY,
                Y1Value        = 0,
                Y2Value        = 1,
                Style          = new SCIBoxAnnotationStyle
                {
                    FillBrush = new SCISolidBrushStyle(0x33FFFFFF),
                },
            };

            rightAreaAnnotation = new SCIBoxAnnotation
            {
                CoordinateMode = SCIAnnotationCoordinateMode.RelativeY,
                Y1Value        = 0,
                Y2Value        = 1,
                Style          = new SCIBoxAnnotationStyle
                {
                    FillBrush = new SCISolidBrushStyle(0x33FFFFFF),
                },
            };

            // Populate the chart with Axis, RenderableSeries. The chart automatically updates when any property changes
            using (OverviewSurface.SuspendUpdates())
            {
                OverviewSurface.XAxes.Add(xAxis1);
                OverviewSurface.YAxes.Add(yAxis1);
                OverviewSurface.RenderableSeries.Add(mountainSeries);

                OverviewSurface.Annotations.Add(leftAreaAnnotation);
                OverviewSurface.Annotations.Add(rightAreaAnnotation);
            }
        }
        protected override void InitExampleInternal()
        {
            Surface = new SCIChartSurface(_exampleViewLayout.SciChartSurfaceView);
            StyleHelper.SetSurfaceDefaultStyle(Surface);

            var ds1Points = DataManager.Instance.GetDampedSinewave(1.0, 0.05, 50, 5);

            var dataSeries = new XyDataSeries <double, double>();

            dataSeries.Append(ds1Points.XData, ds1Points.YData);

            var axisStyle = StyleHelper.GetDefaultAxisStyle();
            var xAxis     = new SCINumericAxis {
                IsXAxis = true, GrowBy = new SCIDoubleRange(0.1, 0.1), Style = axisStyle
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1), Style = axisStyle
            };

            var renderSeries = new SCIFastImpulseRenderableSeries
            {
                DataSeries = dataSeries,
                Style      =
                {
                    LinePen     = new SCIPenSolid(UIColor.FromRGB(0x00,   0x66,  0xFF), 0.7f),
                    PointMarker = new SCIEllipsePointMarker
                    {
                        FillBrush = new SCIBrushSolid(UIColor.FromRGB(0x00, 0x66, 0xFF)),
                        BorderPen = new SCIPenSolid(UIColor.FromRGB(0x00,   0x66,  0xFF),   2f),
                        Width     =                                     10,
                        Height    = 10
                    }
                }
            };

            Surface.AttachAxis(xAxis, true);
            Surface.AttachAxis(yAxis, false);
            Surface.AttachRenderableSeries(renderSeries);

            Surface.ChartModifier = new SCIModifierGroup(new ISCIChartModifierProtocol[]
            {
                new SCIZoomPanModifier(),
                new SCIPinchZoomModifier(),
                new SCIZoomExtentsModifier()
            });

            Surface.InvalidateElement();
        }
Example #21
0
 protected BasePaneModel(string title, string yAxisTextFormatting, bool isFirstPane)
 {
     Title = title;
     YAxis = new SCINumericAxis
     {
         AxisId         = title,
         AutoRange      = SCIAutoRange.Always,
         MinorsPerMajor = isFirstPane ? 4 : 2,
         MaxAutoTicks   = isFirstPane ? 8 : 4,
         GrowBy         = isFirstPane ? new SCIDoubleRange(0.05d, 0.05d) : new SCIDoubleRange(0d, 0d)
     };
     if (!string.IsNullOrWhiteSpace(yAxisTextFormatting))
     {
         YAxis.TextFormatting = yAxisTextFormatting;
     }
 }
        protected override void InitExampleInternal()
        {
            Surface = new SCIChartSurface(_exampleViewLayout.SciChartSurfaceView);
            StyleHelper.SetSurfaceDefaultStyle(Surface);

            var priceData = DataManager.Instance.GetPriceDataIndu();

            var dataSeries = new XyDataSeries <DateTime, double>();

            dataSeries.DataDistributionCalculator = new SCIUserDefinedDistributionCalculator();
            dataSeries.Append(priceData.TimeData, priceData.CloseData);

            var axisStyle = StyleHelper.GetDefaultAxisStyle();
            var xAxis     = new SCIDateTimeAxis {
                IsXAxis = true, GrowBy = new SCIDoubleRange(0.1, 0.1), Style = axisStyle, AxisId = "xAxis"
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1), Style = axisStyle, AxisId = "yAxis"
            };

            var renderSeries = new SCIFastMountainRenderableSeries
            {
                DataSeries = dataSeries,
                XAxisId    = xAxis.AxisId,
                YAxisId    = yAxis.AxisId,
                Style      =
                {
                    AreaBrush = new SCIBrushLinearGradient(0xAAFF8D42, 0x88090E11, SCILinearGradientDirection.Vertical),
                    BorderPen = new SCIPenSolid(0xaaffc9a8, 0.7f)
                }
            };

            Surface.AttachAxis(xAxis, true);
            Surface.AttachAxis(yAxis, false);
            Surface.AttachRenderableSeries(renderSeries);

            Surface.ChartModifier = new SCIModifierGroup(new ISCIChartModifierProtocol[]
            {
                new SCIZoomPanModifier(),
                new SCIPinchZoomModifier(),
                new SCIZoomExtentsModifier()
            });

            Surface.InvalidateElement();
        }
        protected override void InitExampleInternal()
        {
            Surface = new SCIChartSurface(_exampleViewLayout.SciChartSurfaceView);
            StyleHelper.SetSurfaceDefaultStyle(Surface);

            var data0 = DataManager.Instance.GetDampedSinewave(1.0, 0.01, 1000);
            var data1 = DataManager.Instance.GetDampedSinewave(1.0, 0.005, 1000, 12);

            var dataSeries = new XyyDataSeries <double, double>();

            dataSeries.Append(data0.XData, data0.YData, data1.YData);

            var axisStyle = StyleHelper.GetDefaultAxisStyle();
            var xAxis     = new SCINumericAxis {
                IsXAxis = true, VisibleRange = new SCIDoubleRange(1.1, 2.7), Style = axisStyle
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1), Style = axisStyle
            };

            var renderSeries = new SCIBandRenderableSeries
            {
                DataSeries = dataSeries,
                Style      = new SCIBandSeriesStyle
                {
                    Pen1   = new SCIPenSolid(0xFFFF1919, 0.7f),
                    Pen2   = new SCIPenSolid(0xFF279B27, 0.7f),
                    Brush1 = new SCIBrushSolid(0x33279B27),
                    Brush2 = new SCIBrushSolid(0x33FF1919)
                }
            };

            Surface.AttachAxis(xAxis, true);
            Surface.AttachAxis(yAxis, false);
            Surface.AttachRenderableSeries(renderSeries);

            Surface.ChartModifier = new SCIModifierGroup(new ISCIChartModifierProtocol[]
            {
                new SCIZoomPanModifier(),
                new SCIPinchZoomModifier(),
                new SCIZoomExtentsModifier()
            });

            Surface.InvalidateElement();
        }
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };

            var ds1Points  = DataManager.Instance.GetDampedSinewave(1.0, 0.05, 50, 5);
            var dataSeries = new XyDataSeries <double, double>();

            dataSeries.Append(ds1Points.XData, ds1Points.YData);

            var renderableSeries = new SCIFastImpulseRenderableSeries
            {
                DataSeries  = dataSeries,
                StrokeStyle = new SCISolidPenStyle(0xFF0066FF, 2f),
                PointMarker = new SCIEllipsePointMarker
                {
                    Width       = 7,
                    Height      = 7,
                    StrokeStyle = new SCISolidPenStyle(0xFF0066FF, 2f),
                    FillStyle   = new SCISolidBrushStyle(0xFF0066FF),
                }
            };

            var animation = new SCIWaveRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut);

            animation.StartAfterDelay(0.3f);
            renderableSeries.AddAnimation(animation);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(renderableSeries);
                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCIZoomPanModifier(),
                    new SCIPinchZoomModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }
Example #25
0
        protected override void InitExample()
        {
            var priceSeries = DataManager.Instance.GetPriceDataIndu();

            var dataSeries = new OhlcDataSeries <DateTime, double>();

            dataSeries.Append(priceSeries.TimeData, priceSeries.OpenData, priceSeries.HighData, priceSeries.LowData, priceSeries.CloseData);

            var size  = priceSeries.Count;
            var xAxis = new SCICategoryDateTimeAxis {
                VisibleRange = new SCIDoubleRange(size - 30, size), GrowBy = new SCIDoubleRange(0, 0.1)
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0, 0.1), AutoRange = SCIAutoRange.Always
            };

            var renderSeries = new SCIFastCandlestickRenderableSeries
            {
                DataSeries         = dataSeries,
                StrokeUpStyle      = new SCISolidPenStyle(0xFF00AA00, 1f),
                StrokeDownStyle    = new SCISolidPenStyle(0xFFFF0000, 1f),
                FillUpBrushStyle   = new SCISolidBrushStyle(0x8800AA00),
                FillDownBrushStyle = new SCISolidBrushStyle(0x88FF0000)
            };

            var animation = new SCIWaveRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut);

            animation.StartAfterDelay(0.3f);
            renderSeries.AddAnimation(animation);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(renderSeries);

                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCIZoomPanModifier(),
                    new SCIPinchZoomModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }
Example #26
0
        protected override void InitExampleInternal()
        {
            Surface = new SCIChartSurface(_exampleViewLayout.SciChartSurfaceView);
            StyleHelper.SetSurfaceDefaultStyle(Surface);

            var data = DataManager.Instance.GetPriceDataIndu();

            var dataSeries = new OhlcDataSeries <DateTime, double>(TypeOfSeries.XCategory);

            dataSeries.Append(data.TimeData, data.OpenData, data.HighData, data.LowData, data.CloseData);

            var axisStyle = StyleHelper.GetDefaultAxisStyle();
            var xAxis     = new SCICategoryDateTimeAxis {
                IsXAxis = true, Style = axisStyle
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1), Style = axisStyle
            };

            var renderSeries = new SCIFastCandlestickRenderableSeries
            {
                DataSeries = dataSeries,
                Style      =
                {
                    StrokeUpStyle      = new SCIPenSolid(UIColor.Green,    1f),
                    StrokeDownStyle    = new SCIPenSolid(UIColor.Red,      1f),
                    FillUpBrushStyle   = new SCIBrushSolid(UIColor.Green),
                    FillDownBrushStyle = new SCIBrushSolid(UIColor.Red)
                }
            };

            Surface.AttachAxis(xAxis, true);
            Surface.AttachAxis(yAxis, false);
            Surface.AttachRenderableSeries(renderSeries);

            Surface.ChartModifier = new SCIModifierGroup(new ISCIChartModifierProtocol[]
            {
                new SCIZoomPanModifier(),
                new SCIPinchZoomModifier(),
                new SCIZoomExtentsModifier()
            });

            Surface.InvalidateElement();
        }
        protected override void InitExample()
        {
            var data0 = DataManager.Instance.GetDampedSinewave(1.0, 0.01, 1000);
            var data1 = DataManager.Instance.GetDampedSinewave(1.0, 0.005, 1000, 12);

            var dataSeries = new XyyDataSeries <double, double>();

            dataSeries.Append(data0.XData, data0.YData, data1.YData);

            var xAxis = new SCINumericAxis {
                VisibleRange = new SCIDoubleRange(1.1, 2.7)
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };

            var renderSeries = new SCIFastBandRenderableSeries
            {
                DataSeries       = dataSeries,
                StrokeStyle      = new SCISolidPenStyle(0xFFFF1919, 0.7f),
                StrokeY1Style    = new SCISolidPenStyle(0xFF279B27, 0.7f),
                FillBrushStyle   = new SCISolidBrushStyle(0x33279B27),
                FillY1BrushStyle = new SCISolidBrushStyle(0x33FF1919)
            };

            var animation = new SCIScaleRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOutElastic);

            animation.StartAfterDelay(0.3f);
            renderSeries.AddAnimation(animation);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(renderSeries);

                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCIZoomPanModifier(),
                    new SCIPinchZoomModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }
        protected override void InitExample()
        {
            ((DashboardStyleChartsLayout)View).ChartSelectorView.ValueChanged += (sender, e) =>
            {
                InitChart((sender as UISegmentedControl).SelectedSegment);
            };

            var xAxis = new SCINumericAxis {
                AutoRange = SCIAutoRange.Always
            };
            var yAxis = new SCINumericAxis {
                AutoRange = SCIAutoRange.Always
            };

            Chart.XAxes.Add(xAxis);
            Chart.YAxes.Add(yAxis);

            InitChart(((DashboardStyleChartsLayout)View).ChartSelectorView.SelectedSegment);
        }
Example #29
0
        protected override void InitExampleInternal()
        {
            Surface = new SCIChartSurface(_exampleViewLayout.SciChartSurfaceView);
            StyleHelper.SetSurfaceDefaultStyle(Surface);

            _exampleViewLayout.Start.TouchUpInside += (sender, args) => Start();
            _exampleViewLayout.Pause.TouchUpInside += (sender, args) => Pause();
            _exampleViewLayout.Reset.TouchUpInside += (sender, args) => Reset();

            var xAxis = new SCINumericAxis {
                IsXAxis = true, VisibleRange = _xVisibleRange, AutoRange = SCIAutoRangeMode.Never
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1), AutoRange = SCIAutoRangeMode.Always
            };

            var rs1 = new SCIFastLineRenderableSeries
            {
                DataSeries = _ds1,
                Style      = { LinePen = new SCIPenSolid(UIColor.FromRGB(0x40, 0x83, 0xB7), 2f) }
            };
            var rs2 = new SCIFastLineRenderableSeries
            {
                DataSeries = _ds2,
                Style      = { LinePen = new SCIPenSolid(UIColor.FromRGB(0xFF, 0xA5, 0x00), 2f) }
            };
            var rs3 = new SCIFastLineRenderableSeries
            {
                DataSeries = _ds3,
                Style      = { LinePen = new SCIPenSolid(UIColor.FromRGB(0xE1, 0x32, 0x19), 2f) }
            };

            Surface.AttachAxis(xAxis, true);
            Surface.AttachAxis(yAxis, false);
            Surface.AttachRenderableSeries(rs1);
            Surface.AttachRenderableSeries(rs2);
            Surface.AttachRenderableSeries(rs3);

            Surface.InvalidateElement();

            Start();
        }
Example #30
0
        protected override void InitExample()
        {
            var xAxis = new SCIDateTimeAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };
            var yAxis = new SCINumericAxis {
                GrowBy = new SCIDoubleRange(0.1, 0.1)
            };

            var priceData  = DataManager.Instance.GetPriceDataIndu();
            var dataSeries = new XyDataSeries <DateTime, double> {
                DataDistributionCalculator = new SCIUserDefinedDistributionCalculator()
            };

            dataSeries.Append(priceData.TimeData, priceData.CloseData);

            var renderableSeries = new SCIFastMountainRenderableSeries
            {
                DataSeries  = dataSeries,
                StrokeStyle = new SCISolidPenStyle(0xAAFFC9A8, 2f),
                AreaStyle   = new SCILinearGradientBrushStyle(0xAAFF8D42, 0x88090E11, SCILinearGradientDirection.Horizontal),
            };

            var animation = new SCIWaveRenderableSeriesAnimation(3, SCIAnimationCurve.EaseOut);

            animation.StartAfterDelay(0.3f);
            renderableSeries.AddAnimation(animation);

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(renderableSeries);
                Surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCIZoomPanModifier(),
                    new SCIPinchZoomModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }