private void InitializeChart()
        {
            //this.tChart1.Aspect.GestureOptions = Steema.TeeChart.Store.Drawing.Aspect.Gestures.None;
            this.tChart1.Aspect.View3D           = false;
            this.tChart1.Footer.Alignment        = TextAlignment.Left;
            this.tChart1.Footer.Font.Brush.Color = Colors.Gray;
            this.tChart1.Header.Font.Brush.Color = Colors.Gray;
            this.tChart1.Header.Font.Size        = 24;
            this.tChart1.Header.Lines            = new string[] {
                "Most popular coding languages of 2014"
            };
            this.tChart1.Legend.Font.Brush.Color = Colors.Gray;
            this.tChart1.Legend.Font.Size        = 19;
            this.tChart1.Legend.TextStyle        = LegendTextStyles.Plain;
            this.tChart1.Name = "tChart1";
            this.tChart1.Panel.Brush.Color             = Colors.White;
            this.tChart1.Panel.Brush.Gradient.EndColor = Colors.White;
            this.tChart1.TabIndex                  = 0;
            this.tChart1.GetLegendText            += TChart1_GetLegendText;
            this.tChart1.Axes.Bottom.MinimumOffset = 250;
            this.tChart1.Axes.Bottom.MaximumOffset = 150;

            tChart1.Panel.Gradient.Visible = false;

            Bubble bCloud = new Bubble(tChart1.Chart);

            bCloud.Add(1, 1175, 30.3, "Python");
            bCloud.Add(2, 1082.5, 22.2, "Java");
            bCloud.Add(3, 1077.5, 13, "C++");
            bCloud.Add(4, 1055, 10.6, "Ruby");
            bCloud.Add(5, 1042.5, 5.2, "JavaScript");
            bCloud.Add(6, 1035, 5, "C#");
            bCloud.Add(7, 1035, 4.1, "C");
            bCloud.Add(8, 1017.5, 3.3, "PHP");
            bCloud.Add(9, 1005, 1.6, "Perl");
            bCloud.Add(10, 975, 1.5, "Go");

            bCloud.Marks.Font.Color = Colors.Black;
        }
Exemple #2
0
        public void CreateBubbleAddElementAndSort()
        {
            //Arrange & Act
            Bubble <int> bubble = new Bubble <int>(5, 3, 4, 6, 2);

            //Act
            bubble.Add(1);
            List <int> expectedOutput = new List <int>()
            {
                1, 2, 3, 4, 5, 6
            };

            //Assert
            Assert.AreEqual(expectedOutput, bubble);
        }
Exemple #3
0
        public BubbleTransparencyChartFeatures(ChartView BaseChart)
        {
            bubble1              = new Bubble();
            this.BaseChart       = BaseChart;
            var                  = new Variables.Variables();
            tool_dataPointSelect = new DataPointSelection(BaseChart);

            BaseChart.Chart.Header.Text = "Market share study";
            BaseChart.Chart.Series.Add(bubble1);
            BaseChart.Chart.Legend.Visible = false;

            bubble1.SeriesColor         = var.GetPaletteBasic[0];
            bubble1.Chart.Zoom.Allow    = false;
            bubble1.Chart.Panning.Allow = ScrollModes.None;

            bubble1.RecalcOptions    = RecalcOptions.OnModify;
            bubble1.DefaultNullValue = 0;

            bubble1.ClickPointer  += tool_dataPointSelect.PointValue_Click;
            bubble1.GetSeriesMark += tool_dataPointSelect.Serie_GetSeriesMark;
            for (int i = 0; i < var.GetValorBubbleTrans1.Length; i++)
            {
                bubble1.Add(var.GetValorBubbleTransX[i], var.GetValorBubbleTrans1[i], var.GetValorBubbleTrans1[i] / 4, var.GetPaletteBasic[i]);
            }

            bubble1.Pointer.Brush.Color    = Color.FromArgb(255, 255, 0, 0);
            bubble1.Pointer.InflateMargins = false;
            bubble1.Pointer.Style          = PointerStyles.Circle;
            bubble1.Title = "bubble1";

            bubble1.Transparency = 50;
            bubble1.VertAxis     = VerticalAxis.Both;
            bubble1.HorizAxis    = HorizontalAxis.Both;

            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue - 5, BaseChart.Chart.Axes.Left.MaxYValue + 5);
            BaseChart.Chart.Axes.Bottom.SetMinMax(0, BaseChart.Chart.Axes.Bottom.MaxXValue + 3);

            BaseChart.Chart.Axes.Bottom.Increment = 5;
            BaseChart.Chart.Axes.Left.Increment   = 15;

            BaseChart.Chart.Axes.Left.Labels.ValueFormat   = "0";
            BaseChart.Chart.Axes.Bottom.Labels.ValueFormat = "0";
            BaseChart.Chart.Axes.Left.Title.AutoSize       = true;
            BaseChart.Chart.Axes.Left.Title.Font.Size      = 14;
            BaseChart.Chart.Axes.Bottom.Title.Font.Size    = 14;
            BaseChart.Chart.Axes.Left.Title.Alignment      = Xamarin.Forms.TextAlignment.Center;

            BaseChart.Chart.Axes.Left.Visible         = true;
            BaseChart.Chart.Axes.Left.AxisPen.Visible = true;
            BaseChart.Chart.Axes.Left.Ticks           = new Axis.TicksPen {
                Width = 2, Visible = true, Color = Color.FromArgb(200, 200, 200), EndCap = PenLineCap.Flat, Style = DashStyle.Solid, Length = 10,
            };
            BaseChart.Chart.Axes.Bottom.Visible = true;

            BaseChart.Chart.Axes.Left.Title.Angle  = 90;
            BaseChart.Chart.Axes.Left.Grid.Visible = false;

            BaseChart.Chart.Axes.Bottom.Title.Text = "Number of products";
            BaseChart.Chart.Axes.Left.Title.Text   = "Sales";

            BaseChart.Chart.ClickSeries -= Chart_ClickSeries;

            // Themes Marks
            Themes.AplicarMarksTheme1(BaseChart);

            bubble1.Marks.ArrowLength                   = (int)bubble1.Pointer.VertSize;
            bubble1.Marks.TextAlign                     = Xamarin.Forms.TextAlignment.Center;
            bubble1.Marks.Font.Color                    = Color.Black;
            bubble1.Marks.Font.Size                     = 19;
            bubble1.Marks.Frame.Width                   = 85;
            bubble1.Marks.Width                         = 85;
            bubble1.Marks.Frame.Visible                 = true;
            bubble1.Marks.Transparent                   = false;
            bubble1.Marks.Frame.Transparency            = 0;
            bubble1.Marks.BackColor                     = Color.White;
            bubble1.Marks.Pen.Visible                   = true;
            bubble1.Marks.Pen.Width                     = 2;
            bubble1.Marks.Pen.Color                     = Color.Black;
            BaseChart.Chart.Axes.Left.Labels.CustomSize = 0;
            BaseChart.Chart.Panel.MarginLeft            = 4;
        }
Exemple #4
0
        public void Start()
        {
            for (int i = 0; i < COLOR_COUNT; i++)
            {
                int rNum = rand.Next(100, 255);

                Selection.Add(new Model
                {
                    Value           = -rNum,
                    Height          = HEIGHT,
                    BorderThickness = new Thickness(0),
                    Background      = new SolidColorBrush(Color.FromRgb((byte)rNum, 0, 0))
                });

                Insertion.Add(new Model
                {
                    Value           = rNum,
                    Height          = HEIGHT,
                    BorderThickness = new Thickness(0),
                    Background      = new SolidColorBrush(Color.FromRgb((byte)rNum, (byte)(rNum / 2), 0))
                });

                Heap.Add(new Model
                {
                    Value           = -rNum,
                    Height          = HEIGHT,
                    BorderThickness = new Thickness(0),
                    Background      = new SolidColorBrush(Color.FromRgb((byte)rNum, (byte)rNum, 0))
                });

                Bubble.Add(new Model
                {
                    Value           = rNum,
                    Height          = HEIGHT,
                    BorderThickness = new Thickness(0),
                    Background      = new SolidColorBrush(Color.FromRgb(0, (byte)rNum, 0))
                });

                Cocktail.Add(new Model
                {
                    Value           = rNum,
                    Height          = HEIGHT,
                    BorderThickness = new Thickness(0),
                    Background      = new SolidColorBrush(Color.FromRgb(0, (byte)rNum, (byte)rNum))
                });

                Circle.Add(new Model
                {
                    Value           = -rNum,
                    Height          = HEIGHT,
                    BorderThickness = new Thickness(0),
                    Background      = new SolidColorBrush(Color.FromRgb(0, (byte)(rNum / 1.5), (byte)rNum))
                });

                Merge.Add(new Model
                {
                    Value           = -rNum,
                    Height          = HEIGHT,
                    BorderThickness = new Thickness(0),
                    Background      = new SolidColorBrush(Color.FromRgb((byte)(rNum / 2), 0, (byte)rNum))
                });

                Quick.Add(new Model
                {
                    Value           = -rNum,
                    Height          = HEIGHT,
                    BorderThickness = new Thickness(0),
                    Background      = new SolidColorBrush(Color.FromRgb((byte)rNum, 0, (byte)rNum))
                });

                Shell.Add(new Model
                {
                    Value           = -rNum,
                    Height          = HEIGHT,
                    BorderThickness = new Thickness(0),
                    Background      = new SolidColorBrush(Color.FromRgb((byte)rNum, 0, (byte)(rNum / 2)))
                });
            }

            selectionSort = new SelectionSort(Selection);
            insertionSort = new InsertionSort(Insertion);
            heapSort      = new HeapSort(Heap);
            bubbleSort    = new BubbleSort(Bubble);
            cocktailSort  = new CocktailSort(Cocktail);
            circleSort    = new CircleSort(Circle);
            mergeSort     = new MergeSort(Merge);
            quickSort     = new QuickSort(Quick);
            shellSort     = new ShellSort(Shell);

            timer.Elapsed += new ElapsedEventHandler(Update);
            timer.Interval = UPDATE_SPEED;
            timer.Enabled  = true;
        }
        private void InitializeChart()
        {
            Charts = new List <TChart>();
            Charts.Add(tChart1);
            Charts.Add(tChart2);
            Charts.Add(tChart3);
            Charts.Add(tChart4);
            Charts.Add(tChart5);
            Charts.Add(tChart6);
            Charts.Add(tChart7);

            foreach (var item in Charts)
            {
                item.Aspect.View3D                = false;
                item.Header.Font.Color            = Utils.HexToColor("FFFFFFFF");
                item.Header.Font.Size             = 18;
                item.Header.Alignment             = TextAlignment.Left;
                item.Panel.Gradient.Visible       = false;
                item.Walls.Visible                = false;
                item.Legend.Visible               = false;
                item.Aspect.GestureOptions        = Steema.TeeChart.Store.Drawing.Aspect.Gestures.None;
                item.Axes.Bottom.Visible          = false;
                item.Axes.Left.AxisPen.Visible    = false;
                item.Axes.Left.Labels.Font.Color  = Utils.HexToColor("FFFFFFFF");
                item.Axes.Left.Grid.Color         = Utils.HexToColor("FFFFFFFF");
                item.Axes.Left.Ticks.Visible      = false;
                item.Axes.Left.MinorTicks.Visible = false;
            }

            tChart1.Panel.Color = Utils.HexToColor("FF66CDAA");
            tChart2.Panel.Color = Utils.HexToColor("FF0066CC");
            tChart3.Panel.Color = Utils.HexToColor("FFDC143C");
            tChart4.Panel.Color = Utils.HexToColor("FFFFA500");
            tChart5.Panel.Color = Utils.HexToColor("FFFF69B4");
            tChart6.Panel.Color = Utils.HexToColor("FFBA55D3");
            tChart7.Panel.Color = Utils.HexToColor("FF66CDAA");

            Bar bar = new Bar(tChart1.Chart);

            bar.Gradient.Visible     = true;
            bar.Gradient.StartColor  = Utils.HexToColor("FFFFFFFF");
            bar.Gradient.EndColor    = Colors.Transparent;
            bar.Pen.Visible          = false;
            bar.RoundSize            = 8;
            bar.BarRound             = BarRounding.AtValue;
            bar.BarStyle             = BarStyles.RoundRectangle;
            bar.Marks.Arrow.Visible  = false;
            bar.Marks.Brush.Color    = bar.Gradient.StartColor;
            bar.Marks.Pen.Visible    = false;
            bar.Marks.Font.Color     = tChart1.Panel.Color;
            bar.Marks.Shadow.Visible = false;
            bar.Marks.ShapeStyle     = Steema.TeeChart.Store.Drawing.TextShapeStyle.RoundRectangle;
            bar.FillSampleValues();
            Line line = new Line(tChart1.Chart);

            line.Color = Utils.HexToColor("FFFFFFFF");
            line.FillSampleValues();
            line.Smoothed = true;

            tChart1.Header.Text = "Lines and Bars";

            ActivityGauge world = new ActivityGauge(tChart2.Chart);
            Random        rnd   = new Random();

            tChart2.Panel.Color            = Colors.White;
            tChart2.Panel.Gradient.Visible = false;
            world.BackColor = Colors.White;
            world.Add(rnd.Next(100), Utils.FromArgb(135, 206, 250));
            world.Add(rnd.Next(100), Utils.FromArgb(102, 205, 170));
            world.Add(rnd.Next(100), Utils.FromArgb(220, 20, 60));
            world.Add(rnd.Next(100), Utils.FromArgb(255, 105, 180));
            world.Add(rnd.Next(100), Utils.FromArgb(186, 85, 211));

            tChart2.Header.Text       = "Gauges";
            tChart2.Header.Font.Color = Utils.FromArgb(186, 85, 211);


            CircularGauge gauge = new CircularGauge(tChart4.Chart);

            gauge.Frame.Visible = false;
            gauge.FaceBrush.Gradient.Visible    = false;
            gauge.FaceBrush.Color               = tChart4.Panel.Color;
            gauge.GreenLine.Pen.Visible         = false;
            gauge.GreenLine.Gradient.EndColor   = Utils.HexToColor("FFFDFDFD");
            gauge.GreenLine.Gradient.StartColor = Utils.HexToColor("FFC4C4C4");
            gauge.RedLine.Gradient.StartColor   = Utils.HexToColor("FFC4C4C4");
            gauge.RedLine.Gradient.EndColor     = Utils.HexToColor("FF848484");
            gauge.RedLine.Pen.Visible           = false;
            gauge.Ticks.Gradient.Visible        = false;
            gauge.Ticks.Color                 = Utils.HexToColor("FFFFFFFF");
            gauge.Ticks.Pen.Color             = Utils.HexToColor("FFFFFFFF");
            gauge.MinorTicks.Gradient.Visible = false;
            gauge.MinorTicks.Color            = Utils.HexToColor("FFFFFFFF");
            gauge.MinorTicks.Pen.Color        = Utils.HexToColor("FFFFFFFF");
            gauge.Hand.Gradient.Visible       = false;
            gauge.Hand.Color             = Utils.HexToColor("FFFDFDFD");
            gauge.Hand.Shadow.Visible    = false;
            gauge.Center.Shadow.Visible  = false;
            gauge.Axis.Labels.Font.Size  = 8;
            gauge.Axis.Labels.Font.Color = Utils.HexToColor("FFFFFFFF");
            gauge.Axis.AxisPen.Visible   = true;
            gauge.Axis.AxisPen.Color     = Utils.HexToColor("FFFFFFFF");
            gauge.FillSampleValues();
            tChart4.Header.Text = "Gauges";

            Bubble bubble = new Bubble(tChart5.Chart);

            bubble.ColorEach = false;
            bubble.Pointer.Gradient.Visible     = true;
            bubble.Pointer.Pen.Visible          = false;
            bubble.Pointer.Gradient.StartColor  = Utils.HexToColor("FFFFFFFF");
            bubble.Pointer.Gradient.EndColor    = Colors.Transparent;
            tChart5.Axes.Left.Labels.Font.Color = Colors.Transparent;
            bubble.Add(1, 1, 1);
            bubble.Add(2, 2, 10);
            bubble.Add(3, 3, 5);
            bubble.Add(4, 4, 3);
            bubble.Add(5, 5, 7);
            tChart5.Header.Text = "Bubbles and Gantt";

            Area area = new Area(tChart6.Chart);

            area.LinePen.Color       = Utils.HexToColor("FFFFFFFF");
            area.Gradient.Visible    = true;
            area.Gradient.StartColor = Utils.HexToColor("FFFFFFFF");
            area.Gradient.EndColor   = Colors.Transparent;
            area.Smoothed            = true;
            area.FillSampleValues();
            Area area1 = new Area(tChart6.Chart);

            area1.LinePen.Color       = Utils.HexToColor("FFFFFFFF");
            area1.Gradient.Visible    = true;
            area1.Gradient.StartColor = Utils.HexToColor("FFFFFFFF");
            area1.Gradient.EndColor   = Colors.Transparent;
            area1.Smoothed            = true;
            area1.FillSampleValues();
            tChart6.Axes.Left.Visible              = false;
            tChart6.Axes.Bottom.Visible            = true;
            tChart6.Header.Text                    = "Areas and Points";
            tChart6.Axes.Bottom.AxisPen.Visible    = false;
            tChart6.Axes.Bottom.Labels.Font.Color  = Utils.HexToColor("FFFFFFFF");
            tChart6.Axes.Bottom.Grid.Color         = Utils.HexToColor("FFFFFFFF");
            tChart6.Axes.Bottom.Ticks.Visible      = false;
            tChart6.Axes.Bottom.MinorTicks.Visible = false;
            tChart6.Axes.Bottom.Increment          = 10;
            tChart6.Axes.Bottom.Labels.Font.Size   = 10;

            Pie pie = new Pie(tChart3.Chart);

            pie.ColorEach = false;
            pie.Add(2, "Tables", Utils.HexToColor("FFFFFFFF"));
            pie.Add(1, "Chairs", Utils.HexToColor("FFF2F2F2"));
            pie.Add(1, "Sofas", Utils.HexToColor("FFDFDFDF"));
            pie.Add(1, "Cupboards", Utils.HexToColor("FFD7D7D7"));
            pie.AutoPenColor        = false;
            pie.Pen.Color           = tChart3.Panel.Color;
            pie.Pen.Width           = 3;
            pie.Circled             = true;
            pie.Marks.Brush.Visible = false;
            pie.Marks.Pen.Visible   = false;
            pie.Marks.Font.Color    = tChart3.Panel.Color;
            pie.Marks.Font.Size     = 6;
            pie.Marks.ArrowLength   = -20;
            pie.Marks.Arrow.Visible = false;
            pie.AutoCircleResize    = false;
            pie.BeforeDrawValues   += Pie_BeforeDrawValues;

            Donut donut = new Donut(tChart3.Chart);

            donut.ColorEach = false;
            donut.Circled   = true;
            donut.Add(2, "Tables", Utils.HexToColor("FFFFFFFF"));
            donut.Add(1, "Chairs", Utils.HexToColor("FFF2F2F2"));
            donut.Add(1, "Sofas", Utils.HexToColor("FFDFDFDF"));
            donut.Add(1, "Cupboards", Utils.HexToColor("FFD7D7D7"));
            donut.MarksPie.LegSize    = 10;
            donut.Marks.Brush.Visible = false;
            donut.Marks.Pen.Visible   = false;
            donut.Marks.Font.Color    = Utils.HexToColor("FFFFFFFF");
            donut.Marks.Font.Size     = 6;
            donut.Marks.Arrow.Color   = Utils.HexToColor("FFFFFFFF");
            donut.AutoPenColor        = false;
            donut.Pen.Color           = tChart3.Panel.Color;
            donut.Pen.Width           = 3;
            donut.AutoCircleResize    = false;
            donut.BeforeDrawValues   += Donut_BeforeDrawValues;
            tChart3.Header.Text       = "Pies and Donuts";


            Calendar calendar = new Calendar(tChart7.Chart);

            calendar.NextMonthButton.Visible     = false;
            calendar.PreviousMonthButton.Visible = false;
            tChart7.Header.Text = "Calendars";
        }