private void PaintElement(ChartGraphics g, object element, ElementPosition position)
        {
            ChartPaintEventArgs e = new ChartPaintEventArgs(this, element, g, position);

            OnPrePaint(e);
            OnPostPaint(e);
        }
Beispiel #2
0
 internal ChartPaintEventArgs(Chart chart, object chartElement, ChartGraphics chartGraphics, ElementPosition position)
 {
     Chart         = chart;
     ChartElement  = chartElement;
     ChartGraphics = chartGraphics;
     Position      = position;
 }
Beispiel #3
0
		private void PaintElement (ChartGraphics g, object element, ElementPosition position)
		{
			ChartPaintEventArgs e = new ChartPaintEventArgs (this, element, g, position);

			OnPrePaint (e);
			OnPostPaint (e);
		}
Beispiel #4
0
		internal ChartPaintEventArgs (Chart chart, object chartElement, ChartGraphics chartGraphics, ElementPosition position)
		{
			Chart = chart;
			ChartElement = chartElement;
			ChartGraphics = chartGraphics;
			Position = position;
		}
        /// <summary>
        /// Determines whether the specified Object is equal to the current Object.
        /// </summary>
        /// <param name="obj">The Object to compare with the current Object.</param>
        /// <returns>true if the specified Object is equal to the current Object; otherwise, false.</returns>
        internal override bool EqualsInternal(object obj)
        {
            ElementPosition pos = obj as ElementPosition;

            if (pos != null)
            {
                if (this._auto == true && this._auto == pos._auto)
                {
                    return(true);
                }
                else if (this._x == pos._x && this._y == pos._y &&
                         this._width == pos._width && this._height == pos._height)
                {
                    return(true);
                }
            }
            return(false);
        }
        public void SetLegenedPosition(LegendPossition position)
        {
            foreach (ToolStripMenuItem menuItem in legendPossitionToolStripMenuItem.DropDownItems)
                menuItem.Checked = (LegendPossition)menuItem.Tag == position;

            ChartArea legendArea = chart1.ChartAreas["ChartAreaLegend"];

            switch (position)
            {
                case LegendPossition.Left:
                    legendArea.Position = new ElementPosition(0, 0, 9, 100);
                    legendArea.Tag = LegendPossition.Left;
                    chartArea.Position = new ElementPosition(10, 0, 90, 100);

                    break;

                case LegendPossition.Right:
                    legendArea.Position = new ElementPosition(91, 0, 9, 100);
                    legendArea.Tag = LegendPossition.Right;
                    chartArea.Position = new ElementPosition(0, 0, 90, 100);

                    break;

                case LegendPossition.Top:
                    legendArea.Position = new ElementPosition(0, 0, 100, 9);
                    legendArea.Tag = LegendPossition.Top;
                    chartArea.Position = new ElementPosition(0, 10, 100, 90);

                    break;

                case LegendPossition.Bottom:
                    legendArea.Position = new ElementPosition(0, 91, 100, 9);
                    legendArea.Tag = LegendPossition.Bottom;
                    chartArea.Position = new ElementPosition(0, 0, 100, 90);

                    break;
            }

            foreach (Legend legend in chart1.Legends)
                legend.Position = legendArea.Position;

            legendToolStripMenuItem.Visible = true;
            lastPossition = chartArea.Position;
        }