Exemple #1
0
        // =================================================        DefaultView
        private void DefaultView ()
        {
            ClientSize = new Size (782, 683);

            RingSet rs = new RingSet (this, Auxi_Geometry .Middle (ClientRectangle), 40, 90, new double [] { 1, 2, 4, 8, 16 });
            rs .Rings [0] .SectorTexts = Auxi_Common .strDays;
            int newInner = rs .OuterMostRadius + 50;
            rs .AddRing (newInner, newInner + 50, Math .PI / 10, new double [] { 3, 3, 3 });

            double [] fVal = new double [] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            RingArea ring = new RingArea (this, new Point (0, 0), 240, 290, fVal);
            ring .Colors = Auxi_Colours .SmoothColorsList (fVal .Length, Color .Yellow, Color .Blue);
            ring .SectorTexts = Auxi_Common .strMonths;
            rs .AddRing (ring);
            ringsets .Add (rs);
        }
Exemple #2
0
        // -------------------------------------------------        Click_miAddNewRing
        private void Click_miAddNewRing (object sender, EventArgs e)
        {
            RingSet rs = ringsets [iRingSetTouched];
            Form_DefineNewRing form = new Form_DefineNewRing (2, 26);
            if (form .ShowDialog () == DialogResult .OK)
            {
                RingSet ringSrc = form .Ring;
                RingArea ring = new RingArea (this, rs .Center, rs .OuterMostRadius + 20,
                                              rs .OuterMostRadius + 20 + 2 * RingSet .MinimumAllowedWidth, ringSrc .Rings [0] .Values);
                ring .Colors = ringSrc .Rings [0] .Colors;
                for (int i = 0; i < ring .Comments .Count; i++)
                {
                    ring .Comments [i] .Text = ringSrc .Rings [0] .Comments [i] .Text;
                }
                rs .AddRing (ring);

                RenewMover ();
                Invalidate ();
            }
        }
Exemple #3
0
        // -------------------------------------------------        DefaultView
        private void DefaultView ()
        {
            ClientSize = new Size (811, 690);

            Font fntTitle = new Font ("Times New Roman", 12, FontStyle .Bold | FontStyle .Italic);
            Font fntSectors = new Font ("Times New Roman", 12);
            double angleTitle = 0;
            Color clrTitle = Color .Blue;

            RingSet rs = new RingSet (this, new Point (ClientRectangle .Width / 4, ClientRectangle .Height / 4),
                                            30, 80, new double [] { 1, 2, 4, 8, 16 });
            rs .Rings [0] .SectorTexts = Auxi_Common .strDays;
            int newInner = rs .OuterMostRadius;
            rs .AddRing (newInner, newInner + 50, Math .PI / 3, new double [] { 3, 7, 2, 9, 4 });
            newInner = rs .OuterMostRadius;
            double [] fVal = new double [] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            RingArea ring = new RingArea (this, new Point (0, 0), newInner, newInner + 75, fVal);
            ring .Colors = Auxi_Colours .SmoothColorsList (fVal .Length, Color .Yellow, Color .Blue);
            ring .SectorTexts = Auxi_Common .strMonths;
            rs .AddRing (ring);
            elems .Add (new SingleElem (rs));

            double [] fRandVal = Auxi_Common .RandomArray (1000, Auxi_Common .strDays .Length);
            PieChart chart = new PieChart (this, new Point (ClientRectangle .Width / 5, ClientRectangle .Height * 2 / 3),
                                           Math .Max (ClientRectangle .Width, ClientRectangle .Height) / 4, fRandVal);
            chart .SectorTexts = Auxi_Common .strDays;
            for (int i = 0; i < chart .Colors .Count; i++)
            {
                chart .ChangeColor (i, Auxi_Colours .ColorPredefined (i));
            }
            int nDifViews = Enum .GetNames (typeof (RoundPlotTextView)) .Length;
            for (int i = 0; i < chart .Sectors; i++)
            {
                chart .SectorComments [i] .TextView = (RoundPlotTextView) (Enum .GetValues (typeof (RoundPlotTextView)) .GetValue (i % nDifViews));
                chart .SectorComments [i] .Font = fntSectors;
            }
            chart .AddComment (-90, 0.2, DateTime .Now .ToShortTimeString (), fntTitle, angleTitle, clrTitle);
            elems .Insert (0, new SingleElem (chart));

            int nSector = 21;
            fRandVal = Auxi_Common .RandomArray (1000, nSector);
            rs = new RingSet (this, new Point (ClientRectangle .Width * 3 / 4, ClientRectangle .Height / 3),
                              40, Convert .ToInt32 (chart .Radius * 1.1), fRandVal);
            rs .Rings [0] .Colors = Auxi_Colours .SmoothColorsList (nSector, Color .White, Color .LightBlue);
            rs .AddComment (90, 0.3, "People", fntTitle, angleTitle, clrTitle);
            for (int i = 0; i < rs .Rings [0] .Sectors; i++)
            {
                rs .Rings [0] .Comments [i] .Text = Auxi_Common .StringOfText (Auxi_Common .strNames, i);
                rs .Rings [0] .Comments [i] .TextView = RoundPlotTextView .Text;
                rs .Rings [0] .Comments [i] .Angle = rs .Rings [0] .Comments [i] .AngleToCenter;
                rs .Rings [0] .Comments [i] .Font = fntSectors;
            }
            rs .Rings [0] .FixedSectorTextsAngles = false;
            rs .Rings [0] .EasyToReadOnRotation = true;
            elems .Insert (0, new SingleElem (rs));

            // barchart
            //
            int nSegment = Auxi_Common .strDays .Length - 2;
            int nSet = 4;
            double [,] fVals = new double [nSet, nSegment];
            for (int i = 0; i < nSet; i++)
            {
                for (int j = 0; j < nSegment; j++)
                {
                    fVals [i, j] = rand .Next (nSeed) % 1000;
                }
            }
            Rectangle rc = new Rectangle (ClientRectangle .Width / 2, ClientRectangle .Height / 2,
                                          ClientRectangle .Width * 3 / 7, ClientRectangle .Height * 2 / 5);
            BarChart barchart = new BarChart (this, rc, fVals, Side .S, Auxi_Common .strDays, TextsDrawingDirection .LTtoRB,
                                                               Side .E, 1000.0, 0.0, GridOrigin .ByStep, 200.0);
            barchart .FillCoefficients (0, 0.85);
            barchart .NumScale .ValuesFormat = "F0";
            barchart .AddComment (0.5, 0.1, "Default BarChart", new Font ("Times New Roman", 11, FontStyle .Bold), 0, Color .Red);
            elems .Insert (0, new SingleElem (barchart));
        }