using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Runtime.InteropServices; using System.Windows.Forms; using DevComponents.Charts.TextMarkup; using DevComponents.DotNetBar.Charts.Style; namespace DevComponents.DotNetBar.Charts { /// /// Represents a Chart Control /// [ToolboxItem(true), ToolboxBitmap(typeof(ChartControl), "ChartControl.ico")] [Designer("DevComponents.Charts.Design.ChartControlDesigner, DevComponents.Charts.Design, Version=14.1.0.37, Culture=neutral, PublicKeyToken=90f470f34c89ccaf")] public class ChartControl : Control, INotifyPropertyChanged, IMessageFilter { #region Events #region DataBindingStart /// /// Occurs when the Chart is about to start a binding operation /// [Description("Occurs when the Chart is about to start a binding operation.")] public event EventHandler DataBindingStart; #endregion #region ChartDataBindingComplete /// /// Occurs when a Chart data binding operation is completed /// [Description("Occurs when a Chart data binding operation is completed.")] public event EventHandler ChartDataBindingComplete; #endregion #region ChartMatrixResized /// /// Occurs when a ChartMatrix has been resized. /// [Description("Occurs when a ChartMatrix has been resized.")] public event EventHandler ChartMatrixResized; #endregion #region CompareElements /// /// Occurs when the chart needs to compare 1 element with another /// [Description("Occurs when the chart needs to compare 1 element with another.")] public event EventHandler CompareElements; #endregion #region EmptyTextMarkupLinkClick /// /// Occurs when a ChartContainer's EmptyText MarkupLink has been clicked /// [Description("Occurs when a ChartContainer's EmptyText MarkupLink has been clicked.")] public event EventHandler EmptyTextMarkupLinkClick; #endregion #region GetPieCenterLabel /// /// Occurs when a Pie Center label is needed /// [Description("Occurs when a Pie Center label is needed.")] public event EventHandler GetPieCenterLabel; #endregion #region GetCrosshairAxisLabel /// /// Occurs when a Crosshair Axis label is needed /// [Description("Occurs when a Crosshair Axis label is needed.")] public event EventHandler GetCrosshairAxisLabel; #endregion #region GetCrosshairLabelHeader /// /// Occurs when a CrosshairLabel header is needed /// [Description("Occurs when a CrosshairLabel header is needed.")] public event EventHandler GetCrosshairLabelHeader; #endregion #region GetCrosshairLabelItem /// /// Occurs when a CrosshairLabel item (text) is needed /// [Description("Occurs when a CrosshairLabel item (text) is needed.")] public event EventHandler GetCrosshairLabelItem; #endregion #region GetSliceLabel /// /// Occurs when a Pie Slice label (text) is needed /// [Description("Occurs when a Pie Slice label (text) is needed.")] public event EventHandler GetSliceLabel; #endregion #region GetTickmarkLabel /// /// Occurs when a MajorTickmark label (text and color) is needed /// [Description("Occurs when a MajorTickmark label (text and color) is needed.")] public event EventHandler GetTickmarkLabel; #endregion #region GetToolTip /// /// Occurs when a Pie SeriesPoint ToolTip is needed /// [Description("Occurs when a Pie SeriesPoint ToolTip is needed.")] public event EventHandler GetToolTip; #endregion #region GetElementStyle /// /// Occurs when a ChartElement Style is needed. /// [Description("Occurs when a ChartElement Style is needed.")] public event EventHandler GetElementStyle; #endregion #region GetPieSeriesPointStyle /// /// Occurs when a PieSeriesPoint Style is needed. /// [Description("Occurs when a PieSeriesPoint Style is needed.")] public event EventHandler GetPieSeriesPointStyle; #endregion #region LayoutBoundsInvalid /// /// Occurs when layout bounds of the item is invalidated. /// public event EventHandler LayoutBoundsInvalid; #endregion #region LegendItemCheckedChanged /// /// Occurs when a LegendItem checked state has changed /// [Description("Occurs when a LegendItem checked state has changed.")] public event EventHandler LegendItemCheckedChanged; #endregion #region ChartMouseClick /// /// Occurs when a single click has ocurred on a chart Pie element. /// [Description("Occurs when a single click has ocurred on a chart Pie element.")] public event EventHandler ChartMouseClick; #endregion #region ChartMouseDoubleClick /// /// Occurs when a double click has ocurred on a chart Pie element. /// [Description("Occurs when a double click has ocurred on a chart Pie element.")] public event EventHandler ChartMouseDoubleClick; #endregion #region PieCenterMarkupLinkClick /// /// Occurs after a pie center MarkupLink has been clicked. /// [Description("Occurs after a pie center MarkupLink has been clicked.")] public event EventHandler PieCenterMarkupLinkClick; #endregion #region PieDetachChanged /// /// Occurs after a pie element detach was performed by the user. /// [Description("Occurs after a pie element detach was performed by the user.")] public event EventHandler PieDetachChanged; #endregion #region PieExplodeChanged /// /// Occurs after a pie explode operation was performed by the user. /// [Description("Occurs after a pie explode operation was performed by the user.")] public event EventHandler PieExplodeChanged; #endregion #region PieRingLevelChanged /// /// Occurs after a ring level change, as initiated /// by the user, has taken place. /// [Description("Occurs after a ring level change, as initiated by the user, has taken place.")] public event EventHandler PieRingLevelChanged; #endregion #region PieRingLevelChanging /// /// Occurs after a user has initiated a ring level change, but /// before the actual change has taken place. /// [Description("Occurs after a user has initiated a ring level change, but before the actual change has taken place.")] public event EventHandler PieRingLevelChanging; #endregion #region PieSelectionChanged /// /// Occurs after a pie selection was performed by the user. /// [Description("Occurs after a pie selection was performed by the user.")] public event EventHandler PieSelectionChanged; #endregion #region PointLabelUpdate /// /// Occurs when a PointLabel update is needed. /// [Description("Occurs when a PointLabel update is needed.")] public event EventHandler PointLabelUpdate; #endregion #region PostLoadLegendData /// /// Occurs after a Legend's data has been loaded. /// [Description("Occurs after a Legend's data has been loaded.")] public event EventHandler PostLoadLegendData; #endregion #region PostRenderContentBackground /// /// Occurs after a chart content area has been rendered. /// [Description("Occurs after a chart content area has been rendered.")] public event EventHandler PostRenderContentBackground; #endregion #region PostRenderFrameBackground /// /// Occurs after a chart Frame area has been rendered. /// [Description("Occurs after a chart Frame area has been rendered.")] public event EventHandler PostRenderFrameBackground; #endregion #region PostRenderPanelBackground /// /// Occurs after a chart Panel area has been rendered. /// [Description("Occurs after a chart Panel area has been rendered.")] public event EventHandler PostRenderPanelBackground; #endregion #region PostRenderPieCenterBackground /// /// Occurs after the pie center background has been rendered. /// [Description("Occurs after the pie center background has been rendered.")] public event EventHandler PostRenderPieCenterBackground; #endregion #region PostRenderPieCenterContent /// /// Occurs after the pie center content has been rendered. /// [Description("Occurs after the pie center content has been rendered.")] public event EventHandler PostRenderPieCenterContent; #endregion #region PostRenderPointConnector /// /// Occurs after a PointConnector has been rendered /// [Description("Occurs after a PointConnector has been rendered.")] public event EventHandler PostRenderPointConnector; #endregion #region PostRenderPointLabel /// /// Occurs after a PointLabel has been rendered /// [Description("Occurs after a PointLabel has been rendered.")] public event EventHandler PostRenderPointLabel; #endregion #region PostRenderRadialGrid /// /// Occurs after a radial grid has been rendered /// [Description("Occurs after a radial grid has been rendered.")] public event EventHandler PostRenderRadialGrid; #endregion #region PostRenderSeriesBar /// /// Occurs after a series bar has been rendered. /// [Description("Occurs after a series bar has been rendered.")] public event EventHandler PostRenderSeriesBar; #endregion #region PostRenderSeriesHiLoBar /// /// Occurs after a series HiLo Bar segment has been rendered. /// [Description("Occurs after a series HiLo Bar segment has been rendered.")] public event EventHandler PostRenderSeriesHiLoBar; #endregion #region PostRenderSeriesPoint /// /// Occurs after a series point has been rendered /// [Description("Occurs after a series point has been rendered.")] public event EventHandler PostRenderSeriesPoint; #endregion #region PostRenderSlice /// /// Occurs after the pie slice area has been rendered. /// [Description("Occurs after the pie slice area has been rendered.")] public event EventHandler PostRenderSlice; #endregion #region PreLoadLegendData /// /// Occurs prior to a Legend's data being loaded. /// [Description("Occurs prior to a Legend's data being loaded.")] public event EventHandler PreLoadLegendData; #endregion #region PreRenderContentBackground /// /// Occurs prior to the chart Content area being rendered. /// [Description("Occurs prior to the chart Content area being rendered.")] public event EventHandler PreRenderContentBackground; #endregion #region PreRenderFrameBackground /// /// Occurs prior to the chart Frame area being rendered. /// [Description("Occurs prior to the chart Frame area being rendered.")] public event EventHandler PreRenderFrameBackground; #endregion #region PreRenderPanelBackground /// /// Occurs prior to the chart Panel area being rendered. /// [Description("Occurs prior to the chart Panel area being rendered.")] public event EventHandler PreRenderPanelBackground; #endregion #region PreRenderPieCenterBackground /// /// Occurs prior to the pie center background being rendered. /// [Description("Occurs prior to the pie center background being rendered.")] public event EventHandler PreRenderPieCenterBackground; #endregion #region PreRenderPieCenterContent /// /// Occurs prior to the pie center content being rendered. /// [Description("Occurs prior to the pie center content being rendered.")] public event EventHandler PreRenderPieCenterContent; #endregion #region PreRenderPointConnector /// /// Occurs prior to a PointConnector being rendered /// [Description("Occurs prior to a PointConnector being rendered.")] public event EventHandler PreRenderPointConnector; #endregion #region PreRenderPointLabel /// /// Occurs prior to a PointLabel being rendered /// [Description("Occurs prior to a PointLabel being rendered.")] public event EventHandler PreRenderPointLabel; #endregion #region PreRenderRadialGrid /// /// Occurs prior to a radial (circular) grid being rendered. /// [Description("Occurs prior to a radial (circular) grid being rendered.")] public event EventHandler PreRenderRadialGrid; #endregion #region PreRenderSeriesBar /// /// Occurs prior to a series bar being rendered. /// [Description("Occurs prior to a series bar being rendered.")] public event EventHandler PreRenderSeriesBar; #endregion #region PreRenderSeriesHiLoBar /// /// Occurs prior to a series HiLo Bar segment being rendered. /// [Description("Occurs prior to a series HiLo Bar segment being rendered.")] public event EventHandler PreRenderSeriesHiLoBar; #endregion #region PreRenderSeriesPoint /// /// Occurs prior to a series point being rendered /// [Description("Occurs prior to a series point being rendered.")] public event EventHandler PreRenderSeriesPoint; #endregion #region PreRenderSlice /// /// Occurs prior to the pie slice area being rendered. /// [Description("Occurs prior to the pie slice area being rendered.")] public event EventHandler PreRenderSlice; #endregion #region ReferenceLineMarkupLinkClick /// /// Occurs when a ReferenceLine MarkupLink has been clicked /// [Description("Occurs when a ReferenceLine MarkupLink has been clicked.")] public event EventHandler ReferenceLineMarkupLinkClick; #endregion #region RenderCrosshairCallout /// /// Occurs when a Crosshair Callout (enclosing "border") needs to be rendered /// [Description("Occurs when a Crosshair Callout (enclosing border) needs to be rendered.")] public event EventHandler RenderCrosshairCallout; #endregion #region RenderCrosshairLabel /// /// Occurs when a CrosshairLabel needs to be rendered /// [Description("Occurs when a CrosshairLabel needs to be rendered.")] public event EventHandler RenderCrosshairLabel; #endregion #region RenderCrosshairLabelItem /// /// Occurs when an individual CrosshairLabel item needs to be rendered /// [Description("Occurs when an individual CrosshairLabel item needs to be rendered.")] public event EventHandler RenderCrosshairLabelItem; #endregion #region RenderPieRingOut /// /// Occurs when the pie center 'ring-out' indicator needs to be rendered. /// [Description("Occurs when the pie center 'ring-out' indicator needs to be rendered.")] public event EventHandler RenderPieRingOut; #endregion #region RenderSliceCenterLine /// /// Occurs when a pie slice center line needs to be rendered. /// [Description("Occurs when a pie slice center line needs to be rendered.")] public event EventHandler RenderSliceCenterLine; #endregion #region RenderSliceInnerLabel /// /// Occurs when a slice inner label needs to be rendered. /// [Description("Occurs when a slice inner label needs to be rendered.")] public event EventHandler RenderSliceInnerLabel; #endregion #region RenderSliceOuterLabel /// /// Occurs when a slice outer label needs to be rendered. /// [Description("Occurs when a slice outer label needs to be rendered.")] public event EventHandler RenderSliceOuterLabel; #endregion #region Scroll /// /// Occurs when the Horizontal or Vertical scrollbar has been scrolled /// [Description("Occurs when the Horizontal or Vertical scrollbar has been scrolled.")] public event EventHandler Scroll; #endregion #region ScrollMin /// /// Occurs when the Horizontal or Vertical /// scrollbar has been scrolled to the Minimum and released /// [Description("Occurs when the Horizontal or Vertical scrollbar has been scrolled to the Minimum and released.")] public event EventHandler ScrollMin; #endregion #region ScrollMax /// /// Occurs when the Horizontal or Vertical scrollbar has been scrolled to the Maximum and released /// [Description("Occurs when the Horizontal or Vertical scrollbar has been scrolled to the Maximum and released.")] public event EventHandler ScrollMax; #endregion #region SelectionChanged /// /// Occurs when a visual item's selected state has changed /// [Description("Occurs when a visual item's selected state has changed.")] public event EventHandler SelectionChanged; #endregion #region SeriesDataBindingComplete /// /// Occurs when a ChartSeries data binding operation is completed /// [Description("Occurs when a ChartSeries data binding operation is completed.")] public event EventHandler SeriesDataBindingComplete; #endregion #region StyleManagerChanged /// /// Occurs when the StyleManager style has changed /// [Description("Occurs when the StyleManager style has changed.")] public event EventHandler StyleManagerChanged; #endregion #region TitleMarkupLinkClick /// /// Occurs when a title MarkupLink has been clicked /// [Description("Occurs when a title MarkupLink has been clicked.")] public event EventHandler TitleMarkupLinkClick; #endregion #endregion #region Dll imports private const int WmMouseWheel = 0x20a; [DllImport("user32.dll")] private static extern IntPtr WindowFromPoint(Point pt); [DllImport("user32.dll")] private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); #endregion #region Private variables private States _States; private ChartPanel _ChartPanel; private object _DataSource; private string _DataMember; private DataBinder _DataBinder; private DefaultVisualStyles _BaseVisualStyles; private DefaultVisualStyles _DefaultVisualStyles; private ushort _BeginUpdateCount; private ushort _GlobalUpdateCount; private ushort _BoundsUpdateCount; private bool _InUpdateLayout; private bool _LayoutValid; private ChartVisualElement _LayoutBoundsItem; private Cursor _ChartCursor; private Cursor _DefaultCursor = Cursors.Default; private bool _SetChartCursor; private ChartVisualElement _CapturedItem; private ChartVisualElement _MouseOverElement; private bool _PostInternalUpdate; private int _SelectionUpdateCount; private bool _InPostUpdate; private System.Windows.Forms.ToolTip _ToolTip; private string _ToolTipText; #endregion /// /// Initializes a new instance of the ChartControl class. /// public ChartControl() { SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); InitDefaultStates(); UpdateChartStyle(); if (DesignMode == false) Application.AddMessageFilter(this); StyleManager.Register(this); } #region DefaultSize protected override Size DefaultSize { get { return new Size(250, 250); } } #endregion #region ScaleControl protected override void ScaleControl(SizeF factor, BoundsSpecified specified) { Dpi.SetScaling(factor); base.ScaleControl(factor, specified); } #endregion #region Scale /// /// Scales the ChartControl based upon the /// parent form AutoScaleDimensions. /// /// public void Scale(Form form) { if (form != null) { SizeF factor = new SizeF( form.AutoScaleDimensions.Width / 96F, form.AutoScaleDimensions.Height / 96F); Scale(factor); } } #endregion #region InitDefaultStates private void InitDefaultStates() { //SetState(States.AllowEdit, true); } #endregion #region Public properties #region BaseVisualStyles /// /// BaseVisualStyles - the ChartControl starting base styles /// [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DefaultVisualStyles BaseVisualStyles { get { return (_BaseVisualStyles); } internal set { _BaseVisualStyles = value; } } #endregion #region ChartCursor /// /// Gets or sets the logical Chart cursor /// [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Cursor ChartCursor { get { return (_ChartCursor); } set { if (value == null || value == Cursors.Default) _ChartCursor = _DefaultCursor; else _ChartCursor = value; } } #endregion #region ChartPanel /// /// Gets or sets the base Chart Panel for the Chart (contains Chart Graphs and additional Chart Panels) /// [Category("Appearance")] [Description("Indicates the base Chart Panel for the Chart (contains Chart Graphs and additional Chart Panels.")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public ChartPanel ChartPanel { get { if (_ChartPanel == null) { _ChartPanel = new ChartPanel("PrimaryPanel"); _ChartPanel.ChartControl = this; _ChartPanel.PropertyChanged += ChartPanelPropertyChanged; } return (_ChartPanel); } set { if (_ChartPanel != null) _ChartPanel.PropertyChanged -= ChartPanelPropertyChanged; _ChartPanel = value; if (value != null) { _ChartPanel.ChartControl = this; _ChartPanel.PropertyChanged += ChartPanelPropertyChanged; } OnPropertyChangedEx("ChartPanel", VisualChangeType.Layout); LayoutValid = false; } } #region ChartPanelPropertyChanged void ChartPanelPropertyChanged(object sender, PropertyChangedEventArgs e) { } #endregion #endregion #region DataMember /// /// Gets or sets the name of the list or table /// in the data source that the Chart is bound to. /// [DefaultValue(null), Category("Data")] [Description("Indicates the name of the list or table in the data source that the Chart is bound to.")] public string DataMember { get { return (_DataMember); } set { if (_DataBinder != null) _DataBinder.Clear(); _DataMember = value; OnPropertyChangedEx("DataMember", VisualChangeType.Layout); } } #endregion #region DataSource /// /// Gets or sets the data source that the Chart is bound to /// [DefaultValue(null), AttributeProvider(typeof(IListSource)), Category("Data")] [Description("Indicates the data source that the Chart is bound to.")] public object DataSource { get { return (_DataSource); } set { if (_DataBinder != null) _DataBinder.Clear(); _DataSource = value; OnPropertyChangedEx("DataSource", VisualChangeType.Layout); } } #endregion #region DefaultVisualStyles /// /// Gets or sets the Default Visual Styles for each Chart element /// [Browsable(true), Category("Style")] [Description("Gets or sets the Default Visual Styles for the each Invalidate element.")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public DefaultVisualStyles DefaultVisualStyles { get { if (_DefaultVisualStyles == null) { _DefaultVisualStyles = new DefaultVisualStyles(); DefaultVisualChangeHandler(null, _DefaultVisualStyles); } return (_DefaultVisualStyles); } set { if (_DefaultVisualStyles != value) { DefaultVisualStyles oldValue = _DefaultVisualStyles; _DefaultVisualStyles = value; OnDefaultVisualStyleChanged(oldValue, value); } } } #region OnDefaultVisualStyleChanged private void OnDefaultVisualStyleChanged( DefaultVisualStyles oldValue, DefaultVisualStyles newValue) { DefaultVisualChangeHandler(oldValue, newValue); OnPropertyChanged("DefaultVisualStyles"); } #endregion #region DefaultVisualChangeHandler private void DefaultVisualChangeHandler( DefaultVisualStyles oldValue, DefaultVisualStyles newValue) { if (oldValue != null) oldValue.PropertyChanged -= DefaultVisualStylesPropertyChanged; if (newValue != null) newValue.PropertyChanged += DefaultVisualStylesPropertyChanged; } #region DefaultVisualStylesPropertyChanged void DefaultVisualStylesPropertyChanged(object sender, PropertyChangedEventArgs e) { GlobalUpdateCount++; VisualChangeType changeType = ((VisualPropertyChangedEventArgs)e).ChangeType; if (changeType == VisualChangeType.Layout) ChartPanel.InvalidateLayout(); else ChartPanel.InvalidateRender(); } #endregion #endregion #endregion #region IsUpdateSuspended /// /// Gets whether Chart updating / rendering is suspended /// [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool IsUpdateSuspended { get { return (_BeginUpdateCount > 0); } } #endregion #region SelectedItems /// /// Gets a list of the currently selected chart items. /// [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public List SelectedItems { get { List selectedItems = new List(_SelectedItems); return (selectedItems); } } #endregion #region ToolTip internal System.Windows.Forms.ToolTip ToolTip { get { if (_ToolTip == null) _ToolTip = new System.Windows.Forms.ToolTip(); return (_ToolTip); } } #endregion #region ToolTipText internal string ToolTipText { get { return (_ToolTipText); } set { if (_ToolTipText != value) { _ToolTipText = value; ToolTip.SetToolTip(this, value); ToolTip.Active = (string.IsNullOrEmpty(value) == false); } } } #endregion #endregion #region Internal properties #region BoundsUpdateCount internal ushort BoundsUpdateCount { get { return (_BoundsUpdateCount); } set { _BoundsUpdateCount = value; } } #endregion #region CapturedItem internal ChartVisualElement CapturedItem { get { if (Capture == false) _CapturedItem = null; return (_CapturedItem); } set { Capture = ((_CapturedItem = value) != null); } } #endregion #region DataBinder internal DataBinder DataBinder { get { return (_DataBinder); } set { _DataBinder = value; } } #endregion #region DefaultCursor internal new Cursor DefaultCursor { get { return (_DefaultCursor); } set { _DefaultCursor = value; } } #endregion #region DesignerHosted internal bool DesignerHosted { get { return (DesignMode); } } #endregion #region GlobalUpdateCount internal ushort GlobalUpdateCount { get { return (_GlobalUpdateCount); } set { _GlobalUpdateCount = value; } } #endregion #region InUpdateLayout internal bool InUpdateLayout { get { return (_InUpdateLayout); } } #endregion #region IsPointLabelUpdateHooked internal bool IsPointLabelUpdateHooked { get { return (PointLabelUpdate != null); } } #endregion #region IsScrollHooked internal bool IsScrollHooked { get { return (Scroll != null); } } #endregion #region LayoutBoundsItem internal ChartVisualElement LayoutBoundsItem { get { return (_LayoutBoundsItem); } set { _LayoutBoundsItem = value; OnLayoutBoundsInvalid(EventArgs.Empty); } } #region OnLayoutBoundsInvalid /// /// Raises LayoutBoundsInvalid event. /// /// Provides event arguments. protected virtual void OnLayoutBoundsInvalid(EventArgs e) { if (LayoutBoundsInvalid != null) LayoutBoundsInvalid(this, e); } #endregion #endregion #region LayoutValid internal bool LayoutValid { get { return (_LayoutValid); } set { _LayoutValid = value; } } #endregion #region MouseOverElement internal ChartVisualElement MouseOverElement { get { return (_MouseOverElement); } set { _MouseOverElement = value; } } #endregion #region PostInternalUpdate internal bool PostInternalUpdate { get { return (_PostInternalUpdate); } set { _PostInternalUpdate = value; } } #endregion #region SelectionUpdateCount internal int SelectionUpdateCount { get { return (_SelectionUpdateCount); } set { _SelectionUpdateCount = value; } } #endregion #region SetChartCursor internal bool SetChartCursor { get { return (_SetChartCursor); } set { _SetChartCursor = value; } } #endregion #endregion #region Licensing #if !TRIAL private string _LicenseKey = ""; [Browsable(false), DefaultValue("")] public string LicenseKey { get { return _LicenseKey; } set { if (Licensing.ValidateLicenseKey(value) == false) _LicenseKey = (!Licensing.CheckLicenseKey(value) ? "9dsjkhds7" : value); } } #endif #endregion #region OnEnabledChanged /// /// OnEnabledChanged /// /// protected override void OnEnabledChanged(EventArgs e) { base.OnEnabledChanged(e); Refresh(); } #endregion #region StyleManager support #region StyleManagerStyleChanged /// /// Called by StyleManager to notify control that style on /// manager has changed and that control should refresh its /// appearance if its style is controlled by StyleManager. /// /// New active style. [EditorBrowsable(EditorBrowsableState.Never)] public void StyleManagerStyleChanged(eDotNetBarStyle newStyle) { UpdateChartStyle(); } #endregion #region UpdateChartStyle private void UpdateChartStyle() { ChartControlStyle style = ChartControlStyle.Office2010Blue; switch (StyleManager.Style) { case eStyle.Office2007VistaGlass: case eStyle.VisualStudio2010Blue: case eStyle.Windows7Blue: case eStyle.Office2007Blue: case eStyle.Office2010Blue: style = ChartControlStyle.Office2010Blue; break; case eStyle.Office2007Black: case eStyle.Office2010Black: style = ChartControlStyle.Office2010Black; break; case eStyle.Office2007Silver: case eStyle.Office2010Silver: style = ChartControlStyle.Office2010Silver; break; case eStyle.Metro: case eStyle.VisualStudio2012Dark: case eStyle.VisualStudio2012Light: style = ChartControlStyle.Metro; break; } _BaseVisualStyles = VisualStylesTable.GetStyle(style); if (IsHandleCreated == true) { Invalidate(true); if (StyleManagerChanged != null) StyleManagerChanged(this, new EventArgs()); } } #endregion #endregion #region Paint processing #region OnPaint /// /// Renders the control. /// /// Paint arguments. protected override void OnPaint(PaintEventArgs e) { if (IsUpdateSuspended == false) { SmoothingMode sm = e.Graphics.SmoothingMode; TextRenderingHint th = e.Graphics.TextRenderingHint; base.OnPaintBackground(e); if (LayoutValid == false || LayoutBoundsItem != null) UpdateLayout(e.Graphics); ChartRenderInfo renderInfo = GetRenderInfo(e); PaintControl(renderInfo); e.Graphics.SmoothingMode = sm; e.Graphics.TextRenderingHint = th; base.OnPaint(e); } } #endregion #region PaintControl private void PaintControl(ChartRenderInfo renderInfo) { if (ChartPanel.Visible == true) ChartPanel.Render(renderInfo); } #endregion #region PaintTo /// /// Paints control to canvas. This method might be used for print output. /// /// Graphics object to paint control to. public void PaintTo(Graphics g) { PaintTo(g, ClientRectangle); } /// /// Paints control to canvas. This method might be used for print output. /// /// Graphics object to paint control to. /// Indicates clipping rectangle. public void PaintTo(Graphics g, Rectangle clipRectangle) { SmoothingMode sm = g.SmoothingMode; TextRenderingHint th = g.TextRenderingHint; if (LayoutValid == false || LayoutBoundsItem != null) UpdateLayout(g); ChartRenderInfo renderInfo = GetRenderInfo(g, clipRectangle); PaintControl(renderInfo); g.SmoothingMode = sm; g.TextRenderingHint = th; } #endregion #endregion #region UpdateLayout /// /// OnHandleCreated /// /// protected override void OnHandleCreated(EventArgs e) { UpdateLayout(false); base.OnHandleCreated(e); } /// /// Performs Chart layout. /// public void UpdateLayout() { UpdateLayout(false); } /// /// Performs Chart layout. /// ///Whether to force operation even if layout is valid. public void UpdateLayout(bool force) { if (force == true) _LayoutValid = false; if (_LayoutValid == false || LayoutBoundsItem != null) { if (_InUpdateLayout == false) { using (Graphics g = CreateGraphics()) UpdateLayout(g); } } } internal ushort LayoutUpdateCount { get { return (_LayoutUpdateCount); } } internal ushort _LayoutUpdateCount; private void UpdateLayout(Graphics g) { if (ChartPanel.Visible == true) { if (_InUpdateLayout == false) { _InUpdateLayout = true; _LayoutUpdateCount++; try { ChartLayoutInfo layoutInfo = GetLayoutInfo(g); if (_LayoutValid == false) { ChartPanel.Measure(layoutInfo); layoutInfo.ClientBounds.Width = Math.Max(0, layoutInfo.ClientBounds.Width); layoutInfo.ClientBounds.Height = Math.Max(0, layoutInfo.ClientBounds.Height); _LayoutValid = true; _LayoutBoundsItem = ChartPanel; PostInternalMouseMove(); } if (LayoutBoundsItem != null) { layoutInfo = GetLayoutInfo(g); layoutInfo.ScrollOffset = GetScrollOffset(); LayoutBoundsItem.Arrange(layoutInfo); } LayoutBoundsItem = null; } finally { _InUpdateLayout = false; // If the user initiated an action during the paint event that // resulted in a layout change, process it now, as our associated // invalidation will be eaten by the Windows event system if (PostInternalUpdate == true) { PostInternalUpdate = false; if (_InPostUpdate == false) { _InPostUpdate = true; _LayoutValid = false; UpdateLayout(g); _InPostUpdate = false; } } } } } } #region GetScrollOffset private Point GetScrollOffset() { ChartContainer cc = LayoutBoundsItem.ParentChartContainer; if (cc != null) { Point pt = cc.ScrollOffset; if (LayoutBoundsItem is ChartLegend == false) { pt.X += cc.HScrollOffset; pt.Y += cc.VScrollOffset; } return (pt); } return (Point.Empty); } #endregion #region GetLayoutInfo private ChartLayoutInfo GetLayoutInfo(Graphics g) { ChartLayoutInfo layoutInfo = new ChartLayoutInfo(g, ClientRectangle); Rectangle r = ClientRectangle; layoutInfo.LayoutBounds = ClientRectangle; return (layoutInfo); } #endregion #region GetRenderInfo private ChartRenderInfo GetRenderInfo(PaintEventArgs e) { ChartRenderInfo renderInfo = new ChartRenderInfo(e.Graphics, Rectangle.Ceiling(e.ClipRectangle)); return (renderInfo); } private ChartRenderInfo GetRenderInfo(Graphics g, Rectangle clipRectangle) { ChartRenderInfo renderInfo = new ChartRenderInfo(g, Rectangle.Ceiling(clipRectangle)); return (renderInfo); } #endregion #endregion #region DoEvent support #region ChartMatrixResizedEvent /// /// Handles invocation of ChartMatrixResized events /// internal void DoChartMatrixResizedEvent(ChartPanel chartPanel) { if (ChartMatrixResized != null) { ChartMatrixResizedEventArgs ev = new ChartMatrixResizedEventArgs(chartPanel); ChartMatrixResized(this, ev); } } #endregion #region ChartTitleMarkupLinkClickEvent /// /// Handles invocation of ChartTitleMarkupLinkClick events /// internal void DoChartTitleMarkupLinkClickEvent(ChartNote title, HyperLink hyperLink) { if (TitleMarkupLinkClick != null) { ChartTitleMarkupLinkClickEventArgs ev = new ChartTitleMarkupLinkClickEventArgs(title, hyperLink.Name, hyperLink.HRef); TitleMarkupLinkClick(this, ev); } } #endregion #region DataBindingStartEvent /// /// Handles invocation of DataBindingStart events /// internal bool DoDataBindingStartEvent( BaseChart chartBase, object source, ref bool autogen) { if (DataBindingStart != null) { ChartDataBindingStartEventArgs ev = new ChartDataBindingStartEventArgs(chartBase, source, autogen); DataBindingStart(this, ev); autogen = ev.AutoGenerateSeries; return (ev.Cancel); } return (false); } #endregion #region ChartDataBindingCompleteEvent /// /// Handles invocation of ChartDataBindingComplete events /// internal void DoChartDataBindingCompleteEvent(BaseChart chartBase, object source) { if (ChartDataBindingComplete != null) { ChartDataBindingCompleteEventArgs ev = new ChartDataBindingCompleteEventArgs(chartBase, source); ChartDataBindingComplete(this, ev); } } #endregion #region ChartMouseClickEvent internal bool DoChartMouseClickEvent(BaseChart baseChart, PieSeriesPoint item, MouseEventArgs e) { if (ChartMouseClick != null) { ChartMouseClickEventArgs ev = new ChartMouseClickEventArgs(baseChart, item, e); ChartMouseClick(this, ev); return (ev.Cancel); } return (false); } #endregion #region ChartMouseDoubleClickEvent /// /// Handles invocation of ChartMouseDoubleClick events /// internal bool DoChartMouseDoubleClickEvent(BaseChart baseChart, ItemHitArea hitArea, ChartVisualElement hitElement, object hitItem, MouseEventArgs e) { if (ChartMouseDoubleClick != null) { ChartMouseDoubleClickEventArgs ev = new ChartMouseDoubleClickEventArgs(baseChart, hitArea, hitElement, hitItem, e); ChartMouseDoubleClick(this, ev); return (ev.Cancel); } return (false); } #endregion #region CompareElementsEvent /// /// Handles invocation of CompareElementsEvent events /// internal bool DoCompareElementsEvent( ChartVisualElement chartElement, object a, object b, ref int result) { if (CompareElements != null) { ChartCompareElementsEventArgs ev = new ChartCompareElementsEventArgs(chartElement, a, b); CompareElements(this, ev); result = ev.Result; return (ev.Cancel); } return (false); } #endregion #region EmptyTextMarkupLinkClickEvent /// /// Handles invocation of EmptyTextMarkupLinkClick events /// internal void DoEmptyTextMarkupLinkClickEvent(ChartContainer container, HyperLink hyperLink) { if (EmptyTextMarkupLinkClick != null) { ChartEmptyTextMarkupLinkClickEventArgs ev = new ChartEmptyTextMarkupLinkClickEventArgs(container, hyperLink.Name, hyperLink.HRef); EmptyTextMarkupLinkClick(this, ev); } } #endregion #region GetPieCenterLabelEvent internal void DoGetPieCenterLabelEvent(PieChart pieChart, ref string text) { if (GetPieCenterLabel != null) { GetPieCenterLabelEventArgs ev = new GetPieCenterLabelEventArgs(pieChart, text); GetPieCenterLabel(this, ev); text = ev.LabelText; } } #endregion #region GetCrosshairAxisLabelEvent internal void DoGetCrosshairAxisLabelEvent( ChartAxis axis, object value, ref string labelText) { if (GetCrosshairAxisLabel != null) { GetCrosshairAxisLabelEventArgs ev = new GetCrosshairAxisLabelEventArgs(axis, value, labelText); GetCrosshairAxisLabel(this, ev); labelText = ev.LabelText; } } #endregion #region GetCrosshairLabelHeaderEvent internal void DoGetCrosshairLabelHeaderEvent( BaseChart chart, CrosshairPoint cp, List cps, ref string text) { if (GetCrosshairLabelHeader != null) { GetCrosshairLabelHeaderEventArgs ev = new GetCrosshairLabelHeaderEventArgs(chart, cp, cps, text); GetCrosshairLabelHeader(this, ev); text = ev.Text; } } #endregion #region GetCrosshairLabelItemEvent internal void DoGetCrosshairLabelItemEvent( BaseChart chart, CrosshairPoint cp, ref string text) { if (GetCrosshairLabelItem != null) { GetCrosshairLabelItemEventArgs ev = new GetCrosshairLabelItemEventArgs(chart, cp, text); GetCrosshairLabelItem(this, ev); text = ev.Text; } } #endregion #region GetElementStyleEvent /// /// Handles invocation of GetElementStyle events /// internal void DoGetElementStyleEvent( ChartElement chartElement, StyleType styleType, ref BaseVisualStyle style) { if (GetElementStyle != null) { ChartGetElementStyleEventArgs ev = new ChartGetElementStyleEventArgs(chartElement, styleType, style); GetElementStyle(this, ev); style = ev.Style; } } #endregion #region GetElementStyleEvent /// /// Handles invocation of GetElementStyle events /// internal void DoGetPieSeriesPointStyleEvent( PieSeriesPoint pieSeriesPoint, StyleType styleType, ref BaseVisualStyle style) { if (GetPieSeriesPointStyle != null) { ChartGetPieSeriesPointStyleEventArgs ev = new ChartGetPieSeriesPointStyleEventArgs(pieSeriesPoint, styleType, style); GetPieSeriesPointStyle(this, ev); style = ev.Style; } } #endregion #region GetSliceLabelEvent internal bool DoGetSliceLabelEvent(PieChart pieChart, PieSeries chartSeries, PieSeriesPoint psp, bool inner, ref string text) { if (GetSliceLabel != null) { GetSliceLabelEventArgs ev = new GetSliceLabelEventArgs(pieChart, chartSeries, psp, inner, text); GetSliceLabel(this, ev); text = ev.Text; return (ev.Cancel); } return (false); } #endregion #region GetTickmarkLabelEvent internal void DoGetTickmarkLabelEvent( ChartAxis axis, object value, ref string labelText, ref Color labelColor) { if (GetTickmarkLabel != null) { GetTickmarkLabelEventArgs ev = new GetTickmarkLabelEventArgs(axis, value, labelText); GetTickmarkLabel(this, ev); labelText = ev.LabelText; labelColor = ev.LabelColor; } } #endregion #region GetToolTipEvent /// /// Handles invocation of GetToolTipEvent events /// internal bool DoGetToolTipEvent(BaseChart baseChart, BaseSeries baseSeries, SeriesPoint sp, ref string toolTip) { if (GetToolTip != null) { GetToolTipEventArgs ev = new GetToolTipEventArgs(baseChart, baseSeries, sp, toolTip); GetToolTip(this, ev); toolTip = ev.ToolTip; return (ev.Cancel); } return (false); } #endregion #region LegendItemCheckedChanged /// /// Handles invocation of LegendItemCheckedChanged events /// internal void DoLegendItemCheckedChangedEvent( ChartLegend legend, ChartLegendItem legendItem) { if (LegendItemCheckedChanged != null) { LegendItemCheckedChangedEventArgs ev = new LegendItemCheckedChangedEventArgs(legend, legendItem); LegendItemCheckedChanged(this, ev); } } #endregion #region PointLabelUpdateEvent /// /// Handles invocation of PointLabelUpdate events /// internal void DoPointLabelUpdateEvent( BaseChart chart, ChartSeries chartSeries, List pointLabels) { if (PointLabelUpdate != null) { ChartPointLabelUpdateEventArgs ev = new ChartPointLabelUpdateEventArgs(chart, chartSeries, pointLabels); PointLabelUpdate(this, ev); } } #endregion #region PieCenterMarkupLinkClick Event /// /// Handles invocation of PieCenterMarkupLinkClick events /// internal void DoPieCenterMarkupLinkClickEvent( PieChart pieChart, HyperLink hyperLink) { if (PieCenterMarkupLinkClick != null) { PieCenterMarkupLinkClickEventArgs ev = new PieCenterMarkupLinkClickEventArgs( pieChart, hyperLink.Name, hyperLink.HRef); PieCenterMarkupLinkClick(this, ev); } } #endregion #region PieDetachChangedEvent internal void DoPieDetachChangedEvent( PieChart pieChart, PieSeries pieSeries, PieSelectionMode psm) { if (PieDetachChanged != null) { PieDetachChangedEventArgs ev = new PieDetachChangedEventArgs(pieChart, pieSeries, psm); PieDetachChanged(this, ev); } } #endregion #region PieExplodeChangedEvent internal void DoPieExplodeChangedEvent(PieChart pieChart, PieSeries pieSeries) { if (PieExplodeChanged != null) { PieExplodeChangedEventArgs ev = new PieExplodeChangedEventArgs(pieChart, pieSeries); PieExplodeChanged(this, ev); } } #endregion #region PieRingLevelChanged internal void DoPieRingLevelChangedEvent( PieChart pieChart, PieSeriesPointCollection spcOld, PieSeriesPointCollection spcNew) { if (PieRingLevelChanged != null) { PieRingLevelChangedEventArgs ev = new PieRingLevelChangedEventArgs(pieChart, spcOld, spcNew); PieRingLevelChanged(this, ev); } } #endregion #region PieRingLevelChanging internal bool DoPieRingLevelChangingEvent( PieChart pieChart, PieSeriesPointCollection spcOld, PieSeriesPointCollection spcNew) { if (PieRingLevelChanging != null) { PieRingLevelChangingEventArgs ev = new PieRingLevelChangingEventArgs(pieChart, spcOld, spcNew); PieRingLevelChanging(this, ev); return (ev.Cancel); } return (false); } #endregion #region PieSelectionChangedEvent internal void DoPieSelectionChangedEvent( PieChart pieChart, PieSeries pieSeries, PieSeriesPoint psp, PieSelectionMode psm) { if (PieSelectionChanged != null) { PieSelectionChangedEventArgs ev = new PieSelectionChangedEventArgs(pieChart, pieSeries, psp, psm); PieSelectionChanged(this, ev); } } #endregion #region PostLoadLegendDataEvent internal void DoPostLoadLegendDataEvent(ChartLegend legend) { if (PostLoadLegendData != null) { PostLoadLegendDataEventArgs ev = new PostLoadLegendDataEventArgs(legend); PostLoadLegendData(this, ev); } } #endregion #region PostRenderContentBackgroundEvent internal void DoPostRenderContentBackgroundEvent(Graphics g, BaseChart chart, Rectangle r) { if (PostRenderContentBackground != null) { PostRenderContentBackgroundEventArgs ev = new PostRenderContentBackgroundEventArgs(g, chart, r); PostRenderContentBackground(this, ev); } } #endregion #region PostRenderFrameBackgroundEvent internal void DoPostRenderFrameBackgroundEvent(Graphics g, BaseChart chart, Rectangle r) { if (PostRenderFrameBackground != null) { PostRenderFrameBackgroundEventArgs ev = new PostRenderFrameBackgroundEventArgs(g, chart, r); PostRenderFrameBackground(this, ev); } } #endregion #region PostRenderPanelBackgroundEvent internal void DoPostRenderPanelBackgroundEvent(Graphics g, ChartPanel panel, Rectangle r) { if (PostRenderPanelBackground != null) { PostRenderPanelBackgroundEventArgs ev = new PostRenderPanelBackgroundEventArgs(g, panel, r); PostRenderPanelBackground(this, ev); } } #endregion #region PostRenderPieCenterBackgroundEvent internal void DoPostRenderPieCenterBackgroundEvent( Graphics g, PieChart pieChart, Rectangle rc) { if (PostRenderPieCenterBackground != null) { PostRenderPieCenterBackgroundEventArgs ev = new PostRenderPieCenterBackgroundEventArgs(g, pieChart, rc); PostRenderPieCenterBackground(this, ev); } } #endregion #region PostRenderPieCenterContentEvent internal void DoPostRenderPieCenterContentEvent( Graphics g, PieChart pieChart, Rectangle rt, string centerlabel) { if (PostRenderPieCenterContent != null) { PostRenderPieCenterContentEventArgs ev = new PostRenderPieCenterContentEventArgs(g, pieChart, rt, centerlabel); PostRenderPieCenterContent(this, ev); } } #endregion #region PostRenderPointConnectorEvent internal void DoPostRenderPointConnectorEvent(Graphics g, BaseChart chart, ChartSeries series, PointLabel pointLabel, bool isCrosshairPt, Point dataPt, Point labelPt) { if (PostRenderPointConnector != null) { PostRenderPointConnectorEventArgs ev = new PostRenderPointConnectorEventArgs(g, chart, series, pointLabel, isCrosshairPt, dataPt, labelPt); PostRenderPointConnector(this, ev); } } #endregion #region PostRenderPointLabelEvent internal void DoPostRenderPointLabelEvent(Graphics g, BaseChart chart, ChartSeries series, PointLabel pointLabel, bool isCrosshairPt, Rectangle bounds) { if (PostRenderPointLabel != null) { PostRenderPointLabelEventArgs ev = new PostRenderPointLabelEventArgs(g, chart, series, pointLabel, isCrosshairPt, bounds); PostRenderPointLabel(this, ev); } } #endregion #region PostRenderRadialGridEvent internal void DoPostRenderRadialGridEvent(Graphics g, PieChart pieChart, double outerRadius, double innerRadius, double exp) { if (PostRenderRadialGrid != null) { PostRenderRadialGridEventArgs ev = new PostRenderRadialGridEventArgs(g, pieChart, outerRadius, innerRadius, exp); PostRenderRadialGrid(this, ev); } } #endregion #region PostRenderSeriesBarEvent internal void DoPostRenderSeriesBarEvent(Graphics g, BaseChart chart, ChartSeries chartSeries, SeriesPoint sp, Rectangle r, Rectangle r2, BarSegment segment) { if (PostRenderSeriesBar != null) { PostRenderSeriesBarEventArgs ev = new PostRenderSeriesBarEventArgs(g, chart, chartSeries, sp, r, r2, segment); PostRenderSeriesBar(this, ev); } } #endregion #region PostRenderSeriesHiLoBarEvent internal void DoPostRenderSeriesHiLoBarEvent(Graphics g, ChartXy chartXy, ChartSeries chartSeries, HiLoRenderData rd, Point pt1, Point pt2, HiLoBarSegment segment) { if (PostRenderSeriesHiLoBar != null) { PostRenderSeriesHiLoBarEventArgs ev = new PostRenderSeriesHiLoBarEventArgs(g, chartXy, chartSeries, rd, pt1, pt2, segment); PostRenderSeriesHiLoBar(this, ev); } } #endregion #region PostRenderSeriesPointEvent internal void DoPostRenderSeriesPointEvent(Graphics graphics, BaseChart chart, ChartSeries chartSeries, SeriesPoint sp, Point pt, Size pointSize, Image marker) { if (PostRenderSeriesPoint != null) { PostRenderSeriesPointEventArgs ev = new PostRenderSeriesPointEventArgs(graphics, chart, chartSeries, sp, pt, pointSize, marker); PostRenderSeriesPoint(this, ev); } } #endregion #region PostRenderSliceEvent internal void DoPostRenderSliceEvent(Graphics g, GraphicsPath path, PieChart pieChart, PieSeries pieSeries, PieSeriesPoint psp, SliceRenderType rtype) { if (PostRenderSlice != null) { PostRenderSliceEventArgs ev = new PostRenderSliceEventArgs(g, path, pieChart, pieSeries, psp, rtype); PostRenderSlice(this, ev); } } #endregion #region PreLoadLegendDataEvent internal bool DoPreLoadLegendDataEvent(ChartLegend legend) { if (PreLoadLegendData != null) { PreLoadLegendDataEventArgs ev = new PreLoadLegendDataEventArgs(legend); PreLoadLegendData(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderContentBackgroundEvent internal bool DoPreRenderContentBackgroundEvent(Graphics g, BaseChart chart, Rectangle r) { if (PreRenderContentBackground != null) { PreRenderContentBackgroundEventArgs ev = new PreRenderContentBackgroundEventArgs(g, chart, r); PreRenderContentBackground(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderFrameBackgroundEvent internal bool DoPreRenderFrameBackgroundEvent(Graphics g, BaseChart chart, Rectangle r) { if (PreRenderFrameBackground != null) { PreRenderFrameBackgroundEventArgs ev = new PreRenderFrameBackgroundEventArgs(g, chart, r); PreRenderFrameBackground(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderPanelBackgroundEvent internal bool DoPreRenderPanelBackgroundEvent(Graphics g, ChartPanel panel, Rectangle r) { if (PreRenderPanelBackground != null) { PreRenderPanelBackgroundEventArgs ev = new PreRenderPanelBackgroundEventArgs(g, panel, r); PreRenderPanelBackground(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderPieCenterBackgroundEvent internal bool DoPreRenderPieCenterBackgroundEvent( Graphics g, PieChart pieChart, Rectangle rc) { if (PreRenderPieCenterBackground != null) { PreRenderPieCenterBackgroundEventArgs ev = new PreRenderPieCenterBackgroundEventArgs(g, pieChart, rc); PreRenderPieCenterBackground(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderPieCenterContentEvent internal bool DoPreRenderPieCenterContentEvent( Graphics g, PieChart pieChart, Rectangle rt, string centerlabel) { if (PreRenderPieCenterContent != null) { PreRenderPieCenterContentEventArgs ev = new PreRenderPieCenterContentEventArgs(g, pieChart, rt, centerlabel); PreRenderPieCenterContent(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderPointConnectorEvent internal bool DoPreRenderPointConnectorEvent(Graphics g, BaseChart chart, ChartSeries series, PointLabel pointLabel, bool isCrosshairPt, Point dataPt, Point labelPt) { if (PreRenderPointConnector != null) { PreRenderPointConnectorEventArgs ev = new PreRenderPointConnectorEventArgs(g, chart, series, pointLabel, isCrosshairPt, dataPt, labelPt); PreRenderPointConnector(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderPointLabelEvent internal bool DoPreRenderPointLabelEvent(Graphics g, BaseChart chart, ChartSeries series, PointLabel pointLabel, bool isCrosshairPt, Rectangle bounds) { if (PreRenderPointLabel != null) { PreRenderPointLabelEventArgs ev = new PreRenderPointLabelEventArgs(g, chart, series, pointLabel, isCrosshairPt, bounds); PreRenderPointLabel(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderRadialGridEvent internal bool DoPreRenderRadialGridEvent(Graphics g, PieChart pieChart, double outerRadius, double innerRadius, double exp) { if (PreRenderRadialGrid != null) { PreRenderRadialGridEventArgs ev = new PreRenderRadialGridEventArgs(g, pieChart, outerRadius, innerRadius, exp); PreRenderRadialGrid(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderSeriesBarEvent internal bool DoPreRenderSeriesBarEvent(Graphics g, BaseChart chart, ChartSeries chartSeries, SeriesPoint sp, Rectangle r, Rectangle r2, BarSegment segment) { if (PreRenderSeriesBar != null) { PreRenderSeriesBarEventArgs ev = new PreRenderSeriesBarEventArgs(g, chart, chartSeries, sp, r, r2, segment); PreRenderSeriesBar(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderSeriesHiloBarEvent internal bool DoPreRenderSeriesHiloBarEvent(Graphics g, ChartXy chartXy, ChartSeries chartSeries, HiLoRenderData rd, Point pt1, Point pt2, HiLoBarSegment segment) { if (PreRenderSeriesHiLoBar != null) { PreRenderSeriesHiLoBarEventArgs ev = new PreRenderSeriesHiLoBarEventArgs(g, chartXy, chartSeries, rd, pt1, pt2, segment); PreRenderSeriesHiLoBar(this, ev); return (ev.Cancel); } return (false); } #endregion #region PreRenderSeriesPointEvent internal bool DoPreRenderSeriesPointEvent(Graphics graphics, BaseChart chart, ChartSeries chartSeries, SeriesPoint sp, Point pt, Size pointSize, ref Image marker) { if (PreRenderSeriesPoint != null) { PreRenderSeriesPointEventArgs ev = new PreRenderSeriesPointEventArgs(graphics, chart, chartSeries, sp, pt, pointSize, marker); PreRenderSeriesPoint(this, ev); marker = ev.Marker; return (ev.Cancel || marker == null); } return (false); } #endregion #region PreRenderSliceEvent internal bool DoPreRenderSliceEvent(Graphics g, GraphicsPath path, PieChart pieChart, PieSeries pieSeries, PieSeriesPoint psp, SliceRenderType rtype) { if (PreRenderSlice != null) { PreRenderSliceEventArgs ev = new PreRenderSliceEventArgs(g, path, pieChart, pieSeries, psp, rtype); PreRenderSlice(this, ev); return (ev.Cancel); } return (false); } #endregion #region ReferenceLineMarkupLinkClickEvent /// /// Handles invocation of ReferenceLineMarkupLinkClick events /// internal void DoReferenceLineMarkupLinkClickEvent(ReferenceLine line, HyperLink hyperLink) { if (ReferenceLineMarkupLinkClick != null) { ReferenceLineMarkupLinkClickEventArgs ev = new ReferenceLineMarkupLinkClickEventArgs(line, hyperLink.Name, hyperLink.HRef); ReferenceLineMarkupLinkClick(this, ev); } } #endregion #region RenderCrosshairCalloutEvent /// /// Handles invocation of RenderCrosshairCallout events /// internal bool DoRenderCrosshairCalloutEvent(Graphics graphics, BaseChart chart, Rectangle bounds, Point pt, CrosshairVisualStyle cstyle) { if (RenderCrosshairCallout != null) { RenderCrosshairCalloutEventArgs ev = new RenderCrosshairCalloutEventArgs(graphics, chart, bounds, pt, cstyle); RenderCrosshairCallout(this, ev); return (ev.Cancel); } return (false); } #endregion #region RenderCrosshairLabelEvent /// /// Handles invocation of RenderCrosshairLabel events /// internal bool DoRenderCrosshairLabelEvent(Graphics graphics, BaseChart chart, List cps, Rectangle bounds, Point pt) { if (RenderCrosshairLabel != null) { RenderCrosshairLabelEventArgs ev = new RenderCrosshairLabelEventArgs(graphics, chart, cps, bounds, pt); RenderCrosshairLabel(this, ev); return (ev.Cancel); } return (false); } #endregion #region RenderCrosshairLabelItemEvent /// /// Handles invocation of RenderCrosshairLabelItem events /// internal bool DoRenderCrosshairLabelItemEvent(Graphics graphics, BaseChart chart, CrosshairPoint cp, Rectangle bounds, CrosshairVisualStyle cstyle) { if (RenderCrosshairLabelItem != null) { RenderCrosshairLabelItemEventArgs ev = new RenderCrosshairLabelItemEventArgs(graphics, chart, cp, bounds, cstyle); RenderCrosshairLabelItem(this, ev); return (ev.Cancel); } return (false); } #endregion #region RenderPieRingOutEvent internal bool DoRenderPieRingOutEvent(Graphics g, PieChart pieChart, Rectangle r) { if (RenderPieRingOut != null) { RenderPieRingOutEventArgs ev = new RenderPieRingOutEventArgs(g, pieChart, r); RenderPieRingOut(this, ev); return (ev.Cancel); } return (false); } #endregion #region RenderSliceCenterLineEvent internal bool DoRenderSliceCenterLineEvent(Graphics g, PieChart pieChart, PieSeriesPoint psp, Point ptInner, Point ptOuter) { if (RenderSliceCenterLine != null) { RenderSliceCenterLineEventArgs ev = new RenderSliceCenterLineEventArgs(g, pieChart, psp, ptInner, ptOuter); RenderSliceCenterLine(this, ev); return (ev.Cancel); } return (false); } #endregion #region RenderSliceInnerLabelEvent internal bool DoRenderSliceInnerLabelEvent(Graphics g, PieChart pieChart, PieSeriesPoint psp, string text, ref bool displayed) { if (RenderSliceInnerLabel != null) { RenderSliceInnerLabelEventArgs ev = new RenderSliceInnerLabelEventArgs(g, pieChart, psp, text, displayed); RenderSliceInnerLabel(this, ev); displayed = ev.Displayed; return (ev.Cancel); } return (false); } #endregion #region RenderSliceOuterLabelEvent internal bool DoRenderSliceOuterLabelEvent( Graphics g, PieChart pieChart, PieSeriesPoint psp, PieLabel pl) { if (RenderSliceOuterLabel != null) { RenderSliceOuterLabelEventArgs ev = new RenderSliceOuterLabelEventArgs(g, pieChart, psp, pl); RenderSliceOuterLabel(this, ev); return (ev.Cancel); } return (false); } #endregion #region ScrollEvent /// /// Handles invocation of Scroll events /// internal void DoScrollEvent(ChartContainer chartContainer, ScrollEventArgs args, ScrollBarLite sbar) { if (Scroll != null) { ChartScrollEventArgs ev = new ChartScrollEventArgs(chartContainer, args); Scroll(this, ev); } if (args.Type == ScrollEventType.EndScroll) { if (args.NewValue == 0) DoScrollMaxEvent(chartContainer, args); else if (args.NewValue + sbar.LargeChange >= sbar.Maximum) DoScrollMaxEvent(chartContainer, args); } } #endregion #region ScrollMinEvent /// /// Handles invocation of ScrollMin events /// internal void DoScrollMinEvent(ChartContainer chartContainer, ScrollEventArgs args) { if (ScrollMin != null) { ChartScrollEventArgs ev = new ChartScrollEventArgs(chartContainer, args); ScrollMin(this, ev); } } #endregion #region ScrollMaxEvent /// /// Handles invocation of ScrollMax events /// internal void DoScrollMaxEvent(ChartContainer chartContainer, ScrollEventArgs args) { if (ScrollMax != null) { ChartScrollEventArgs ev = new ChartScrollEventArgs(chartContainer, args); ScrollMax(this, ev); } } #endregion #region SelectionChanged /// /// Handles invocation of SelectionChanged events /// internal void DoSelectionChangedEvent( ChartVisualElement item, bool oldState, bool newState) { if (SelectionChanged != null) { SelectionChangedEventArgs ev = new SelectionChangedEventArgs(item, oldState, newState, _SelectedItems.Count); SelectionChanged(this, ev); } } #endregion #region SeriesDataBindingCompleteEvent /// /// Handles invocation of SeriesDataBindingComplete events /// internal void DoSeriesDataBindingCompleteEvent(BaseChart chartBase, BaseSeries series, object source) { if (SeriesDataBindingComplete != null) { SeriesDataBindingCompleteEventArgs ev = new SeriesDataBindingCompleteEventArgs(chartBase, series, source); SeriesDataBindingComplete(this, ev); } } #endregion #endregion #region Mouse Support #region OnMouseLeave /// /// OnMouseLeave /// /// protected override void OnMouseLeave(EventArgs e) { _ChartPanel.InternalMouseLeave(e); if (_MouseOverElement != null) { _MouseOverElement.InternalMouseLeave(e); _MouseOverElement = null; } base.OnMouseLeave(e); } #endregion #region OnMouseMove /// /// OnMouseMove /// /// protected override void OnMouseMove(MouseEventArgs e) { if (CapturedItem != null) { CapturedItem.InternalMouseMove(e); } else { ChartVisualElement item = _ChartPanel.GetElementAt(e.Location); if (item != null) item.InternalMouseMove(e); else _ChartPanel.InternalMouseMove(e); } base.OnMouseMove(e); base.Cursor = _ChartCursor; if (_ChartPanel.IsDesignerHosted == true) Cursor = Cursors.Arrow; } #endregion #region OnMouseDown /// /// OnMouseDown /// /// protected override void OnMouseDown(MouseEventArgs e) { Focus(); ChartVisualElement item = _ChartPanel.GetElementAt(e.Location); if (item != null) item.InternalMouseDown(e); else _ChartPanel.InternalMouseDown(e); base.OnMouseDown(e); } #endregion #region OnMouseUp /// /// OnMouseUp /// /// protected override void OnMouseUp(MouseEventArgs e) { if (CapturedItem != null) { CapturedItem.InternalMouseUp(e); } else { ChartVisualElement item = _ChartPanel.GetElementAt(e.Location); if (item != null) item.InternalMouseUp(e); else _ChartPanel.InternalMouseUp(e); } base.OnMouseUp(e); } #endregion #region OnMouseClick /// /// OnMouseClick /// /// protected override void OnMouseClick(MouseEventArgs e) { if (_MouseOverElement == null) { ChartVisualElement item = _ChartPanel.GetElementAt(e.Location); if (item != null) item.InternalMouseMove(e); else _ChartPanel.InternalMouseMove(e); } if (_MouseOverElement != null) _MouseOverElement.InternalMouseClick(e); base.OnMouseClick(e); } #endregion #region OnMouseDoubleClick /// /// OnMouseDoubleClick /// /// protected override void OnMouseDoubleClick(MouseEventArgs e) { if (_MouseOverElement == null) { ChartVisualElement item = _ChartPanel.GetElementAt(e.Location); if (item != null) item.InternalMouseMove(e); else _ChartPanel.InternalMouseMove(e); } if (_MouseOverElement != null) _MouseOverElement.InternalMouseDoubleClick(e); base.OnMouseDoubleClick(e); } #endregion #endregion #region GetElementAt public ChartVisualElement GetElementAt(Point pt) { ChartVisualElement item = ChartPanel.GetElementAt(pt); return (item ?? ChartPanel); } #endregion #region GetSerialData internal SerialElementCollection GetSerialData(bool root) { SerialElementCollection sec = new SerialElementCollection(); if (root == true) sec.AddStartElement("ChartControl"); sec.AddValue("DataMember", DataMember, null); //sec.AddValue("DataSource", DataSource, null); if (_DefaultVisualStyles != null && _DefaultVisualStyles.IsEmpty == false) sec.AddElement(_DefaultVisualStyles.GetSerialData()); sec.AddElement(ChartPanel.GetSerialData("")); if (root == true) sec.AddEndElement("ChartControl"); return (sec); } #endregion #region PostInternalMouseMove internal void PostInternalMouseMove() { Point pt = PointToClient(Control.MousePosition); if (ClientRectangle.Contains(pt) == true) Cursor.Position = Cursor.Position; } #endregion #region Cursor /// /// Cursor /// public override Cursor Cursor { get { return (base.Cursor); } set { base.Cursor = value; if (SetChartCursor == true) ChartCursor = value; else DefaultCursor = value; } } #endregion #region OnResize protected override void OnResize(EventArgs e) { base.OnResize(e); if (ChartPanel != null) ChartPanel.InternalOnResize(e); } #endregion #region Selection Support private List _SelectedItems = new List(); public bool GetSelected(ChartContainer item) { if (item.ChartControl == null) throw new Exception("Items must be a member of the ChartControl"); return (_SelectedItems.IndexOf(item) >= 0); } public void SetSelected(ChartContainer item, bool select) { SetSelectedEx(item, select, true); } #region SetSelectedEx internal void SetSelectedEx(ChartContainer item, bool select, bool sendEvent) { int index = _SelectedItems.IndexOf(item); if (select == false) { if (index >= 0) { _SelectedItems.RemoveAt(index); item.IsSelected = false; if (sendEvent == true) OnSelectionChanged(item, true, false); } } else { if (index < 0) { _SelectedItems.Add(item); item.IsSelected = true; if (sendEvent == true) OnSelectionChanged(item, false, true); } } } #region OnSelectionChanged private void OnSelectionChanged(ChartContainer item, bool oldState, bool newState) { DoSelectionChangedEvent(item, oldState, newState); } #endregion #endregion #region ClearAllSelected /// /// Clears all selected items /// public void ClearAllSelected() { for (int i=_SelectedItems.Count - 1; i>=0; i--) SetSelectedEx(_SelectedItems[i], false, true); } #endregion #endregion #region Update support /// /// Calling the BeginUpdate routine informs the Chart Control /// that an extended update phase has begun. The Chart Control /// will suspend all layout calculations and display updates /// until the corresponding EndUpdate routine is called. /// /// BeginUpdate / EndUpdate can be nested and must be /// called in pairs – every BeginUpdate must have a /// matching EndUpdate call. /// public void BeginUpdate() { _BeginUpdateCount++; } /// /// Calling the EndUpdate routine informs the Chart Control /// that an extended update phase has ended. /// /// BeginUpdate / EndUpdate can be nested and must be /// called in pairs – every EndUpdate must have a /// matching BeginUpdate call. /// public void EndUpdate() { if (_BeginUpdateCount > 0) { if (--_BeginUpdateCount == 0) ChartPanel.InvalidateLayout(); } } #endregion #region InvalidateRender /// /// Invalidates render of the chart element. /// /// Element to invalidate rendering for. internal void InvalidateRender(ChartVisualElement chartElement) { Rectangle bounds = chartElement.Bounds; if (bounds.IsEmpty == false) Invalidate(bounds, true); } internal void InvalidateRender(Rectangle bounds) { Invalidate(bounds, InvokeRequired == false); } #endregion #region PreFilterMessage public bool PreFilterMessage(ref Message m) { if (IsDisposed == true) return (false); if (DesignMode == true || Enabled == false) return (false); if (ContainsFocus == true || m.Msg == WmMouseWheel) { if (m.Msg == WmMouseWheel) { Point pt = new Point(LoWord(m.LParam), HiWord(m.LParam)); IntPtr hWnd = WindowFromPoint(pt); if (hWnd != IntPtr.Zero) { Control ctl = Control.FromHandle(hWnd); if (ctl == this) { pt = PointToClient(pt); MouseEventArgs e = new MouseEventArgs(MouseButtons.None, 0, pt.X, pt.Y, HiWord(m.WParam)); ChartVisualElement item = _ChartPanel.GetElementAt(pt); if (item != null) item.InternalMouseWheel(e); else _ChartPanel.InternalMouseWheel(e); return (true); } } } } return (false); } #region HiWord / LoWord private int LoWord(int n) { return (short)(n & 0xffff); } private int HiWord(int n) { return (n >> 0x10); } private int LoWord(IntPtr n) { return LoWord((int)((long)n)); } private int HiWord(IntPtr n) { return HiWord((int)((long)n)); } #endregion #endregion #region INotifyPropertyChanged Members /// /// Occurs when property value has changed. /// public event PropertyChangedEventHandler PropertyChanged; /// /// Default PropertyChanged processing /// /// /// invalidate protected void OnPropertyChangedEx(string s, VisualChangeType changeType) { OnPropertyChanged(s); if (changeType == VisualChangeType.Layout) Invalidate(); else Invalidate(); } /// /// Raises the PropertyChanged event. /// /// Event arguments protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) handler(this, e); } /// /// Default PropertyChanged processing /// /// protected void OnPropertyChanged(string s) { if (PropertyChanged != null) OnPropertyChanged(new PropertyChangedEventArgs(s)); } #endregion #region States [Flags] private enum States : uint { } #region TestState private bool TestState(States state) { return ((_States & state) == state); } #endregion #region SetState private void SetState(States state, bool value) { if (value == true) _States |= state; else _States &= ~state; } #endregion #endregion } #region enum #region AutoScrollEnable [Flags] internal enum AutoScrollEnable { None = 0, Vertical = (1 << 0), Horizontal = (1 << 1), } #endregion #region SortDirection public enum SortDirection { None = 0, Ascending = 1, Descending = 2, } #endregion #endregion #region EventArgs #region ChartCancelEventArgs /// /// ChartCancelEventArgs /// public class ChartCancelEventArgs : ChartEventArgs { #region Private variables private bool _Cancel; #endregion /// /// ChartCancelEventArgs /// ///Associated Chart public ChartCancelEventArgs(BaseChart chartBase) : base(chartBase) { } #region Public properties /// /// Gets or sets whether to cancel the default operation. /// public bool Cancel { get { return (_Cancel); } set { _Cancel = value; } } #endregion } #endregion #region GridCompareElementsEventArgs /// /// GridCompareElementsEventArgs /// public class ChartCompareElementsEventArgs : CancelEventArgs { #region Private variables private ChartVisualElement _ChartElement; private object _ElementA; private object _ElementB; private int _Result; #endregion /// /// ChartCompareElementsEventArgs /// /// /// /// public ChartCompareElementsEventArgs( ChartVisualElement chartElement, object a, object b) { _ChartElement = chartElement; _ElementA = a; _ElementB = b; } #region Public properties /// /// Gets the visual ChartElement associated with the sort. /// public ChartVisualElement ChartElement { get { return (_ChartElement); } } /// /// Gets the left-hand element of the comparison /// public object ElementA { get { return (_ElementA); } } /// /// Gets the right-hand element of the comparison /// public object ElementB { get { return (_ElementB); } } /// /// Gets or sets the result of the element compare. /// -1 = ElementA is less than ElementB /// 0 = ElementA is equal to ElementB /// +1 = ElementA is greater than ElementB /// public int Result { get { return (_Result); } set { _Result = value; } } #endregion } #endregion #region ChartEventArgs /// /// ChartEventArgs /// public class ChartEventArgs : EventArgs { #region Private variables private BaseChart _Chart; #endregion /// /// ChartControlEventArgs /// ///Associated ChartControl public ChartEventArgs(BaseChart chart) { _Chart = chart; } #region Public properties /// /// Gets the associated Chart /// public BaseChart Chart { get { return (_Chart); } } #endregion } #endregion #region ChartDataBindingCompleteEventArgs /// /// ChartDataBindingCompleteEventArgs /// public class ChartDataBindingCompleteEventArgs : ChartEventArgs { #region Private variables private object _Source; #endregion /// /// ChartDataBindingCompleteEventArgs /// /// public ChartDataBindingCompleteEventArgs(BaseChart chart, object source) : base(chart) { _Source = source; } #region Public properties /// /// Gets the data source that was bound to. /// public object Source { get { return (_Source); } } #endregion } #endregion #region ChartDataBindingStartEventArgs /// /// ChartDataBindingStartEventArgs /// public class ChartDataBindingStartEventArgs : ChartCancelEventArgs { #region Private variables private bool _AutoGenerateSeries; private object _Source; #endregion /// /// ChartDataBindingStartEventArgs /// ///Associated ChartControl ///Associated ChartPanel ///The data source being bound to ///Whether to auto-generate panel series public ChartDataBindingStartEventArgs( BaseChart chartBase, object source, bool autoGenerateSeries) : base(chartBase) { _Source = source; _AutoGenerateSeries = autoGenerateSeries; } #region Public properties /// /// Gets or sets whether to auto-generate /// the the panel series from the bound data. /// public bool AutoGenerateSeries { get { return (_AutoGenerateSeries); } set { _AutoGenerateSeries = value; } } /// /// Gets the associated data source being bound to. /// public object Source { get { return (_Source); } } #endregion } #endregion #region ChartEmptyTextMarkupLinkClickEventArgs /// /// ChartEmptyTextMarkupLinkClickEventArgs /// public class ChartEmptyTextMarkupLinkClickEventArgs : EventArgs { #region Private variables private string _HRef; private string _Name; private ChartContainer _ChartContainer; #endregion /// /// ChartEmptyTextMarkupLinkClickEventArgs /// /// /// /// /// public ChartEmptyTextMarkupLinkClickEventArgs( ChartContainer chartContainer, string name, string href) { _HRef = href; _Name = name; _ChartContainer = chartContainer; } #region Public properties /// /// Gets the associated HyperLink HRef /// public string HRef { get { return (_HRef); } } /// /// Gets the associated HyperLink Name /// public string Name { get { return (_Name); } } /// /// Gets the associated ChartContainer /// public ChartContainer ChartContainer { get { return (_ChartContainer); } } #endregion } #endregion #region ChartGetElementStyleEventArgs /// /// ChartGetElementStyleEventArgs /// public class ChartGetElementStyleEventArgs : EventArgs { #region Private variables private ChartElement _ChartElement; private StyleType _StyleType; private BaseVisualStyle _Style; #endregion /// /// ChartGetElementStyleEventArgs /// public ChartGetElementStyleEventArgs( ChartElement chartElement, StyleType styleType, BaseVisualStyle style) { _ChartElement = chartElement; _StyleType = styleType; _Style = style; } #region Public properties /// /// Gets the ChartElement. /// public ChartElement ChartElement { get { return (_ChartElement); } } /// /// Gets the StyleType. /// public StyleType StyleType { get { return (_StyleType); } } /// /// Gets the Style. /// public BaseVisualStyle Style { get { return (_Style); } set { if (value == null) throw new Exception("Style cannot be null."); _Style = value; } } #endregion } #endregion #region ChartGetPieSeriesPointStyleEventArgs /// /// ChartGetPieSeriesPointStyleEventArgs /// public class ChartGetPieSeriesPointStyleEventArgs : EventArgs { #region Private variables private PieSeriesPoint _PieSeriesPoint; private StyleType _StyleType; private BaseVisualStyle _Style; #endregion /// /// ChartGetPieSeriesPointStyleEventArgs /// /// /// /// public ChartGetPieSeriesPointStyleEventArgs( PieSeriesPoint pieSeriesPoint, StyleType styleType, BaseVisualStyle style) { _PieSeriesPoint = pieSeriesPoint; _StyleType = styleType; _Style = style; } #region Public properties /// /// Gets the PieSeriesPoint. /// public PieSeriesPoint PieSeriesPoint { get { return (_PieSeriesPoint); } } /// /// Gets the StyleType. /// public StyleType StyleType { get { return (_StyleType); } } /// /// Gets the Style. /// public BaseVisualStyle Style { get { return (_Style); } set { if (value == null) throw new Exception("Style cannot be null."); _Style = value; } } #endregion } #endregion #region ChartMatrixResizedEventArgs /// /// ChartMatrixResizedEventArgs /// public class ChartMatrixResizedEventArgs : EventArgs { #region Private variables private ChartPanel _ChartPanel; #endregion /// /// ChartMatrixResizedEventArgs /// /// public ChartMatrixResizedEventArgs(ChartPanel chartPanel) { _ChartPanel = chartPanel; } #region Public properties /// /// Gets the associated ChartPanel /// public ChartPanel ChartPanel { get { return (_ChartPanel); } } #endregion } #endregion #region ChartMouseClickEventArgs /// /// ChartMouseClickEventArgs /// public class ChartMouseClickEventArgs : CancelEventArgs { #region Private variables private BaseChart _BaseChart; private object _HitItem; private MouseEventArgs _MouseEventArgs; #endregion /// /// ChartMouseClickEventArgs /// /// /// /// public ChartMouseClickEventArgs(BaseChart baseChart, object item, MouseEventArgs e) { _BaseChart = baseChart; _HitItem = item; _MouseEventArgs = e; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart BaseChart { get { return (_BaseChart); } } /// /// Gets the associated hit item. /// public object HitItem { get { return (_HitItem); } } /// /// Gets the associated MouseEventArgs /// public MouseEventArgs MouseEventArgs { get { return (_MouseEventArgs); } } #endregion } #endregion #region ChartMouseDoubleClickEventArgs /// /// ChartMouseDoubleClickEventArgs /// public class ChartMouseDoubleClickEventArgs : CancelEventArgs { #region Private variables private BaseChart _BaseChart; private ItemHitArea _HitArea; private ChartVisualElement _HitElement; private object _HitItem; private MouseEventArgs _MouseEventArgs; #endregion /// /// ChartMouseDoubleClickEventArgs /// /// /// /// /// public ChartMouseDoubleClickEventArgs(BaseChart baseChart, ItemHitArea hitArea, ChartVisualElement hitElement, object hitItem, MouseEventArgs e) { _BaseChart = baseChart; _HitArea = hitArea; _HitItem = hitItem; _HitElement = hitElement; _MouseEventArgs = e; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart BaseChart { get { return (_BaseChart); } } /// /// Gets the associated hit area. /// public ItemHitArea HitArea { get { return (_HitArea); } } /// /// Gets the associated hit item. /// public object HitItem { get { return (_HitItem); } } /// /// Gets the associated hit Visual Chart Element. /// public ChartVisualElement HitElement { get { return (_HitElement); } } /// /// Gets the associated MouseEventArgs /// public MouseEventArgs MouseEventArgs { get { return (_MouseEventArgs); } } #endregion } #endregion #region ChartPanelCancelEventArgs /// /// ChartPanelCancelEventArgs /// public class ChartPanelCancelEventArgs : ChartPanelEventArgs { #region Private variables private bool _Cancel; #endregion /// /// ChartPanelCancelEventArgs /// ///Associated ChartControl ///Associated ChartPanel public ChartPanelCancelEventArgs(ChartPanel chartPanel) : base(chartPanel) { } #region Public properties /// /// Gets or sets whether to cancel the default operation. /// public bool Cancel { get { return (_Cancel); } set { _Cancel = value; } } #endregion } #endregion #region ChartPanelEventArgs /// /// ChartPanelEventArgs /// public class ChartPanelEventArgs : EventArgs { #region Private variables private ChartPanel _ChartPanel; #endregion /// /// ChartPanelEventArgs /// ///Associated ChartControl ///Associated ChartPanel public ChartPanelEventArgs(ChartPanel chartPanel) { _ChartPanel = chartPanel; } #region Public properties /// /// Gets the associated ChartPanel /// public ChartPanel ChartPanel { get { return (_ChartPanel); } } #endregion } #endregion #region ChartPointLabelUpdateEventArgs /// /// ChartPointLabelUpdateEventArgs /// public class ChartPointLabelUpdateEventArgs : EventArgs { #region Private variables private BaseChart _Chart; private ChartSeries _ChartSeries; private List _PointLabels; #endregion /// /// ChartPointLabelUpdateEventArgs /// public ChartPointLabelUpdateEventArgs( BaseChart chart, ChartSeries chartSeries, List pointLabels) { _Chart = chart; _ChartSeries = chartSeries; _PointLabels = pointLabels; } #region Public properties /// /// Gets the associated BaseChart. /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries. /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated list of PointLabels. /// public List PointLabels { get { return (_PointLabels); } } #endregion } #endregion #region ChartScrollEventArgs /// /// ChartScrollEventArgs /// public class ChartScrollEventArgs : EventArgs { #region Private variables private ChartContainer _ChartContainer; private ScrollEventArgs _ScrollEventArgs; #endregion /// /// ChartScrollEventArgs /// /// /// public ChartScrollEventArgs( ChartContainer chartContainer, ScrollEventArgs scrollEventArgs) { _ChartContainer = chartContainer; _ScrollEventArgs = scrollEventArgs; } #region Public properties /// /// Gets the ChartContainer that was scrolled /// public ChartContainer ChartContainer { get { return (_ChartContainer); } } /// /// Gets the scroll event args /// public ScrollEventArgs ScrollEventArgs { get { return (_ScrollEventArgs); } } #endregion } #endregion #region ChartScrollBarValueChangedEventArgs /// /// ChartScrollBarValueChangedEventArgs /// public class ChartScrollBarValueChangedEventArgs : EventArgs { #region Private variables private ChartContainer _ChartContainer; private int _OldValue; private int _NewValue; #endregion /// /// ChartScrollBarValueChangedEventArgs /// /// /// /// public ChartScrollBarValueChangedEventArgs( ChartContainer chartContainer, int oldValue, int newValue) { _ChartContainer = chartContainer; _OldValue = oldValue; _NewValue = newValue; } #region Public properties /// /// Gets the associated ChartContainer /// public ChartContainer ChartContainer { get { return (_ChartContainer); } } /// /// Gets the old scroll Value /// public int OldValue { get { return (_OldValue); } } /// /// Gets the new scroll Value /// public int NewValue { get { return (_NewValue); } } #endregion } #endregion #region ChartTitleMarkupLinkClickEventArgs /// /// ChartTitleMarkupLinkClickEventArgs /// public class ChartTitleMarkupLinkClickEventArgs : EventArgs { #region Private variables private string _HRef; private string _Name; private ChartNote _Title; #endregion /// /// ChartTitleMarkupLinkClickEventArgs /// /// /// /// /// public ChartTitleMarkupLinkClickEventArgs( ChartNote title, string name, string href) { _HRef = href; _Name = name; _Title = title; } #region Public properties /// /// Gets the associated HyperLink HRef /// public string HRef { get { return (_HRef); } } /// /// Gets the associated HyperLink Name /// public string Name { get { return (_Name); } } /// /// Gets the associated Title /// public ChartNote Title { get { return (_Title); } } #endregion } #endregion #region GetCrosshairAxisLabelEventArgs /// /// GetCrosshairAxisLabelEventArgs /// public class GetCrosshairAxisLabelEventArgs : EventArgs { #region Private variables private ChartAxis _ChartAxis; private object _Value; private string _LabelText; #endregion /// /// GetCrosshairAxisLabelEventArgs /// /// ChartAxis /// object /// string List public GetCrosshairAxisLabelEventArgs( ChartAxis axis, object value, string labelText) { _ChartAxis = axis; _Value = value; _LabelText = labelText; } #region Public properties /// /// Gets the associated ChartAxis /// public ChartAxis ChartAxis { get { return (_ChartAxis); } } /// /// Gets the associated ChartXy /// public ChartXy ChartXy { get { return ((ChartXy)_ChartAxis.Parent); } } /// /// Gets the associated label Value /// public object Value { get { return (_Value); } } /// /// Gets or sets the label Text /// public string LabelText { get { return (_LabelText); } set { _LabelText = value; } } #endregion } #endregion #region GetCrosshairLabelHeaderEventArgs /// /// GetCrosshairLabelHeaderEventArgs /// public class GetCrosshairLabelHeaderEventArgs : EventArgs { #region Private variables private BaseChart _Chart; private CrosshairPoint _CrosshairPoint; private List _CrosshairPoints; private string _Text; #endregion /// /// GetCrosshairLabelHeaderEventArgs /// /// BaseChart /// CrosshairPoint /// CrosshairPoint List /// Default header text public GetCrosshairLabelHeaderEventArgs( BaseChart chart, CrosshairPoint cp, List cps, string text) { _Chart = chart; _CrosshairPoint = cp; _CrosshairPoints = cps; _Text = text; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated CrosshairPoint (for which /// the header text is defined for) /// public CrosshairPoint CrosshairPoint { get { return (_CrosshairPoint); } } /// /// Gets the full list of CrosshairPoints /// public List CrosshairPoints { get { return (_CrosshairPoints); } } /// /// Gets or sets the CrosshairPoint header Text /// public string Text { get { return (_Text); } set { _Text = value; } } #endregion } #endregion #region GetCrosshairLabelItemEventArgs /// /// GetCrosshairLabelItemEventArgs /// public class GetCrosshairLabelItemEventArgs : EventArgs { #region Private variables private BaseChart _Chart; private CrosshairPoint _CrosshairPoint; private string _Text; #endregion /// /// GetCrosshairLabelItemEventArgs /// /// BaseChart /// CrosshairPoint /// Item text public GetCrosshairLabelItemEventArgs( BaseChart chart, CrosshairPoint cp, string text) { _Chart = chart; _CrosshairPoint = cp; _Text = text; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated CrosshairPoint /// public CrosshairPoint CrosshairPoint { get { return (_CrosshairPoint); } } /// /// Gets or sets the CrosshairPoint item Text /// public string Text { get { return (_Text); } set { _Text = value; } } #endregion } #endregion #region GetPieCenterLabelEventArgs /// /// GetPieCenterLabelEventArgs /// public class GetPieCenterLabelEventArgs : EventArgs { #region Private variables private PieChart _PieChart; private string _LabelText; #endregion /// /// GetPieCenterLabelEventArgs /// /// /// public GetPieCenterLabelEventArgs(PieChart pieChart, string text) { _PieChart = pieChart; _LabelText = text; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets or sets the Center Label Text /// public string LabelText { get { return (_LabelText); } set { _LabelText = value; } } #endregion } #endregion #region GetSliceLabelEventArgs /// /// GetSliceLabelEventArgs /// public class GetSliceLabelEventArgs : CancelEventArgs { #region Private variables private PieChart _Chart; private PieSeries _ChartSeries; private PieSeriesPoint _Psp; private bool _InnerLabel; private string _Text; #endregion /// /// GetSliceLabelEventArgs /// /// /// /// /// /// /// public GetSliceLabelEventArgs(PieChart chart, PieSeries chartSeries, PieSeriesPoint psp, bool inner, string text) { _Chart = chart; _ChartSeries = chartSeries; _Psp = psp; _InnerLabel = inner; _Text = text; } #region Public properties /// /// Gets the associated PieChart /// public PieChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries /// public PieSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated PieSeriesPoint /// public PieSeriesPoint PieSeriesPoint { get { return (_Psp); } } /// /// Gets whether the request is for the inner /// or outer label of the slice. /// public bool InnerLabel { get { return (_InnerLabel); } } /// /// Gets or sets the label Text /// public string Text { get { return (_Text); } set { _Text = value; } } #endregion } #endregion #region GetTickmarkLabelEventArgs /// /// GetTickmarkLabelEventArgs /// public class GetTickmarkLabelEventArgs : EventArgs { #region Private variables private ChartAxis _ChartAxis; private object _Value; private string _LabelText; private Color _LabelColor = Color.Empty; #endregion /// /// GetTickmarkLabelEventArgs /// /// ChartAxis /// object /// string List public GetTickmarkLabelEventArgs( ChartAxis axis, object value, string labelText) { _ChartAxis = axis; _Value = value; _LabelText = labelText; } #region Public properties /// /// Gets the associated ChartAxis /// public ChartAxis ChartAxis { get { return (_ChartAxis); } } /// /// Gets the associated ChartXy /// public ChartXy ChartXy { get { return ((ChartXy)_ChartAxis.Parent); } } /// /// Gets the associated label Value /// public object Value { get { return (_Value); } } /// /// Gets or sets the label Text /// public string LabelText { get { return (_LabelText); } set { _LabelText = value; } } /// /// Gets or sets the label Color /// public Color LabelColor { get { return (_LabelColor); } set { _LabelColor = value; } } #endregion } #endregion #region GetToolTipEventArgs /// /// GetToolTipEventArgs /// public class GetToolTipEventArgs : CancelEventArgs { #region Private variables private BaseChart _BaseChart; private BaseSeries _BaseSeries; private SeriesPoint _SeriesPoint; private string _ToolTip; #endregion /// /// GetToolTipEventArgs /// /// /// /// /// public GetToolTipEventArgs(BaseChart baseChart, BaseSeries baseSeries, SeriesPoint sp, string toolTip) { _BaseChart = baseChart; _BaseSeries = baseSeries; _SeriesPoint = sp; _ToolTip = toolTip; } #region Public properties /// /// Gets the associated BaseChart. /// public BaseChart BaseChart { get { return (_BaseChart); } } /// /// Gets the associated BaseSeries. /// public BaseSeries BaseSeries { get { return (_BaseSeries); } } /// /// Gets the associated SeriesPoint. /// public SeriesPoint SeriesPoint { get { return (_SeriesPoint); } } /// /// Gets the associated PieChart. /// public PieChart PieChart { get { return (_BaseChart as PieChart); } } /// /// Gets the associated PieSeries. /// public PieSeries PieSeries { get { return (_BaseSeries as PieSeries); } } /// /// Gets the associated PieSeriesPoint. /// public PieSeriesPoint PieSeriesPoint { get { return (_SeriesPoint as PieSeriesPoint); } } /// /// Gets or sets the associated ToolTip text /// public string ToolTip { get { return (_ToolTip); } set { _ToolTip = value; } } #endregion } #endregion #region LegendItemCheckedChangedEventArgs /// /// LegendItemCheckedChangedEventArgs /// public class LegendItemCheckedChangedEventArgs : EventArgs { #region Private variables private ChartLegend _Legend; private ChartLegendItem _LegendItem; #endregion /// /// LegendItemCheckedChangedEventArgs /// ///Associated legend ///Associated legend item public LegendItemCheckedChangedEventArgs( ChartLegend legend, ChartLegendItem legendItem) { _Legend = legend; _LegendItem = legendItem; } #region Public properties /// /// Gets the associated Legend. /// public ChartLegend Legend { get { return (_Legend); } } /// /// Gets the associated LegendItem. /// public ChartLegendItem LegendItem { get { return (_LegendItem); } } #endregion } #endregion #region PieCenterMarkupLinkClickEventArgs /// /// PieCenterMarkupLinkClickEventArgs /// public class PieCenterMarkupLinkClickEventArgs : EventArgs { #region Private variables private PieChart _PieChart; private string _HRef; private string _Name; #endregion /// /// PieCenterMarkupLinkClickEventArgs /// /// /// /// public PieCenterMarkupLinkClickEventArgs(PieChart pieChart, string name, string href) { _HRef = href; _Name = name; _PieChart = pieChart; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated HyperLink HRef /// public string HRef { get { return (_HRef); } } /// /// Gets the associated HyperLink Name /// public string Name { get { return (_Name); } } #endregion } #endregion #region PieDetachChangedEventArgs /// /// PieDetachChangedEventArgs /// public class PieDetachChangedEventArgs : EventArgs { #region Private variables private PieChart _PieChart; private PieSeries _PieSeries; private PieSelectionMode _PieSelectionMode; #endregion /// /// PieDetachChangedEventArgs /// /// /// /// public PieDetachChangedEventArgs( PieChart pieChart, PieSeries pieSeries, PieSelectionMode psm) { _PieChart = pieChart; _PieSeries = pieSeries; _PieSelectionMode = psm; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated PieSeries. /// public PieSeries PieSeries { get { return (_PieSeries); } } /// /// Gets the associated PieSelectionMode. /// public PieSelectionMode PieSelectionMode { get { return (_PieSelectionMode); } } #endregion } #endregion #region PieExplodeChangedEventArgs /// /// PieExplodeChangedEventArgs /// public class PieExplodeChangedEventArgs : EventArgs { #region Private variables private PieChart _PieChart; private PieSeries _PieSeries; #endregion /// /// PieExplodeChangedEventArgs /// /// /// public PieExplodeChangedEventArgs(PieChart pieChart, PieSeries pieSeries) { _PieChart = pieChart; _PieSeries = pieSeries; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated PieSeries. /// public PieSeries PieSeries { get { return (_PieSeries); } } #endregion } #endregion #region PieRingLevelChangingEventArgs /// /// PieRingLevelChangedEventArgs /// public class PieRingLevelChangedEventArgs : EventArgs { #region Private variables private PieChart _PieChart; private PieSeriesPointCollection _SpcOld; private PieSeriesPointCollection _SpcNew; #endregion /// /// PieRingLevelChanged /// /// /// /// public PieRingLevelChangedEventArgs( PieChart pieChart, PieSeriesPointCollection spcOld, PieSeriesPointCollection spcNew) { _PieChart = pieChart; _SpcOld = spcOld; _SpcNew = spcNew; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the old, post-change PieSeriesPointCollection. /// public PieSeriesPointCollection SpcOld { get { return (_SpcOld); } } /// /// Gets the new, post-change PieSeriesPointCollection. /// public PieSeriesPointCollection SpcNew { get { return (_SpcNew); } } #endregion } #endregion #region PieRingLevelChangingEventArgs /// /// PieRingLevelChanging /// public class PieRingLevelChangingEventArgs : CancelEventArgs { #region Private variables private PieChart _PieChart; private PieSeriesPointCollection _SpcOld; private PieSeriesPointCollection _SpcNew; #endregion /// /// PieRingLevelChangingEventArgs /// /// /// /// public PieRingLevelChangingEventArgs( PieChart pieChart, PieSeriesPointCollection spcOld, PieSeriesPointCollection spcNew) { _PieChart = pieChart; _SpcOld = spcOld; _SpcNew = spcNew; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the old, pre-change PieSeriesPointCollection. /// public PieSeriesPointCollection SpcOld { get { return (_SpcOld); } } /// /// Gets the new, pre-change PieSeriesPointCollection. /// public PieSeriesPointCollection SpcNew { get { return (_SpcNew); } } #endregion } #endregion #region PieSelectionChangedEventArgs /// /// PieSelectionChangedEventArgs /// public class PieSelectionChangedEventArgs : EventArgs { #region Private variables private PieChart _PieChart; private PieSeries _PieSeries; private PieSeriesPoint _PieSeriesPoint; private PieSelectionMode _PieSelectionMode; #endregion /// /// PieSelectionChangedEventArgs /// /// /// /// /// public PieSelectionChangedEventArgs( PieChart pieChart, PieSeries pieSeries, PieSeriesPoint psp, PieSelectionMode psm) { _PieChart = pieChart; _PieSeries = pieSeries; _PieSeriesPoint = psp; _PieSelectionMode = psm; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated PieSeries. /// public PieSeries PieSeries { get { return (_PieSeries); } } /// /// Gets the associated PieSeriesPoint (may not be /// applicable for the associated PieSelectionMode). /// public PieSeriesPoint PieSeriesPoint { get { return (_PieSeriesPoint); } } /// /// Gets the associated PieSelectionMode. /// public PieSelectionMode PieSelectionMode { get { return (_PieSelectionMode); } } #endregion } #endregion #region PostLoadLegendDataEventArgs /// /// PostLoadLegendDataEventArgs /// public class PostLoadLegendDataEventArgs : EventArgs { #region Private variables private ChartLegend _Legend; private ChartContainer _ChartContainer; #endregion public PostLoadLegendDataEventArgs(ChartLegend legend) { _Legend = legend; _ChartContainer = legend.ParentChartContainer; } #region Public properties /// /// Gets the associated Legend /// public ChartLegend Legend { get { return (_Legend); } } /// /// Gets the Legend's parent ChartContainer /// public ChartContainer ChartContainer { get { return (_ChartContainer); } } #endregion } #endregion #region PostRenderContentBackgroundEventArgs /// /// PostRenderContentBackgroundEventArgs /// public class PostRenderContentBackgroundEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private BaseChart _BaseChart; private Rectangle _Bounds; #endregion /// /// PostRenderContentBackgroundEventArgs /// /// Graphics /// BaseChart /// Bounds public PostRenderContentBackgroundEventArgs(Graphics g, BaseChart baseChart, Rectangle bounds) { _Graphics = g; _BaseChart = baseChart; _Bounds = bounds; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart BaseChart { get { return (_BaseChart); } } /// /// Gets the associated ChartXy /// public ChartXy ChartXy { get { return (_BaseChart as ChartXy); } } /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_BaseChart as PieChart); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the associated bounding rectangle /// public Rectangle Bounds { get { return (_Bounds); } } #endregion } #endregion #region PostRenderFrameBackgroundEventArgs /// /// PostRenderFrameBackgroundEventArgs /// public class PostRenderFrameBackgroundEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private BaseChart _BaseChart; private Rectangle _Bounds; #endregion /// /// PostRenderFrameBackgroundEventArgs /// /// Graphics /// BaseChart /// Bounds public PostRenderFrameBackgroundEventArgs(Graphics g, BaseChart baseChart, Rectangle bounds) { _Graphics = g; _BaseChart = baseChart; _Bounds = bounds; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart BaseChart { get { return (_BaseChart); } } /// /// Gets the associated ChartXy /// public ChartXy ChartXy { get { return (_BaseChart as ChartXy); } } /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_BaseChart as PieChart); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the associated bounding rectangle /// public Rectangle Bounds { get { return (_Bounds); } } #endregion } #endregion #region PostRenderPanelBackgroundEventArgs /// /// PostRenderPanelBackgroundEventArgs /// public class PostRenderPanelBackgroundEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private ChartPanel _ChartPanel; private Rectangle _Bounds; #endregion /// /// PostRenderPanelBackgroundEventArgs /// /// Graphics /// BaseChart /// Bounds public PostRenderPanelBackgroundEventArgs(Graphics g, ChartPanel panel, Rectangle bounds) { _Graphics = g; _ChartPanel = panel; _Bounds = bounds; } #region Public properties /// /// Gets the associated ChartPanel /// public ChartPanel ChartPanel { get { return (_ChartPanel); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the associated bounding rectangle /// public Rectangle Bounds { get { return (_Bounds); } } #endregion } #endregion #region PostRenderSeriesBarEventArgs /// /// PostRenderSeriesBarEventArgs /// public class PostRenderSeriesBarEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private SeriesPoint _SeriesPoint; private Rectangle _Bounds; private Rectangle _ExtendedBounds; private BarSegment _BarSegment; #endregion /// /// PostRenderSeriesBarEventArgs /// /// Graphics /// BaseChart /// Chart Series /// SeriesPoint public PostRenderSeriesBarEventArgs(Graphics graphics, BaseChart chart, ChartSeries series, SeriesPoint sp, Rectangle r, Rectangle r2, BarSegment segment) { _Graphics = graphics; _Chart = chart; _ChartSeries = series; _SeriesPoint = sp; _Bounds = r; _ExtendedBounds = r2; _BarSegment = segment; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the bounds for the bar segment. /// public Rectangle Bounds { get { return (_Bounds); } } /// /// Gets the associated SeriesPoint /// public SeriesPoint SeriesPoint { get { return (_SeriesPoint); } } /// /// Gets the 'extended' rectangle for the bar (calculated based /// upon the series maximum displayed bar bounds). /// public Rectangle ExtendedBounds { get { return (_ExtendedBounds); } } /// /// Gets the associated 'segment' of the bar being rendered. /// public BarSegment BarSegment { get { return (_BarSegment); } } #endregion } #endregion #region PostRenderSeriesHiLoBarEventArgs /// /// PreRenderSeriesHiLoBarEventArgs /// public class PostRenderSeriesHiLoBarEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private HiLoRenderData _RenderData; private HiLoBarSegment _BarSegment; private Point _Pt1; private Point _Pt2; #endregion /// /// PostRenderSeriesHiLoBarEventArgs /// /// /// /// /// /// /// /// public PostRenderSeriesHiLoBarEventArgs(Graphics g, BaseChart chart, ChartSeries series, HiLoRenderData rd, Point pt1, Point pt2, HiLoBarSegment segment) { _Graphics = g; _Chart = chart; _ChartSeries = series; _RenderData = rd; _BarSegment = segment; _Pt1 = pt1; _Pt2 = pt2; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the associated HiLo RenderData. /// public HiLoRenderData RenderData { get { return (_RenderData); } } /// /// Gets the associated HiLo BarSegment. /// public HiLoBarSegment BarSegment { get { return (_BarSegment); } } /// /// Gets the initial segment Point. /// public Point Point1 { get { return (_Pt1); } } /// /// Gets the terminal segment Point. /// public Point Point2 { get { return (_Pt2); } } #endregion } #endregion #region PostRenderSliceEventArgs /// /// PostRenderSliceEventArgs /// public class PostRenderSliceEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private GraphicsPath _GraphicsPath; private PieChart _PieChart; private PieSeries _PieSeries; private PieSeriesPoint _PieSeriesPoint; private SliceRenderType _SliceRenderType; #endregion /// /// PostRenderSliceEventArgs /// /// /// /// /// /// /// public PostRenderSliceEventArgs(Graphics g, GraphicsPath path, PieChart pieChart, PieSeries pieSeries, PieSeriesPoint psp, SliceRenderType rtype) { _Graphics = g; _GraphicsPath = path; _PieChart = pieChart; _PieSeries = pieSeries; _PieSeriesPoint = psp; _SliceRenderType = rtype; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated PieSeries /// public PieSeries PieSeries { get { return (_PieSeries); } } /// /// Gets the associated PieSeriesPoint /// public PieSeriesPoint PieSeriesPoint { get { return (PieSeriesPoint); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the GraphicsPath for the slice. /// public GraphicsPath GraphicsPath { get { return (_GraphicsPath); } } /// /// Gets the SliceRenderType - they 'type' of slice element being rendered. /// public SliceRenderType SliceRenderType { get { return (_SliceRenderType); } } #endregion } #endregion #region PostRenderPieCenterBackgroundEventArgs /// /// PostRenderPieCenterBackgroundEventArgs /// public class PostRenderPieCenterBackgroundEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private Rectangle _CenterBounds; #endregion /// /// PostRenderPieCenterBackgroundEventArgs /// /// /// /// public PostRenderPieCenterBackgroundEventArgs( Graphics g, PieChart pieChart, Rectangle rc) { _Graphics = g; _PieChart = pieChart; _CenterBounds = rc; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the Pie Center Bounds. /// public Rectangle CenterBounds { get { return (_CenterBounds); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region PostRenderPieCenterContentEventArgs /// /// PostRenderPieCenterContentEventArgs /// public class PostRenderPieCenterContentEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private Rectangle _TextBounds; private string _CenterLabel; #endregion /// /// PostRenderPieCenterContentEventArgs /// /// /// /// /// public PostRenderPieCenterContentEventArgs( Graphics g, PieChart pieChart, Rectangle rt, string centerlabel) { _Graphics = g; _PieChart = pieChart; _TextBounds = rt; _CenterLabel = centerlabel; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the Pie Center Text Bounds. /// public Rectangle TextBounds { get { return (_TextBounds); } } /// /// Gets the center text label. /// public string CenterLabel { get { return (_CenterLabel); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region PostRenderPointConnectorEventArgs /// /// PostRenderPointConnectorEventArgs /// public class PostRenderPointConnectorEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private PointLabel _PointLabel; private bool _IsCrosshairPoint; private Point _DataPoint; private Point _LabelPoint; #endregion /// /// PostRenderPointConnectorEventArgs /// /// Graphics /// BaseChart /// Chart Series /// PointLabel /// Is the point a crosshair point /// Data Point /// Label Point public PostRenderPointConnectorEventArgs(Graphics graphics, BaseChart chart, ChartSeries series, PointLabel pointLabel, bool isCrosshairPt, Point dataPt, Point labelPt) { _Graphics = graphics; _Chart = chart; _ChartSeries = series; _PointLabel = pointLabel; _IsCrosshairPoint = isCrosshairPt; _DataPoint = dataPt; _LabelPoint = labelPt; } #region Public properties /// /// Gets the associated BaseChart. /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries. /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object. /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the associated PointLabel. /// public PointLabel PointLabel { get { return (_PointLabel); } } /// /// Gets the whether the point is a Crosshair Point. /// public bool IsCrosshairPoint { get { return (_IsCrosshairPoint); } } /// /// Gets the data-side Connector Point. /// public Point DataPoint { get { return (_DataPoint); } } /// /// Gets the label-side Connector Point. /// public Point LabelPoint { get { return (_LabelPoint); } } #endregion } #endregion #region PostRenderPointLabelEventArgs /// /// PostRenderPointLabelEventArgs /// public class PostRenderPointLabelEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private PointLabel _PointLabel; private bool _IsCrosshairPoint; private Rectangle _Bounds; #endregion /// /// PostRenderPointLabelEventArgs /// /// Graphics /// BaseChart /// Chart Series /// PointLabel /// Is the point a crosshair point /// Display Bounds public PostRenderPointLabelEventArgs(Graphics graphics, BaseChart chart, ChartSeries series, PointLabel pointLabel, bool isCrosshairPoint, Rectangle bounds) { _Graphics = graphics; _Chart = chart; _ChartSeries = series; _PointLabel = pointLabel; _IsCrosshairPoint = isCrosshairPoint; _Bounds = bounds; } #region Public properties /// /// Gets the associated BaseChart. /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries. /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object. /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the associated PointLabel. /// public PointLabel PointLabel { get { return (_PointLabel); } } /// /// Gets the whether the point is a Crosshair Point. /// public bool IsCrosshairPoint { get { return (_IsCrosshairPoint); } } /// /// Gets the bounding display rectangle. /// public Rectangle Bounds { get { return (_Bounds); } } #endregion } #endregion #region PostRenderRadialGridEventArgs /// /// PostRenderRadialGridEventArgs /// public class PostRenderRadialGridEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private double _OuterRadius; private double _InnerRadius; private double _ExpDelta; #endregion /// /// PostRenderRadialGridEventArgs /// /// /// /// /// /// public PostRenderRadialGridEventArgs(Graphics graphics, PieChart pieChart, double outerRadius, double innerRadius, double exp) { _Graphics = graphics; _PieChart = pieChart; _OuterRadius = outerRadius; _InnerRadius = innerRadius; _ExpDelta = exp; } #region Public properties /// /// Gets the associated PieChart. /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the inner, bounding radius for the grid. /// public double InnerRadius { get { return (_InnerRadius); } } /// /// Gets the outer, bounding radius for the grid. /// public double OuterRadius { get { return (_OuterRadius); } } /// /// Gets the expanded/exploded delta for the grid. This is /// the adjustment needed if the pie has been expanded. If you /// want to render an expanded grid, then this delta should be /// added to both the inner and outer radius values. /// public double ExpDelta { get { return (_ExpDelta); } } /// /// Gets the associated Graphics object. /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region PostRenderSeriesPointEventArgs /// /// PostRenderSeriesPointEventArgs /// public class PostRenderSeriesPointEventArgs : EventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private Point _Point; private SeriesPoint _SeriesPoint; private Size _PointSize; private Image _Marker; #endregion /// /// PostRenderSeriesPointEventArgs /// /// Graphics /// BaseChart /// Chart Series /// Marker Point (center) /// SeriesPoint /// Max marker point size /// Marker Image public PostRenderSeriesPointEventArgs(Graphics graphics, BaseChart chart, ChartSeries series, SeriesPoint sp, Point pt, Size pointSize, Image marker) { _Graphics = graphics; _Chart = chart; _ChartSeries = series; _Point = pt; _SeriesPoint = sp; _PointSize = pointSize; _Marker = marker; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the center point for the marker /// public Point Point { get { return (_Point); } } /// /// Gets the associated SeriesPoint /// public SeriesPoint SeriesPoint { get { return (_SeriesPoint); } } /// /// Gets the max size for the point marker /// public Size PointSize { get { return (_PointSize); } } /// /// Gets the associated marker Image /// public Image Marker { get { return (_Marker); } } #endregion } #endregion #region PreLoadLegendDataEventArgs /// /// PreLoadLegendDataEventArgs /// public class PreLoadLegendDataEventArgs : CancelEventArgs { #region Private variables private ChartLegend _Legend; private ChartContainer _ChartContainer; #endregion public PreLoadLegendDataEventArgs(ChartLegend legend) { _Legend = legend; _ChartContainer = legend.ParentChartContainer; } #region Public properties /// /// Gets the associated Legend /// public ChartLegend Legend { get { return (_Legend); } } /// /// Gets the Legend's parent ChartContainer /// public ChartContainer ChartContainer { get { return (_ChartContainer); } } #endregion } #endregion #region PreRenderContentBackgroundEventArgs /// /// PreRenderContentBackgroundEventArgs /// public class PreRenderContentBackgroundEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _BaseChart; private Rectangle _Bounds; #endregion /// /// PreRenderContentBackgroundEventArgs /// /// /// /// public PreRenderContentBackgroundEventArgs(Graphics g, BaseChart baseChart, Rectangle r) { _Graphics = g; _BaseChart = baseChart; _Bounds = r; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart BaseChart { get { return (_BaseChart); } } /// /// Gets the associated ChartXy /// public ChartXy ChartXy { get { return (_BaseChart as ChartXy); } } /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_BaseChart as PieChart); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the bounds for the bar segment. /// public Rectangle Bounds { get { return (_Bounds); } } #endregion } #endregion #region PreRenderFrameBackgroundEventArgs /// /// PreRenderFrameBackgroundEventArgs /// public class PreRenderFrameBackgroundEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _BaseChart; private Rectangle _Bounds; #endregion /// /// PreRenderFrameBackgroundEventArgs /// /// /// /// public PreRenderFrameBackgroundEventArgs(Graphics g, BaseChart baseChart, Rectangle r) { _Graphics = g; _BaseChart = baseChart; _Bounds = r; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart BaseChart { get { return (_BaseChart); } } /// /// Gets the associated ChartXy /// public ChartXy ChartXy { get { return (_BaseChart as ChartXy); } } /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_BaseChart as PieChart); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the bounds for the bar segment. /// public Rectangle Bounds { get { return (_Bounds); } } #endregion } #endregion #region PreRenderPanelBackgroundEventArgs /// /// PreRenderPanelBackgroundEventArgs /// public class PreRenderPanelBackgroundEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private ChartPanel _ChartPanel; private Rectangle _Bounds; #endregion /// /// PreRenderPanelBackgroundEventArgs /// /// /// /// public PreRenderPanelBackgroundEventArgs(Graphics g, ChartPanel panel, Rectangle r) { _Graphics = g; _ChartPanel = panel; _Bounds = r; } #region Public properties /// /// Gets the associated ChartPanel /// public ChartPanel ChartPanel { get { return (_ChartPanel); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the bounds for the bar segment. /// public Rectangle Bounds { get { return (_Bounds); } } #endregion } #endregion #region PreRenderPieCenterBackgroundEventArgs /// /// PreRenderPieCenterBackgroundEventArgs /// public class PreRenderPieCenterBackgroundEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private Rectangle _CenterBounds; #endregion /// /// PreRenderPieCenterBackgroundEventArgs /// /// /// /// public PreRenderPieCenterBackgroundEventArgs( Graphics g, PieChart pieChart, Rectangle rc) { _Graphics = g; _PieChart = pieChart; _CenterBounds = rc; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the Pie Center Bounds. /// public Rectangle CenterBounds { get { return (_CenterBounds); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region PreRenderPieCenterContentEventArgs /// /// PreRenderPieCenterContentEventArgs /// public class PreRenderPieCenterContentEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private Rectangle _TextBounds; private string _CenterLabel; #endregion /// /// PreRenderPieCenterContentEventArgs /// /// /// /// /// public PreRenderPieCenterContentEventArgs( Graphics g, PieChart pieChart, Rectangle rt, string centerlabel) { _Graphics = g; _PieChart = pieChart; _TextBounds = rt; _CenterLabel = centerlabel; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the Pie Center Text Bounds. /// public Rectangle TextBounds { get { return (_TextBounds); } } /// /// Gets the center text label. /// public string CenterLabel { get { return (_CenterLabel); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region PreRenderPointConnectorEventArgs /// /// PreRenderPointConnectorEventArgs /// public class PreRenderPointConnectorEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private PointLabel _PointLabel; private bool _IsCrosshairPoint; private Point _DataPoint; private Point _LabelPoint; #endregion /// /// PreRenderPointConnectorEventArgs /// /// Graphics /// BaseChart /// Chart Series /// PointLabel /// Is the point a crosshair point /// Data Point /// Label Point public PreRenderPointConnectorEventArgs(Graphics graphics, BaseChart chart, ChartSeries series, PointLabel pointLabel, bool isCrosshairPt, Point dataPt, Point labelPt) { _Graphics = graphics; _Chart = chart; _ChartSeries = series; _PointLabel = pointLabel; _IsCrosshairPoint = isCrosshairPt; _DataPoint = dataPt; _LabelPoint = labelPt; } #region Public properties /// /// Gets the associated BaseChart. /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries. /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object. /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the associated PointLabel. /// public PointLabel PointLabel { get { return (_PointLabel); } } /// /// Gets the whether the point is a Crosshair Point. /// public bool IsCrosshairPoint { get { return (_IsCrosshairPoint); } } /// /// Gets the data-side Connector Point. /// public Point DataPoint { get { return (_DataPoint); } } /// /// Gets the label-side Connector Point. /// public Point LabelPoint { get { return (_LabelPoint); } } #endregion } #endregion #region PreRenderPointLabelEventArgs /// /// PreRenderPointLabelEventArgs /// public class PreRenderPointLabelEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private PointLabel _PointLabel; private bool _IsCrosshairPoint; private Rectangle _Bounds; #endregion /// /// PreRenderPointLabelEventArgs /// /// Graphics /// BaseChart /// Chart Series /// PointLabel /// Is the point a crosshair point /// Display Bounds public PreRenderPointLabelEventArgs(Graphics graphics, BaseChart chart, ChartSeries series, PointLabel pointLabel, bool isCrosshairPoint, Rectangle bounds) { _Graphics = graphics; _Chart = chart; _ChartSeries = series; _PointLabel = pointLabel; _IsCrosshairPoint = isCrosshairPoint; _Bounds = bounds; } #region Public properties /// /// Gets the associated BaseChart. /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries. /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object. /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the associated PointLabel. /// public PointLabel PointLabel { get { return (_PointLabel); } } /// /// Gets the whether the point is a Crosshair Point. /// public bool IsCrosshairPoint { get { return (_IsCrosshairPoint); } } /// /// Gets the bounding display rectangle. /// public Rectangle Bounds { get { return (_Bounds); } } #endregion } #endregion #region PreRenderRadialGridEventArgs /// /// PreRenderRadialGridEventArgs /// public class PreRenderRadialGridEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private double _OuterRadius; private double _InnerRadius; private double _ExpDelta; #endregion /// /// PreRenderRadialGridEventArgs /// /// /// /// /// /// public PreRenderRadialGridEventArgs(Graphics graphics, PieChart pieChart, double outerRadius, double innerRadius, double exp) { _Graphics = graphics; _PieChart = pieChart; _OuterRadius = outerRadius; _InnerRadius = innerRadius; _ExpDelta = exp; } #region Public properties /// /// Gets the associated PieChart. /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the inner, bounding radius for the grid. /// public double InnerRadius { get { return (_InnerRadius); } } /// /// Gets the outer, bounding radius for the grid. /// public double OuterRadius { get { return (_OuterRadius); } } /// /// Gets the expanded/exploded delta for the grid. This is /// the adjustment needed if the pie has been expanded. If you /// want to render an expanded grid, then this delta should be /// added to both the inner and outer radius values. /// public double ExpDelta { get { return (_ExpDelta); } } /// /// Gets the associated Graphics object. /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region PreRenderSeriesBarEventArgs /// /// PreRenderSeriesBarEventArgs /// public class PreRenderSeriesBarEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private SeriesPoint _SeriesPoint; private Rectangle _Bounds; private Rectangle _FillRangeBounds; private BarSegment _BarSegment; #endregion /// /// PreRenderSeriesBarEventArgs /// /// /// /// /// /// /// /// public PreRenderSeriesBarEventArgs(Graphics graphics, BaseChart chart, ChartSeries series, SeriesPoint sp, Rectangle r, Rectangle r2, BarSegment segment) { _Graphics = graphics; _Chart = chart; _ChartSeries = series; _SeriesPoint = sp; _Bounds = r; _FillRangeBounds = r2; _BarSegment = segment; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the bounds for the bar segment. /// public Rectangle Bounds { get { return (_Bounds); } } /// /// Gets the 'FillRange' bounds for the bar (See ChartXy.FillRange). /// public Rectangle FillRangeBounds { get { return (_FillRangeBounds); } } /// /// Gets the associated SeriesPoint /// public SeriesPoint SeriesPoint { get { return (_SeriesPoint); } } /// /// Gets the associated 'segment' of the bar being rendered. /// public BarSegment BarSegment { get { return (_BarSegment); } } #endregion } #endregion #region PreRenderSeriesHiLoBarEventArgs /// /// PreRenderSeriesHiLoBarEventArgs /// public class PreRenderSeriesHiLoBarEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private HiLoRenderData _RenderData; private HiLoBarSegment _BarSegment; private Point _Pt1; private Point _Pt2; #endregion /// /// PreRenderSeriesHiLoBarEventArgs /// /// /// /// /// /// /// /// public PreRenderSeriesHiLoBarEventArgs(Graphics g, BaseChart chart, ChartSeries series, HiLoRenderData rd, Point pt1, Point pt2, HiLoBarSegment segment) { _Graphics = g; _Chart = chart; _ChartSeries = series; _RenderData = rd; _BarSegment = segment; _Pt1 = pt1; _Pt2 = pt2; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the associated HiLo RenderData. /// public HiLoRenderData RenderData { get { return (_RenderData); } } /// /// Gets the associated HiLo BarSegment. /// public HiLoBarSegment BarSegment { get { return (_BarSegment); } } /// /// Gets the initial segment Point. /// public Point Point1 { get { return (_Pt1); } } /// /// Gets the terminal segment Point. /// public Point Point2 { get { return (_Pt2); } } /// /// Gets the associated SeriesPoint /// public SeriesPoint SeriesPoint { get { return (_RenderData.Sp); } } /// /// Gets the associated SeriesPoint index /// public int SeriesPointIndex { get { return (_RenderData.Index); } } #endregion } #endregion #region PreRenderSeriesPointEventArgs /// /// PreRenderSeriesPointEventArgs /// public class PreRenderSeriesPointEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private ChartSeries _ChartSeries; private Point _Point; private SeriesPoint _SeriesPoint; private Size _PointSize; private Image _Marker; #endregion /// /// PreRenderSeriesPointEventArgs /// /// Graphics /// BaseChart /// Chart Series /// Marker Point (center) /// SeriesPoint /// Max marker point size /// Marker Image public PreRenderSeriesPointEventArgs(Graphics graphics, BaseChart chart, ChartSeries series, SeriesPoint sp, Point pt, Size pointSize, Image marker) { _Graphics = graphics; _Chart = chart; _ChartSeries = series; _Point = pt; _SeriesPoint = sp; _PointSize = pointSize; _Marker = marker; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated ChartSeries /// public ChartSeries ChartSeries { get { return (_ChartSeries); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the center point for the marker /// public Point Point { get { return (_Point); } } /// /// Gets the associated SeriesPoint /// public SeriesPoint SeriesPoint { get { return (_SeriesPoint); } } /// /// Gets the max size for the point marker /// public Size PointSize { get { return (_PointSize); } } /// /// Gets or sets the associated marker Image /// public Image Marker { get { return (_Marker); } set { _Marker = value; } } #endregion } #endregion #region PreRenderSliceEventArgs /// /// PreRenderSliceEventArgs /// public class PreRenderSliceEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private GraphicsPath _GraphicsPath; private PieChart _PieChart; private PieSeries _PieSeries; private PieSeriesPoint _PieSeriesPoint; private SliceRenderType _SliceRenderType; #endregion /// /// PreRenderSliceEventArgs /// /// /// /// /// /// /// public PreRenderSliceEventArgs(Graphics g, GraphicsPath path, PieChart pieChart, PieSeries pieSeries, PieSeriesPoint psp, SliceRenderType rtype) { _Graphics = g; _GraphicsPath = path; _PieChart = pieChart; _PieSeries = pieSeries; _PieSeriesPoint = psp; _SliceRenderType = rtype; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated PieSeries /// public PieSeries PieSeries { get { return (_PieSeries); } } /// /// Gets the associated PieSeriesPoint /// public PieSeriesPoint PieSeriesPoint { get { return (PieSeriesPoint); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the GraphicsPath for the slice. /// public GraphicsPath GraphicsPath { get { return (_GraphicsPath); } } /// /// Gets the SliceRenderType - they 'type' of slice element being rendered. /// public SliceRenderType SliceRenderType { get { return (_SliceRenderType); } } #endregion } #endregion #region ReferenceLineMarkupLinkClickEventArgs /// /// ReferenceLineMarkupLinkClickEventArgs /// public class ReferenceLineMarkupLinkClickEventArgs : EventArgs { #region Private variables private string _HRef; private string _Name; private ReferenceLine _ReferenceLine; #endregion /// /// ReferenceLineMarkupLinkClickEventArgs /// /// /// /// public ReferenceLineMarkupLinkClickEventArgs( ReferenceLine referenceLine, string name, string href) { _HRef = href; _Name = name; _ReferenceLine = referenceLine; } #region Public properties /// /// Gets the associated HyperLink HRef /// public string HRef { get { return (_HRef); } } /// /// Gets the associated HyperLink Name /// public string Name { get { return (_Name); } } /// /// Gets the associated ReferenceLine /// public ReferenceLine ReferenceLine { get { return (_ReferenceLine); } } #endregion } #endregion #region RenderCrosshairCalloutEventArgs /// /// RenderCrosshairCalloutEventArgs /// public class RenderCrosshairCalloutEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private Rectangle _Bounds; private Point _Point; private CrosshairVisualStyle _Style; #endregion /// /// RenderCrosshairCalloutEventArgs /// /// Graphics /// BaseChart /// Callout bounds /// Mouse point /// Crosshair style public RenderCrosshairCalloutEventArgs(Graphics graphics, BaseChart chart, Rectangle bounds, Point pt, CrosshairVisualStyle style) { _Graphics = graphics; _Chart = chart; _Bounds = bounds; _Point = pt; _Style = style; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the Crosshair style /// public CrosshairVisualStyle Style { get { return (_Style); } } /// /// Gets the bounding chart Rectangle /// public Rectangle Bounds { get { return (_Bounds); } } /// /// Gets the associated mouse position /// public Point Point { get { return (_Point); } } #endregion } #endregion #region RenderCrosshairLabelEventArgs /// /// RenderCrosshairLabelEventArgs /// public class RenderCrosshairLabelEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private Rectangle _Bounds; private List _CrosshairPoints; private Point _Point; #endregion /// /// RenderCrosshairLabelEventArgs /// /// Graphics /// BaseChart /// CrosshairPoint list /// /// Mouse Point public RenderCrosshairLabelEventArgs(Graphics graphics, BaseChart chart, List cps, Rectangle bounds, Point pt) { _Graphics = graphics; _Chart = chart; _CrosshairPoints = cps; _Bounds = bounds; _Point = pt; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the list of CrosshairPoints /// public List CrosshairPoints { get { return (_CrosshairPoints); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } /// /// Gets the bounding chart Rectangle /// public Rectangle Bounds { get { return (_Bounds); } } /// /// Gets the associated mouse position /// public Point Point { get { return (_Point); } } #endregion } #endregion #region RenderCrosshairLabelItemEventArgs /// /// RenderCrosshairLabelItemEventArgs /// public class RenderCrosshairLabelItemEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private BaseChart _Chart; private CrosshairPoint _CrosshairPoint; private Rectangle _Bounds; private CrosshairVisualStyle _Style; #endregion /// /// RenderCrosshairLabelItemEventArgs /// /// Graphics /// BaseChart /// CrosshairPoint /// Bounding rectangle /// Style public RenderCrosshairLabelItemEventArgs(Graphics graphics, BaseChart chart, CrosshairPoint cp, Rectangle bounds, CrosshairVisualStyle style) { _Graphics = graphics; _Chart = chart; _CrosshairPoint = cp; _Bounds = bounds; _Style = style; } #region Public properties /// /// Gets the associated BaseChart /// public BaseChart Chart { get { return (_Chart); } } /// /// Gets the associated CrosshairPoint /// public CrosshairPoint CrosshairPoint { get { return (_CrosshairPoint); } } /// /// Gets the Crosshair style /// public CrosshairVisualStyle Style { get { return (_Style); } } /// /// Gets the bounding chart Rectangle /// public Rectangle Bounds { get { return (_Bounds); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region RenderPieRingOutEventArgs /// /// RenderSliceCenterLineEventArgs /// public class RenderPieRingOutEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private Rectangle _RingOutBounds; #endregion /// /// RenderPieRingOutEventArgs /// /// /// /// public RenderPieRingOutEventArgs(Graphics graphics, PieChart pieChart, Rectangle r) { _Graphics = graphics; _PieChart = pieChart; _RingOutBounds = r; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated Ring-Out indicator bounds. /// public Rectangle RingOutBounds { get { return (_RingOutBounds); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region RenderSliceCenterLineEventArgs /// /// RenderSliceCenterLineEventArgs /// public class RenderSliceCenterLineEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private PieSeriesPoint _PieSeriesPoint; private Point _PtInner; private Point _PtOuter; #endregion /// /// RenderSliceCenterLineEventArgs /// /// /// /// /// /// public RenderSliceCenterLineEventArgs(Graphics graphics, PieChart pieChart, PieSeriesPoint psp, Point ptInner, Point ptOuter) { _Graphics = graphics; _PieChart = pieChart; _PieSeriesPoint = psp; _PtInner = ptInner; _PtOuter = ptOuter; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated PieSeriesPoint /// public PieSeriesPoint PieSeriesPoint { get { return (_PieSeriesPoint); } } /// /// Gets the inner Point for the CenterLine. /// public Point PtInner { get { return (_PtInner); } } /// /// Gets the outer Point for the CenterLine. /// public Point PtOuter { get { return (_PtOuter); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region RenderSliceInnerLabelEventArgs /// /// RenderSliceInnerLabelEventArgs /// public class RenderSliceInnerLabelEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private PieSeriesPoint _PieSeriesPoint; private string _Text; private bool _Displayed; #endregion /// /// RenderSliceInnerLabelEventArgs /// /// /// /// /// /// public RenderSliceInnerLabelEventArgs(Graphics graphics, PieChart pieChart, PieSeriesPoint psp, string text, bool displayed) { _Graphics = graphics; _PieChart = pieChart; _PieSeriesPoint = psp; _Text = text; _Displayed = displayed; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated PieSeriesPoint /// public PieSeriesPoint PieSeriesPoint { get { return (_PieSeriesPoint); } } /// /// Gets the label text. /// public string Text { get { return (_Text); } } /// /// Gets or sets whether the label text was displayed. This value /// will determine whether the lable will be displayed as an outer /// label when SliceLabelDisplayMode is set to InnerXorOuter. /// public bool Displayed { get { return (_Displayed); } set { _Displayed = value; } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region RenderSliceOuterLabelEventArgs /// /// RenderSliceOuterLabelEventArgs /// public class RenderSliceOuterLabelEventArgs : CancelEventArgs { #region Private variables private Graphics _Graphics; private PieChart _PieChart; private PieSeriesPoint _PieSeriesPoint; private PieLabel _PieLabel; #endregion /// /// RenderSliceOuterLabelEventArgs /// /// /// /// /// public RenderSliceOuterLabelEventArgs( Graphics graphics, PieChart pieChart, PieSeriesPoint psp, PieLabel pl) { _Graphics = graphics; _PieChart = pieChart; _PieSeriesPoint = psp; _PieLabel = pl; } #region Public properties /// /// Gets the associated PieChart /// public PieChart PieChart { get { return (_PieChart); } } /// /// Gets the associated PieSeriesPoint /// public PieSeriesPoint PieSeriesPoint { get { return (_PieSeriesPoint); } } /// /// Gets the PieLabel defining the label. /// public PieLabel PieLabel { get { return (_PieLabel); } } /// /// Gets the associated Graphics object /// public Graphics Graphics { get { return (_Graphics); } } #endregion } #endregion #region SelectionChangedEventArgs /// /// SelectionChangedEventArgs /// public class SelectionChangedEventArgs : EventArgs { #region Private variables private ChartVisualElement _Item; private bool _OldState; private bool _NewState; private int _SelectedCount; #endregion /// /// SelectionChangedEventArgs /// ///Associated items changing selected state ///Old selected state ///New selected state ///Resultant total selected item count public SelectionChangedEventArgs( ChartVisualElement item, bool oldState, bool newState, int selectedCount) { _Item = item; _OldState = oldState; _NewState = newState; _SelectedCount = selectedCount; } #region Public properties /// /// Gets the associated item. /// public ChartVisualElement Item { get { return (_Item); } } /// /// Gets the old / previous selected state. /// public bool OldState { get { return (_OldState); } } /// /// Gets the new / current selected state. /// public bool NewState { get { return (_NewState); } } /// /// Gets the resultant selected item count. /// public int SelectedCount { get { return (_SelectedCount); } } #endregion } #endregion #region SeriesDataBindingCompleteEventArgs /// /// SeriesDataBindingCompleteEventArgs /// public class SeriesDataBindingCompleteEventArgs : EventArgs { #region Private variables private BaseChart _BaseChart; private BaseSeries _BaseSeries; private object _Source; #endregion /// /// SeriesDataBindingCompleteEventArgs /// public SeriesDataBindingCompleteEventArgs(BaseChart chart, BaseSeries series, object source) { _BaseChart = chart; _BaseSeries = series; _Source = source; } #region Public properties /// /// Gets the associated BaseChart that was bound. /// public BaseChart BaseChart { get { return (_BaseChart); } } /// /// Gets the associated Chart that was bound. /// public BaseChart Chart { get { return (_BaseChart); } } /// /// Gets the associated ChartXy that was bound. /// public ChartXy ChartXy { get { return (_BaseChart as ChartXy); } } /// /// Gets the associated PieChart that was bound. /// public PieChart PieChart { get { return (_BaseChart as PieChart); } } /// /// Gets the associated BaseSeries that was bound. /// public BaseSeries BaseSeries { get { return (_BaseSeries); } } /// /// Gets the associated ChartSeries that was bound. /// public ChartSeries ChartSeries { get { return (_BaseSeries as ChartSeries); } } /// /// Gets the associated PieSeries that was bound. /// public PieSeries PieSeries { get { return (_BaseSeries as PieSeries); } } /// /// Gets the data source that was bound to. /// public object Source { get { return (_Source); } } #endregion } #endregion #endregion #region Attributes /// /// Attribute to control the visibility of individual fields /// or properties in an IList data source to the ChartControl. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class IsVisibleToChartControl : Attribute { private bool _Visible; /// /// IsVisibleToChartControl /// /// public IsVisibleToChartControl(bool visible) { _Visible = visible; } /// /// Visible /// public bool Visible { get { return (_Visible); } set { _Visible = value; } } } #endregion }