Example #1
0
        protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent)
        {
            base.OnPaintBackground(pevent);

            if (this.ChartLegendDescription.Items != null)
            {
                int         delta         = this.ChartLegendDescription.ItemFont.Height - this.ChartLegendDescription.ItemSize;
                Rectangle   iconRectangle = new Rectangle(this.ChartLegendDescription.LeftMargin + this.ChartLegendDescription.ItemLeftMargin, this.ChartLegendDescription.TopMargin + this.ChartLegendDescription.ItemTopMargin, this.ChartLegendDescription.ItemSize, this.ChartLegendDescription.ItemSize);
                Rectangle   textRectangle = new Rectangle(iconRectangle.X + iconRectangle.Width + this.ChartLegendDescription.ItemRightMargin, iconRectangle.Y - delta / 2, this.Width - this.ChartLegendDescription.LeftMargin - this.ChartLegendDescription.ItemLeftMargin - iconRectangle.Width, this.ChartLegendDescription.ItemFont.Height);
                IEnumerator Iterator      = this.ChartLegendDescription.Items.GetEnumerator();
                while (Iterator.MoveNext())
                {
                    ChartLegendItem currentItem = (ChartLegendItem)Iterator.Current;

                    // Draw item
                    currentItem.OnPaintBackground(pevent, this, iconRectangle, textRectangle);

                    // Next
                    iconRectangle.Y += this.ChartLegendDescription.ItemSize + this.ChartLegendDescription.ItemBottomMargin;
                    textRectangle.Y += this.ChartLegendDescription.ItemSize + this.ChartLegendDescription.ItemBottomMargin;
                }
            }

            // Draw main title
            this.DisplayTitle(pevent);
        }
Example #2
0
        virtual public ChartLegendItem  AddItem(Color itemColor, string text)
        {
            ChartLegendItem newItem = new ChartLegendItem(itemColor, text);

            this.ChartLegendDescription.Items.Add(newItem);
            return(newItem);
        }
Example #3
0
		virtual public ChartLegendItem	AddItem (Color itemColor, string text)
		{
			ChartLegendItem	newItem = new ChartLegendItem (itemColor, text);

			this.m_Items.Add (newItem);
			return newItem;
		}