示例#1
0
        public void Active(Size parentSize)
        {
            this.Size = new Size(parentSize.Width, parentSize.Height - 87);

            int rowSize  = 0;
            int dataSize = _section.Columns.Length - 1;

            if (dataSize % 2 == 0)
            {
                rowSize = dataSize / 2;
            }
            else
            {
                rowSize = (dataSize / 2) + 1;
            }

            int index = 1;

            for (int grpBoxIndex = 0; grpBoxIndex < this.Controls.Count; ++grpBoxIndex)
            {
                GroupBox grpBox = (GroupBox)this.Controls[grpBoxIndex];
                grpBox.Size     = new Size(this.Width / 2 - 16, this.Height / rowSize);
                grpBox.Location = new Point(
                    (this.Width / 2) * ((index - 1) / rowSize) + 6,
                    (this.Height / rowSize) * ((index - 1) % rowSize));

                MyChart chart = (MyChart)grpBox.Controls[0];
                chart.Size = new Size(grpBox.Width - 2, grpBox.Height - 18);
                chart.Series.Clear();
                chart.Series.Add(_section.Columns[grpBoxIndex + 1].Series);
                ++index;
            }
            this.Show();
        }
示例#2
0
        public void Active(Size parentSize)
        {
            this.Size = new Size(parentSize.Width, parentSize.Height - 87);

            if (this.Width >= 140 * (this.TabCount + 1))
            {
                this.ItemSize = new Size(140, 20);
            }
            else
            {
                this.ItemSize = new Size((this.Width - 10) / (this.TabCount + 1), 20);
            }

            for (int tabPageIndex = 0; tabPageIndex < this.TabPages.Count; ++tabPageIndex)
            {
                TabPage tabPage = this.TabPages[tabPageIndex];
                MyChart chart   = (MyChart)tabPage.Controls[0];
                chart.Size = new Size(this.Width - 2, this.Height - 60);
                chart.Series.Clear();
                chart.Series.Add(_section.Columns[tabPageIndex + 1].Series);
            }
            this.Show();
        }