コード例 #1
0
        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 {
                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();
            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()
                };
            }
        }
コード例 #4
0
        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()
                };
            }
        }
コード例 #5
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()
                };
            }
        }
コード例 #6
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()
                };
            }
        }
コード例 #7
0
        private SCIXyScatterRenderableSeries GetScatterRenderableSeries(ISCIPointMarkerProtocol pointMarker, uint color, bool negative)
        {
            var seriesName = pointMarker is SCIEllipsePointMarker ?
                             negative ? "Negative Ellipse" : "Positive Ellipse" :
                             negative ? "Negative" : "Positive";

            var dataSeries = new XyDataSeries <int, double> {
                SeriesName = seriesName
            };

            for (var i = 0; i < 200; i++)
            {
                var time = i < 100 ? GetRandom(_random, 0, i + 10) / 100 : GetRandom(_random, 0, 200 - i + 10) / 100;
                var y    = negative ? -time * time * time : time * time * time;

                dataSeries.Append(i, y);
            }

            pointMarker.Height      = 6;
            pointMarker.Width       = 6;
            pointMarker.StrokeStyle = new SCISolidPenStyle(UIColor.White, 0.1f);
            pointMarker.FillStyle   = new SCISolidBrushStyle(color);

            var renderSeries = new SCIXyScatterRenderableSeries
            {
                DataSeries = dataSeries,
                Style      = { PointMarker = pointMarker },
            };

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

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

            return(renderSeries);
        }
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis();
            var yAxis = new SCINumericAxis();

            var porkData     = new double[] { 10, 13, 7, 16, 4, 6, 20, 14, 16, 10, 24, 11 };
            var vealData     = new double[] { 12, 17, 21, 15, 19, 18, 13, 21, 22, 20, 5, 10 };
            var tomatoesData = new double[] { 7, 30, 27, 24, 21, 15, 17, 26, 22, 28, 21, 22 };
            var cucumberData = new double[] { 16, 10, 9, 8, 22, 14, 12, 27, 25, 23, 17, 17 };
            var pepperData   = new double[] { 7, 24, 21, 11, 19, 17, 14, 27, 26, 22, 28, 16 };

            var ds1 = new XyDataSeries <double, double> {
                SeriesName = "Pork Series"
            };
            var ds2 = new XyDataSeries <double, double> {
                SeriesName = "Veal Series"
            };
            var ds3 = new XyDataSeries <double, double> {
                SeriesName = "Tomato Series"
            };
            var ds4 = new XyDataSeries <double, double> {
                SeriesName = "Cucumber Series"
            };
            var ds5 = new XyDataSeries <double, double> {
                SeriesName = "Pepper Series"
            };

            const int data = 1992;

            for (var i = 0; i < porkData.Length; i++)
            {
                ds1.Append(data + i, porkData[i]);
                ds2.Append(data + i, vealData[i]);
                ds3.Append(data + i, tomatoesData[i]);
                ds4.Append(data + i, cucumberData[i]);
                ds5.Append(data + i, pepperData[i]);
            }

            var porkSeries     = GetRenderableSeries(ds1, 0xFF22579D, 0xFF226FB7);
            var vealSeries     = GetRenderableSeries(ds2, 0xFFBE642D, 0xFFFF9A2E);
            var tomatoSeries   = GetRenderableSeries(ds3, 0xFFA33631, 0xFFDC443F);
            var cucumberSeries = GetRenderableSeries(ds4, 0xFF73953D, 0xFFAAD34F);
            var pepperSeries   = GetRenderableSeries(ds5, 0xFF64458A, 0xFF8562B4);

            var verticalCollection1 = new SCIVerticallyStackedColumnsCollection();

            verticalCollection1.Add(porkSeries);
            verticalCollection1.Add(vealSeries);

            var verticalCollection2 = new SCIVerticallyStackedColumnsCollection();

            verticalCollection2.Add(tomatoSeries);
            verticalCollection2.Add(cucumberSeries);
            verticalCollection2.Add(pepperSeries);

            var columnsCollection = new SCIHorizontallyStackedColumnsCollection();

            columnsCollection.Add(verticalCollection1);
            columnsCollection.Add(verticalCollection2);

            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 SCIRolloverModifier(),
                    new SCIZoomExtentsModifier()
                };
            }
        }
コード例 #9
0
        protected override void InitExample()
        {
            var xAxis = new SCINumericAxis
            {
                AutoTicks     = false,
                MajorDelta    = new SCIGenericType(1),
                MinorDelta    = new SCIGenericType(0.5),
                LabelProvider = new YearsLabelProvider(),
                Style         = { DrawMajorBands = true }
            };

            var yAxis = new SCINumericAxis
            {
                AutoRange = SCIAutoRange.Always,
                AxisTitle = "billions of People",
                GrowBy    = new SCIDoubleRange(0, 0.1),
                Style     = { DrawMajorBands = true }
            };

            var china          = new[] { 1.269, 1.330, 1.356, 1.304 };
            var india          = new[] { 1.004, 1.173, 1.236, 1.656 };
            var usa            = new[] { 0.282, 0.310, 0.319, 0.439 };
            var indonesia      = new[] { 0.214, 0.243, 0.254, 0.313 };
            var brazil         = new[] { 0.176, 0.201, 0.203, 0.261 };
            var pakistan       = new[] { 0.146, 0.184, 0.196, 0.276 };
            var nigeria        = new[] { 0.123, 0.152, 0.177, 0.264 };
            var bangladesh     = new[] { 0.130, 0.156, 0.166, 0.234 };
            var russia         = new[] { 0.147, 0.139, 0.142, 0.109 };
            var japan          = new[] { 0.126, 0.127, 0.127, 0.094 };
            var restOfTheWorld = new[] { 2.466, 2.829, 3.005, 4.306 };

            var chinaDataSeries = new XyDataSeries <double, double> {
                SeriesName = "China"
            };
            var indiaDataSeries = new XyDataSeries <double, double> {
                SeriesName = "India"
            };
            var usaDataSeries = new XyDataSeries <double, double> {
                SeriesName = "USA"
            };
            var indonesiaDataSeries = new XyDataSeries <double, double> {
                SeriesName = "Indonesia"
            };
            var brazilDataSeries = new XyDataSeries <double, double> {
                SeriesName = "Brazil"
            };
            var pakistanDataSeries = new XyDataSeries <double, double> {
                SeriesName = "Pakistan"
            };
            var nigeriaDataSeries = new XyDataSeries <double, double> {
                SeriesName = "Nigeria"
            };
            var bangladeshDataSeries = new XyDataSeries <double, double> {
                SeriesName = "Bangladesh"
            };
            var russiaDataSeries = new XyDataSeries <double, double> {
                SeriesName = "Russia"
            };
            var japanDataSeries = new XyDataSeries <double, double> {
                SeriesName = "Japan"
            };
            var restOfTheWorldDataSeries = new XyDataSeries <double, double> {
                SeriesName = "Rest Of The World"
            };
            var totalDataSeries = new XyDataSeries <double, double> {
                SeriesName = "Total"
            };

            for (var i = 0; i < 4; i++)
            {
                double xValue = i;
                chinaDataSeries.Append(xValue, china[i]);
                if (i != 2)
                {
                    indiaDataSeries.Append(xValue, india[i]);
                    usaDataSeries.Append(xValue, usa[i]);
                    indonesiaDataSeries.Append(xValue, indonesia[i]);
                    brazilDataSeries.Append(xValue, brazil[i]);
                }
                else
                {
                    indiaDataSeries.Append(xValue, double.NaN);
                    usaDataSeries.Append(xValue, double.NaN);
                    indonesiaDataSeries.Append(xValue, double.NaN);
                    brazilDataSeries.Append(xValue, double.NaN);
                }
                pakistanDataSeries.Append(xValue, pakistan[i]);
                nigeriaDataSeries.Append(xValue, nigeria[i]);
                bangladeshDataSeries.Append(xValue, bangladesh[i]);
                russiaDataSeries.Append(xValue, russia[i]);
                japanDataSeries.Append(xValue, japan[i]);
                restOfTheWorldDataSeries.Append(xValue, restOfTheWorld[i]);
                totalDataSeries.Append(xValue, china[i] + india[i] + usa[i] + indonesia[i] + brazil[i] + pakistan[i] + nigeria[i] + bangladesh[i] + russia[i] + japan[i] + restOfTheWorld[i]);
            }

            var columnsCollection = new SCIHorizontallyStackedColumnsCollection();

            columnsCollection.Add(GetRenderableSeries(chinaDataSeries, 0xff3399ff, 0xff2D68BC));
            columnsCollection.Add(GetRenderableSeries(indiaDataSeries, 0xff014358, 0xff013547));
            columnsCollection.Add(GetRenderableSeries(usaDataSeries, 0xff1f8a71, 0xff1B5D46));
            columnsCollection.Add(GetRenderableSeries(indonesiaDataSeries, 0xffbdd63b, 0xff7E952B));
            columnsCollection.Add(GetRenderableSeries(brazilDataSeries, 0xffffe00b, 0xffAA8F0B));
            columnsCollection.Add(GetRenderableSeries(pakistanDataSeries, 0xfff27421, 0xffA95419));
            columnsCollection.Add(GetRenderableSeries(nigeriaDataSeries, 0xffbb0000, 0xff840000));
            columnsCollection.Add(GetRenderableSeries(bangladeshDataSeries, 0xff550033, 0xff370018));
            columnsCollection.Add(GetRenderableSeries(russiaDataSeries, 0xff339933, 0xff2D732D));
            columnsCollection.Add(GetRenderableSeries(japanDataSeries, 0xff00aba9, 0xff006C6A));
            columnsCollection.Add(GetRenderableSeries(restOfTheWorldDataSeries, 0xff560068, 0xff3D0049));

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

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

            var legendModifier = new SCILegendModifier {
                ShowCheckBoxes = false
            };

            using (Surface.SuspendUpdates())
            {
                Surface.XAxes.Add(xAxis);
                Surface.YAxes.Add(yAxis);
                Surface.RenderableSeries.Add(columnsCollection);
                Surface.ChartModifiers.Add(legendModifier);
                Surface.ChartModifiers.Add(new SCITooltipModifier());
            }
        }