using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using ImageQuantization;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;

namespace Super2d3dGraphLibrary;

[ToolboxBitmap(typeof(Super2d3dGraph))]
public class Super2d3dGraph : UserControl, ICloneable
{
	private enum LICENSE_LEVEL
	{
		LICENSE_STANDARD = 2,
		LICENSE_PROFESSIONAL
	}

	public delegate void BeginPaintEventHandler(CustomGraphics g);

	public delegate void AfterPaintEventHandler(CustomGraphics g);

	public delegate void ValueClickEventHandler(CustomGraphics g, int serie, int itemIndex);

	private class SurfaceQuadComparerClass : IComparer<quad>
	{
		public int Compare(quad q1, quad q2)
		{
			return q2.z.CompareTo(q1.z);
		}

		int IComparer<quad>.Compare(quad q1, quad q2)
		{
			//ILSpy generated this explicit interface implementation from .override directive in Compare
			return this.Compare(q1, q2);
		}
	}

	private IContainer components;

	private string[] names_English;

	private string[] names_Spanish;

	private string[] names;

	private STYLE2D3D[] values;

	private int[] chartDimensions;

	private string[] additionalCalculations_English;

	private string[] additionalCalculations_Spanish;

	private string[] additionalCalculations;

	private CALCULATION[] additionalCalculations_Values;

	private string[] backgroundStyles_English;

	private string[] backgroundStyles_Spanish;

	private string[] backgroundStyles;

	private STYLEBACKGROUND[] backgroundStyles_Values;

	internal STYLE2D3D m_lngStyle;

	internal ArrayList[] m_arrSeries;

	internal double[] m_arrSeriesSum;

	internal ArrayList[] m_arrSeriesAcum;

	internal double m_dblSeriesMaxYAcum;

	internal double m_dblSeriesMinYAcum;

	internal double m_dblSeriesRangeYAcum;

	internal double m_dblSeriesMiddleYAcum;

	internal double[] m_dblSeriesRangeSumY;

	internal double[] m_dblSeriesRangeSumX;

	internal Color[] m_arrSeriesColor;

	internal Pen[] m_arrSeriesLineStyle;

	internal Brush[] m_arrSeriesFillStyle;

	internal double m_dblSeriesMaxY;

	internal double m_dblSeriesMinY;

	internal double m_dblSeriesRangeY;

	internal double m_dblSeriesMiddleY;

	internal double m_dblSeriesMaxX;

	internal double m_dblSeriesMinX;

	internal double m_dblSeriesRangeX;

	internal double m_dblSeriesMiddleX;

	internal double m_dblSeriesMaxZ;

	internal double m_dblSeriesMinZ;

	internal double m_dblSeriesRangeZ;

	internal double m_dblSeriesMiddleZ;

	internal Bitmap m_surface;

	internal string m_strTitle;

	internal string m_strLegendCaption;

	internal string[] m_arrSeriesLegend;

	internal string[] m_arrItemsLegend;

	internal Font m_LegendFont;

	internal Color m_LegendColor;

	internal Font m_TitleFont;

	internal Font m_ValuesFont;

	internal Color m_ValuesColor;

	internal Color m_ValuesBackColor;

	internal Color m_TitleColor;

	internal long m_lngNumDividersY;

	internal bool m_blnShowDividersX;

	internal long m_lngNumX;

	internal bool m_blnShowValues;

	internal Color m_BorderColor;

	internal Color m_BackColor;

	internal STYLEBACKGROUND m_BackStyle;

	internal bool m_blnShadow;

	internal bool m_blnLegend;

	internal bool m_blnDataTable;

	internal Font m_DataTableFont;

	internal string m_strDataTableCaption;

	internal Color m_DataTableColor;

	internal int m_lngResolution;

	internal bool m_blnSolidColor;

	internal string m_strValuesFormat;

	internal STYLECAPTION m_ValuesStyle;

	internal float m_sngSlantX;

	internal float m_sngSlantY;

	internal SmoothingMode m_Quality;

	internal bool m_blnSurface;

	internal STYLEWALLS m_WallsStyle;

	internal bool m_blnItemsLegend;

	internal bool m_blnAutoRefresh;

	internal bool m_blnXAxis;

	internal double[] m_arrCalculation;

	internal CALCULATION m_CalculationStyle;

	internal Pen m_CalculationLineStyle;

	internal STYLECAPTIONLOCATION m_ValuesLocationStyle;

	internal STYLEWALLBACKGROUND m_WallsBackStyle;

	internal Color m_WallsBackColorPrincipal;

	internal Color m_WallsBackColorSecondary;

	internal Color m_DataTableBackColor;

	internal STYLEPOINT m_PointStyle;

	internal int m_PointSize;

	internal int m_BubbleMaxRadius;

	internal bool m_LicenseActivated;

	internal bool m_blnXAxisLabelsRotated;

	internal bool m_blnYAxisLabelsRotated;

	internal bool m_blnMarkHighest;

	internal bool m_blnMarkLowest;

	internal string m_YAxisNumericFormat;

	internal SCALEMODE m_YAxisScaleMode;

	internal float m_YAxisScaleMinimum;

	internal float m_YAxisScaleMaximum;

	internal string m_XAxisNumericFormat;

	internal SCALEMODE m_XAxisScaleMode;

	internal float m_XAxisScaleMinimumNumeric;

	internal float m_XAxisScaleMaximumNumeric;

	internal DateTime m_XAxisScaleMinimumDateTime;

	internal DateTime m_XAxisScaleMaximumDateTime;

	internal Image[] m_arrSeriesPictures;

	internal Image m_GridBackgroundImage;

	internal int m_GridBackgroundImageTransparency;

	internal string[] m_arrItemsHighlight;

	internal StringAlignment m_ValuesAlignment;

	internal string m_YAxisTitle;

	internal Font m_YAxisTitleFont;

	internal string m_XAxisTitle;

	internal Font m_XAxisTitleFont;

	internal STYLEALIGNMENT m_LegendAlignment;

	internal int m_intDepth;

	internal bool m_blnShowPoints;

	internal int m_intHoleSize;

	internal float m_sngThickness;

	internal bool m_blnAllowBuiltinDialog;

	internal LANGUAGE m_BultInDialogLanguage;

	internal string m_strLicenseeInfo;

	internal Font m_YAxisValuesFont;

	internal Font m_XAxisValuesFont;

	internal int m_intMarginRight;

	internal int m_intMarginLeft;

	internal int m_intMarginTop;

	internal int m_intMarginBottom;

	internal int m_intXAxisHeight;

	internal STYLEYAXISLOCATION m_YAxisLocation;

	internal Collection m_Charts;

	internal int m_YAxisLeftWidth;

	internal int m_YAxisRightWidth;

	internal int m_YAxisCurrentWidth;

	internal bool m_blnCompositeMode;

	internal bool m_blnCompositing;

	internal Rectangle m_rectChart;

	internal int m_intLegendHeight;

	internal Color m_YAxisColor;

	internal Color m_XAxisColor;

	internal Color m_LegendBackColor;

	internal long m_lngNumDividersX;

	internal int m_intShadowOffset;

	internal bool m_blnColoredShadows;

	internal bool m_blnShadowSmooth;

	internal bool m_blnShowDividersY;

	internal bool m_blnXAxisLabelsRotated90;

	internal bool m_blnHotSpots;

	internal ValueCaptionRenderer m_vcc;

	internal ValueCaption m_caption;

	internal Color m_HotSpotBackColor;

	internal Color m_HotSpotColor;

	internal CustomGraphics _g;

	internal bool m_blnShowLegendInDatatable;

	internal DateTime m_XAxisMinDateTime;

	internal DateTime m_XAxisMaxDateTime;

	internal SolidBrush[] m_GaugeBackStyle;

	internal Pen[] m_GaugeBorderStyle;

	internal float[] m_GaugeCentralCircleRadius;

	internal SolidBrush[] m_GaugeCentralCircleBackStyle;

	internal Pen[] m_GaugeCentralCircleBorderStyle;

	internal Pen[] m_GaugeBigTickStyle;

	internal Pen[] m_GaugeSmallTickStyle;

	internal Pen[] m_GaugeNeedleStyle;

	internal float m_GaugeMarginFactor;

	internal YAXIS_INDICATORS[] m_YAxisIndicators;

	internal Pen[] m_arrSeriesBorderStyle;

	internal int m_YAxisTickLength;

	internal bool m_HotSpotCross;

	internal Pen m_HotSpotCrossLineStyle;

	internal string m_HotSpotDateTimeFormat;

	internal string m_HotSpotNumericFormat;

	internal Brush m_SurfaceBrushStyle;

	internal string m_GanttTodayLabel;

	internal DateTime m_GanttTodayDate;

	internal long m_DataTableHeight;

	internal ArrayList[] m_HotSpotToolTips;

	internal ArrayList[] m_ItemsColor;

	internal bool m_blnPermisoEscrituraDisco;

	internal bool m_blnItemsLegendSet;

	internal Pen m_GridLineStyle;

	internal double m_dblShowValuesMin;

	internal double m_dblShowValuesMax;

	internal Pen m_PieBorderStyle;

	internal int m_DataTableStartIndex;

	internal int m_DataTableLastIndex;

	internal int m_DataTableStartIndex_CurrentValue;

	internal int m_DataTableLastIndex_CurrentValue;

	internal int m_lngNumZ;

	internal bool m_blnShowDividersZ;

	internal double[] m_dblSeriesRangeSumZ;

	internal SCALEMODE m_ZAxisScaleMode;

	internal float m_ZAxisScaleMinimumNumeric;

	internal float m_ZAxisScaleMaximumNumeric;

	internal double m_dblSeriesMaxXAcum;

	internal double m_dblSeriesMinXAcum;

	internal double m_dblSeriesRangeXAcum;

	internal double m_dblSeriesMiddleXAcum;

	internal bool m_blnYAxis;

	internal bool m_blnZAxis;

	private float m_XYZ_minX;

	private float m_XYZ_maxX;

	private float m_XYZ_minY;

	private float m_XYZ_maxY;

	private bool m_XYZ_applyScale;

	internal float m_XYZ_YAngle;

	internal float m_XYZ_XAngle;

	internal float m_XYZ_ZAngle;

	private float m_XYZ_YAngle_LastValue;

	private float m_XYZ_cosYAngle;

	private float m_XYZ_sinYAngle;

	private float m_XYZ_XAngle_LastValue;

	private float m_XYZ_cosXAngle;

	private float m_XYZ_sinXAngle;

	private float m_XYZ_ZAngle_LastValue;

	private float m_XYZ_cosZAngle;

	private float m_XYZ_sinZAngle;

	internal int m_XAxisTickLength;

	internal int m_ZAxisTickLength;

	internal double m_dblSeriesMaxZAcum;

	internal double m_dblSeriesMinZAcum;

	internal double m_dblSeriesRangeZAcum;

	internal double m_dblSeriesMiddleZAcum;

	internal long m_lngNumDividersZ;

	internal string m_ZAxisNumericFormat;

	internal Font m_ZAxisValuesFont;

	internal Color m_ZAxisColor;

	internal string m_ZAxisTitle;

	internal string[] m_ValuesCaptions;

	internal Font m_ZAxisTitleFont;

	internal Image m_BackgroundImage;

	internal int[] m_SeriesPointSize;

	internal STYLEPOINT[] m_SeriesPointStyle;

	internal int m_SurfaceBrushMinBrightness;

	internal int m_SurfaceBrushMaxBrightness;

	internal float m_sngSeriesGap;

	internal bool m_blnSeriesFillStyleSet;

	internal ArrayList[] m_GaugeRangeColors;

	internal string[] m_GaugeTitles;

	internal Font m_GaugeTitlesFont;

	internal int m_HotSpotHitTestPrecision;

	internal SCALEMODE[] m_GaugesScaleMode;

	internal float[] m_GaugesScaleMinimum;

	internal float[] m_GaugesScaleMaximum;

	internal string[] m_GaugesNumericFormat;

	internal int[] m_GaugesDividersCount;

	internal float[] m_GaugesMin;

	internal float[] m_GaugesMax;

	internal float[] m_GaugesRange;

	internal bool m_FrontLayerShow;

	internal Color m_FrontLayerColor;

	internal string[] m_DataTableAdditionalRowValues;

	internal string m_DataTableAdditionalRowTitle;

	internal bool m_blnAnimating;

	internal bool m_HotSpotOutlineEnabled;

	internal Pen m_HotSpotOutlineStyle;

	internal ArrayList m_ItemsSelected;

	internal int m_MouseLastY;

	internal int m_MouseLastX;

	internal bool m_SurfaceWireOnly;

	internal DATASOURCE_SCHEME m_DataSourceMode;

	[AccessedThroughProperty("m_DataSource")]
	private DataGridView _m_DataSource;

	internal bool m_blnDataSourceUpdating;

	internal bool m_blnValueCaptionClickedWasSelected;

	internal bool m_blnZAxisLabelsRotated;

	internal SURFACE_GRADIENT_TYPE m_SurfaceGradientType;

	internal HsbColorUtil m_SurfaceGradientHueStart;

	internal HsbColorUtil m_SurfaceGradientHueEnd;

	internal Pen m_SeriesLineStyleDefault;

	internal bool m_ZoomEnabled;

	internal float m_ZoomFactor;

	internal float m_ZoomOffsetX;

	internal float m_ZoomOffsetY;

	internal float m_ZoomTargetFactor;

	internal float m_ZoomTargetOffsetX;

	internal float m_ZoomTargetOffsetY;

	internal float m_ZoomInterval;

	private System.Windows.Forms.Timer timerZoom;

	private bool m_ZoomOldChanges;

	internal ZOOM_MODE m_ZoomMode;

	internal float m_ZoomXAxisScaleMinOriginal;

	internal float m_ZoomXAxisSCaleMaxOriginal;

	internal float m_ZoomYAxisScaleMinOriginal;

	internal float m_ZoomYAxisScaleMaxOriginal;

	internal bool m_XAxisReverse;

	internal float m_ZoomOffsetZ;

	internal float m_ZoomTargetOffsetZ;

	internal float m_ZoomZAxisScaleMinOriginal;

	internal float m_ZoomZAxisScaleMaxOriginal;

	private string[] m_arrLegendCaptions;

	private Brush[] m_arrLegendColors;

	protected GraphicsPath gp;

	[SpecialName]
	private object _0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR;

	[SpecialName]
	private object _0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR;

	[SpecialName]
	private object _0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC;

	[SpecialName]
	private object _0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC;

	[SpecialName]
	private float _0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue;

	[SpecialName]
	private StaticLocalInitFlag _0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR_0024Init;

	[SpecialName]
	private StaticLocalInitFlag _0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR_0024Init;

	[SpecialName]
	private StaticLocalInitFlag _0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC_0024Init;

	[SpecialName]
	private StaticLocalInitFlag _0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC_0024Init;

	[SpecialName]
	private StaticLocalInitFlag _0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue_0024Init;

	[SpecialName]
	private bool _0024STATIC_0024Super2D3dGraph_MouseMove_002420211C1280B5_0024blnBusy;

	internal virtual DataGridView m_DataSource
	{
		get
		{
			return _m_DataSource;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		set
		{
			MouseEventHandler value2 = m_DataSource_MouseClick;
			EventHandler value3 = m_DataSource_SelectionChanged;
			DataGridViewCellEventHandler value4 = m_DataSource_CellValueChanged;
			if (_m_DataSource != null)
			{
				_m_DataSource.MouseClick -= value2;
				_m_DataSource.SelectionChanged -= value3;
				_m_DataSource.CellValueChanged -= value4;
			}
			_m_DataSource = value;
			if (_m_DataSource != null)
			{
				_m_DataSource.MouseClick += value2;
				_m_DataSource.SelectionChanged += value3;
				_m_DataSource.CellValueChanged += value4;
			}
		}
	}

	public bool ZoomEnabled
	{
		get
		{
			return m_ZoomEnabled;
		}
		set
		{
			m_ZoomEnabled = value;
			if (value)
			{
				ValidateParameters();
				timerZoom.Tick += TimerEventProcessor;
				timerZoom.Interval = 10;
				timerZoom.Start();
			}
			else
			{
				timerZoom.Enabled = false;
			}
		}
	}

	public float ZoomInterval
	{
		get
		{
			return m_ZoomInterval;
		}
		set
		{
			m_ZoomInterval = value;
		}
	}

	public float ZoomFactor
	{
		get
		{
			return m_ZoomFactor;
		}
		set
		{
			m_ZoomTargetFactor = value;
		}
	}

	public float ZoomOffsetX
	{
		get
		{
			return m_ZoomOffsetX;
		}
		set
		{
			m_ZoomOffsetX = value;
		}
	}

	public ZOOM_MODE ZoomMode
	{
		get
		{
			return m_ZoomMode;
		}
		set
		{
			m_ZoomMode = value;
		}
	}

	public float ZoomOffsetY
	{
		get
		{
			return m_ZoomOffsetY;
		}
		set
		{
			m_ZoomOffsetY = value;
		}
	}

	public float ZoomOffsetZ
	{
		get
		{
			return m_ZoomOffsetZ;
		}
		set
		{
			m_ZoomOffsetZ = value;
		}
	}

	public object[] AvailableStyles => new object[2] { names, values };

	public int HotSpotsHitTestPrecision
	{
		get
		{
			return m_HotSpotHitTestPrecision;
		}
		set
		{
			m_HotSpotHitTestPrecision = value;
		}
	}

	public bool ShowFrontLayer
	{
		get
		{
			return m_FrontLayerShow;
		}
		set
		{
			m_FrontLayerShow = value;
			m_RefreshGraph();
		}
	}

	public Color FrontLayerColor
	{
		get
		{
			return m_FrontLayerColor;
		}
		set
		{
			m_FrontLayerColor = value;
			m_RefreshGraph();
		}
	}

	public SCALEMODE[] GaugesScaleMode
	{
		get
		{
			return m_GaugesScaleMode;
		}
		set
		{
			m_GaugesScaleMode = value;
			m_RefreshGraph();
		}
	}

	public float[] GaugesScaleMaximum
	{
		get
		{
			return m_GaugesScaleMaximum;
		}
		set
		{
			m_GaugesScaleMaximum = value;
			m_RefreshGraph();
		}
	}

	public float[] GaugesScaleMinimum
	{
		get
		{
			return m_GaugesScaleMinimum;
		}
		set
		{
			m_GaugesScaleMinimum = value;
			m_RefreshGraph();
		}
	}

	public int[] GaugesDividersCount
	{
		get
		{
			return m_GaugesDividersCount;
		}
		set
		{
			m_GaugesDividersCount = value;
			m_RefreshGraph();
		}
	}

	public string[] GaugesNumericFormat
	{
		get
		{
			return m_GaugesNumericFormat;
		}
		set
		{
			m_GaugesNumericFormat = value;
			m_RefreshGraph();
		}
	}

	public Pen PieBorderStyle
	{
		get
		{
			return m_PieBorderStyle;
		}
		set
		{
			m_PieBorderStyle = value;
			m_RefreshGraph();
		}
	}

	public double ShowValuesMin
	{
		get
		{
			return m_dblShowValuesMin;
		}
		set
		{
			m_dblShowValuesMin = value;
			m_RefreshGraph();
		}
	}

	public double ShowValuesMax
	{
		get
		{
			return m_dblShowValuesMax;
		}
		set
		{
			m_dblShowValuesMax = value;
			m_RefreshGraph();
		}
	}

	public Pen GridLineStyle
	{
		get
		{
			return m_GridLineStyle;
		}
		set
		{
			m_GridLineStyle = value;
			m_RefreshGraph();
		}
	}

	public ArrayList[] ItemColors
	{
		get
		{
			return m_ItemsColor;
		}
		set
		{
			m_ItemsColor = value;
			m_RefreshGraph();
		}
	}

	public override Image BackgroundImage
	{
		get
		{
			return m_BackgroundImage;
		}
		set
		{
			m_BackgroundImage = value;
			m_BackStyle = STYLEBACKGROUND.STYLEBACKGROUND_IMAGE;
			m_RefreshGraph();
		}
	}

	public Brush SurfaceBrushStyle
	{
		get
		{
			return m_SurfaceBrushStyle;
		}
		set
		{
			m_SurfaceBrushStyle = value;
			m_RefreshGraph();
		}
	}

	public SURFACE_GRADIENT_TYPE SurfaceGradientType
	{
		get
		{
			return m_SurfaceGradientType;
		}
		set
		{
			m_SurfaceGradientType = value;
			m_RefreshGraph();
		}
	}

	public HsbColorUtil SurfaceGradientHueStart
	{
		get
		{
			return m_SurfaceGradientHueStart;
		}
		set
		{
			m_SurfaceGradientHueStart = value;
			m_RefreshGraph();
		}
	}

	public HsbColorUtil SurfaceGradientHueEnd
	{
		get
		{
			return m_SurfaceGradientHueEnd;
		}
		set
		{
			m_SurfaceGradientHueEnd = value;
			m_RefreshGraph();
		}
	}

	public bool SurfaceWireOnly
	{
		get
		{
			return m_SurfaceWireOnly;
		}
		set
		{
			m_SurfaceWireOnly = value;
		}
	}

	public int SurfaceBrushMinBrightness
	{
		get
		{
			return m_SurfaceBrushMinBrightness;
		}
		set
		{
			m_SurfaceBrushMinBrightness = value;
			m_RefreshGraph();
		}
	}

	public int SurfaceBrushMaxBrightness
	{
		get
		{
			return m_SurfaceBrushMaxBrightness;
		}
		set
		{
			if (value > m_SurfaceBrushMinBrightness)
			{
				m_SurfaceBrushMaxBrightness = value;
				m_RefreshGraph();
			}
		}
	}

	public DateTime GanttSetToday
	{
		get
		{
			return m_GanttTodayDate;
		}
		set
		{
			m_GanttTodayDate = value;
			m_RefreshGraph();
		}
	}

	public string GanttSetTodayLabel
	{
		get
		{
			return m_GanttTodayLabel;
		}
		set
		{
			m_GanttTodayLabel = value;
			m_RefreshGraph();
		}
	}

	public string HotSpotNumericFormat
	{
		get
		{
			return m_HotSpotNumericFormat;
		}
		set
		{
			m_HotSpotNumericFormat = value;
		}
	}

	public string HotSpotDateTimeFormat
	{
		get
		{
			return m_HotSpotDateTimeFormat;
		}
		set
		{
			m_HotSpotDateTimeFormat = value;
		}
	}

	public bool HotSpotShowCross
	{
		get
		{
			return m_HotSpotCross;
		}
		set
		{
			m_HotSpotCross = value;
			m_RefreshGraph();
		}
	}

	public Pen HotSpotCrossLineStyle
	{
		get
		{
			return m_HotSpotCrossLineStyle;
		}
		set
		{
			m_HotSpotCrossLineStyle = value;
			m_RefreshGraph();
		}
	}

	public ArrayList[] HotSpotTooltips
	{
		get
		{
			return m_HotSpotToolTips;
		}
		set
		{
			m_HotSpotToolTips = value;
		}
	}

	public string[] ValuesCaptions
	{
		get
		{
			return m_ValuesCaptions;
		}
		set
		{
			m_ValuesCaptions = value;
			m_RefreshGraph();
		}
	}

	public YAXIS_INDICATORS[] YAxisIndicators
	{
		get
		{
			return m_YAxisIndicators;
		}
		set
		{
			m_YAxisIndicators = value;
			m_RefreshGraph();
		}
	}

	public float GaugeMarginFactor
	{
		get
		{
			return m_GaugeMarginFactor;
		}
		set
		{
			m_GaugeMarginFactor = value;
			m_RefreshGraph();
		}
	}

	public Pen[] GaugeNeedleStyle
	{
		get
		{
			return m_GaugeNeedleStyle;
		}
		set
		{
			m_GaugeNeedleStyle = value;
			m_RefreshGraph();
		}
	}

	public Pen[] GaugeBigTickStyle
	{
		get
		{
			return m_GaugeBigTickStyle;
		}
		set
		{
			m_GaugeBigTickStyle = value;
			m_RefreshGraph();
		}
	}

	public Pen[] GaugeSmallTickStyle
	{
		get
		{
			return m_GaugeSmallTickStyle;
		}
		set
		{
			m_GaugeSmallTickStyle = value;
			m_RefreshGraph();
		}
	}

	public SolidBrush[] GaugeBackStyle
	{
		get
		{
			return m_GaugeBackStyle;
		}
		set
		{
			m_GaugeBackStyle = value;
			m_RefreshGraph();
		}
	}

	public Pen[] GaugeBorderStyle
	{
		get
		{
			return m_GaugeBorderStyle;
		}
		set
		{
			m_GaugeBorderStyle = value;
			m_RefreshGraph();
		}
	}

	public ArrayList[] GaugeRangeColors
	{
		get
		{
			return m_GaugeRangeColors;
		}
		set
		{
			m_GaugeRangeColors = value;
			m_RefreshGraph();
		}
	}

	public string[] GaugeTitles
	{
		get
		{
			return m_GaugeTitles;
		}
		set
		{
			m_GaugeTitles = value;
			m_RefreshGraph();
		}
	}

	public Font GaugeTitlesFont
	{
		get
		{
			return m_GaugeTitlesFont;
		}
		set
		{
			m_GaugeTitlesFont = value;
			m_RefreshGraph();
		}
	}

	public float[] GaugeCentralCircleRadius
	{
		get
		{
			return m_GaugeCentralCircleRadius;
		}
		set
		{
			m_GaugeCentralCircleRadius = value;
			m_RefreshGraph();
		}
	}

	public SolidBrush[] GaugeCentralCircleBackStyle
	{
		get
		{
			return m_GaugeCentralCircleBackStyle;
		}
		set
		{
			m_GaugeCentralCircleBackStyle = value;
			m_RefreshGraph();
		}
	}

	public Pen[] GaugeCentralCircleBorderStyle
	{
		get
		{
			return m_GaugeCentralCircleBorderStyle;
		}
		set
		{
			m_GaugeCentralCircleBorderStyle = value;
			m_RefreshGraph();
		}
	}

	public Font LegendFont
	{
		get
		{
			return m_LegendFont;
		}
		set
		{
			m_LegendFont = value;
			m_RefreshGraph();
		}
	}

	public Color HotSpotColor
	{
		get
		{
			return m_HotSpotColor;
		}
		set
		{
			m_HotSpotColor = value;
		}
	}

	public Color HotSpotBackColor
	{
		get
		{
			return m_HotSpotBackColor;
		}
		set
		{
			m_HotSpotBackColor = value;
		}
	}

	public bool HotSpotOutlineEnabled
	{
		get
		{
			return m_HotSpotOutlineEnabled;
		}
		set
		{
			m_HotSpotOutlineEnabled = value;
			if (!value)
			{
				SelectionClear();
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	public Pen HotSpotOutlineStyle
	{
		get
		{
			return m_HotSpotOutlineStyle;
		}
		set
		{
			m_HotSpotOutlineStyle = value;
		}
	}

	public bool HotSpotsEnabled
	{
		get
		{
			return m_blnHotSpots;
		}
		set
		{
			m_blnHotSpots = value;
			if (!value)
			{
				m_caption = null;
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	public bool XAxisLabelsRotated90
	{
		get
		{
			return m_blnXAxisLabelsRotated90;
		}
		set
		{
			m_blnXAxisLabelsRotated90 = value;
			m_blnXAxisLabelsRotated = false;
			m_RefreshGraph();
		}
	}

	public bool ShadowSmooth
	{
		get
		{
			return m_blnShadowSmooth;
		}
		set
		{
			m_blnShadowSmooth = value;
			if (!value)
			{
				m_blnXAxisLabelsRotated90 = false;
			}
			m_RefreshGraph();
		}
	}

	public bool ShadowColored
	{
		get
		{
			return m_blnColoredShadows;
		}
		set
		{
			m_blnColoredShadows = value;
			m_RefreshGraph();
		}
	}

	public int ShadowOffset
	{
		get
		{
			return m_intShadowOffset;
		}
		set
		{
			m_intShadowOffset = value;
			m_RefreshGraph();
		}
	}

	public Color LegendBackColor
	{
		get
		{
			return m_LegendBackColor;
		}
		set
		{
			m_LegendBackColor = value;
			m_RefreshGraph();
		}
	}

	public Color XAxisColor
	{
		get
		{
			return m_XAxisColor;
		}
		set
		{
			m_XAxisColor = value;
			m_RefreshGraph();
		}
	}

	public float XAxisAngle
	{
		get
		{
			return m_XYZ_XAngle;
		}
		set
		{
			m_XYZ_XAngle = value;
			m_RefreshGraph();
		}
	}

	public bool XAxisReverseOrder
	{
		get
		{
			return m_XAxisReverse;
		}
		set
		{
			m_XAxisReverse = value;
			m_RefreshGraph();
		}
	}

	public float YAxisAngle
	{
		get
		{
			return m_XYZ_YAngle;
		}
		set
		{
			m_XYZ_YAngle = value;
			m_RefreshGraph();
		}
	}

	public float ZAxisAngle
	{
		get
		{
			return m_XYZ_ZAngle;
		}
		set
		{
			m_XYZ_ZAngle = value;
			m_RefreshGraph();
		}
	}

	public Font ZAxisValuesFont
	{
		get
		{
			return m_ZAxisValuesFont;
		}
		set
		{
			m_ZAxisValuesFont = value;
			m_RefreshGraph();
		}
	}

	public string ZAxisNumericFormat
	{
		get
		{
			return m_ZAxisNumericFormat;
		}
		set
		{
			m_ZAxisNumericFormat = value;
			if (Operators.CompareString(value, " ", TextCompare: false) == 0)
			{
				m_ZAxisTickLength = 0;
			}
			else
			{
				m_ZAxisTickLength = 5;
			}
			m_RefreshGraph();
		}
	}

	public Color YAxisColor
	{
		get
		{
			return m_YAxisColor;
		}
		set
		{
			m_YAxisColor = value;
			m_RefreshGraph();
		}
	}

	public Color ZAxisColor
	{
		get
		{
			return m_ZAxisColor;
		}
		set
		{
			m_ZAxisColor = value;
			m_RefreshGraph();
		}
	}

	public bool CompositeMode
	{
		get
		{
			return m_blnCompositeMode;
		}
		set
		{
			m_blnCompositeMode = value;
		}
	}

	public Rectangle ChartInnerRectangle
	{
		get
		{
			return m_rectChart;
		}
		set
		{
			m_rectChart = value;
		}
	}

	public int YAxisLeftWidth
	{
		get
		{
			return m_YAxisLeftWidth;
		}
		set
		{
			m_YAxisLeftWidth = value;
			m_RefreshGraph();
		}
	}

	public int YAxisRightWidth
	{
		get
		{
			return m_YAxisRightWidth;
		}
		set
		{
			m_YAxisRightWidth = value;
			m_RefreshGraph();
		}
	}

	public int YAxisCurrentWidth
	{
		get
		{
			if (whichYAxis == m_YAxisLocation)
			{
				if (m_YAxisCurrentWidth == 0)
				{
					m_RefreshGraph(blnForce: true);
				}
				return m_YAxisCurrentWidth;
			}
			int result = default(int);
			return result;
		}
		set
		{
			m_YAxisCurrentWidth = value;
		}
	}

	public int YAxisTickLength
	{
		get
		{
			return m_YAxisTickLength;
		}
		set
		{
			m_YAxisTickLength = value;
			m_RefreshGraph();
		}
	}

	public int XAxisTickLength
	{
		get
		{
			return m_XAxisTickLength;
		}
		set
		{
			m_XAxisTickLength = value;
			m_RefreshGraph();
		}
	}

	public int ZAxisTickLength
	{
		get
		{
			return m_ZAxisTickLength;
		}
		set
		{
			m_ZAxisTickLength = value;
			m_RefreshGraph();
		}
	}

	public long ZAxisDividersCount
	{
		get
		{
			return m_lngNumDividersZ;
		}
		set
		{
			m_lngNumDividersZ = value;
			m_RefreshGraph();
		}
	}

	internal ArrayList ItemsSelected => m_ItemsSelected;

	public STYLEYAXISLOCATION YAxisLocation
	{
		get
		{
			return m_YAxisLocation;
		}
		set
		{
			m_YAxisLocation = value;
			m_RefreshGraph();
		}
	}

	public int XAxisHeight
	{
		get
		{
			return m_intXAxisHeight;
		}
		set
		{
			m_intXAxisHeight = value;
			m_RefreshGraph();
		}
	}

	public Font YAxisValuesFont
	{
		get
		{
			return m_YAxisValuesFont;
		}
		set
		{
			m_YAxisValuesFont = value;
			m_RefreshGraph();
		}
	}

	public Font XAxisValuesFont
	{
		get
		{
			return m_XAxisValuesFont;
		}
		set
		{
			m_XAxisValuesFont = value;
			m_RefreshGraph();
		}
	}

	public int SeriesDimensions
	{
		get
		{
			checked
			{
				int result;
				try
				{
					if (Information.IsArray(m_arrSeries))
					{
						result = ((m_arrSeries[0] != null) ? ((!Information.IsArray(RuntimeHelpers.GetObjectValue(m_arrSeries[0][0]))) ? 1 : Conversions.ToInteger(NewLateBinding.LateGet(m_arrSeries[0][0], null, "length", new object[0], null, null, null))) : 0);
					}
					else
					{
						int num = values.Length;
						int num2 = 1;
						while (true)
						{
							if (num2 <= num)
							{
								if (values[num2 - 1] == m_lngStyle)
								{
									result = chartDimensions[num2 - 1];
									break;
								}
								num2++;
								continue;
							}
							result = 0;
							break;
						}
					}
				}
				catch (Exception projectError)
				{
					ProjectData.SetProjectError(projectError);
					result = 0;
					ProjectData.ClearProjectError();
				}
				return result;
			}
		}
	}

	public Pen[] SeriesBorderStyle
	{
		get
		{
			return m_arrSeriesBorderStyle;
		}
		set
		{
			m_arrSeriesBorderStyle = value;
			m_RefreshGraph();
		}
	}

	public bool BuiltinDialogAllowed
	{
		get
		{
			return m_blnAllowBuiltinDialog;
		}
		set
		{
			m_blnAllowBuiltinDialog = value;
			if (m_blnAllowBuiltinDialog)
			{
				m_RefreshContextualMenu();
			}
			else
			{
				ContextMenu = null;
			}
		}
	}

	public LANGUAGE BuiltinDialogLanguage
	{
		get
		{
			return m_BultInDialogLanguage;
		}
		set
		{
			m_BultInDialogLanguage = value;
			switch (value)
			{
			case LANGUAGE.LANG_ENGLISH:
				names = names_English;
				additionalCalculations = additionalCalculations_English;
				backgroundStyles = backgroundStyles_English;
				break;
			case LANGUAGE.LANG_SPANISH:
				names = names_Spanish;
				additionalCalculations = additionalCalculations_Spanish;
				backgroundStyles = backgroundStyles_Spanish;
				break;
			}
			if (m_blnAllowBuiltinDialog)
			{
				m_RefreshContextualMenu();
			}
		}
	}

	private float m_sngCalcThickness
	{
		get
		{
			if (m_sngThickness > 1f)
			{
				return m_sngThickness;
			}
			return maxWidth * m_sngThickness;
		}
	}

	public float Thickness
	{
		get
		{
			return m_sngThickness;
		}
		set
		{
			m_sngThickness = value;
			m_RefreshGraph();
		}
	}

	public float SeriesGap
	{
		get
		{
			return m_sngSeriesGap;
		}
		set
		{
			m_sngSeriesGap = value;
			m_RefreshGraph();
		}
	}

	public int HoleSize
	{
		get
		{
			return m_intHoleSize;
		}
		set
		{
			m_intHoleSize = Math.Min(Math.Max(value, 5), 95);
			m_RefreshGraph();
		}
	}

	public bool ShowPoints
	{
		get
		{
			return m_blnShowPoints;
		}
		set
		{
			m_blnShowPoints = value;
			m_RefreshGraph();
		}
	}

	public STYLEALIGNMENT LegendAlignment
	{
		get
		{
			return m_LegendAlignment;
		}
		set
		{
			m_LegendAlignment = value;
			m_RefreshGraph();
		}
	}

	public string YAxisTitle
	{
		get
		{
			return m_YAxisTitle;
		}
		set
		{
			m_YAxisTitle = value;
			m_RefreshGraph();
		}
	}

	public Font YAxisTitleFont
	{
		get
		{
			return m_YAxisTitleFont;
		}
		set
		{
			m_YAxisTitleFont = value;
			m_RefreshGraph();
		}
	}

	public string XAxisTitle
	{
		get
		{
			return m_XAxisTitle;
		}
		set
		{
			m_XAxisTitle = value;
			m_RefreshGraph();
		}
	}

	public Font XAxisTitleFont
	{
		get
		{
			return m_XAxisTitleFont;
		}
		set
		{
			m_XAxisTitleFont = value;
			m_RefreshGraph();
		}
	}

	public string ZAxisTitle
	{
		get
		{
			return m_ZAxisTitle;
		}
		set
		{
			m_ZAxisTitle = value;
			m_RefreshGraph();
		}
	}

	public Font ZAxisTitleFont
	{
		get
		{
			return m_ZAxisTitleFont;
		}
		set
		{
			m_ZAxisTitleFont = value;
			m_RefreshGraph();
		}
	}

	public StringAlignment ValuesAlignment
	{
		get
		{
			return m_ValuesAlignment;
		}
		set
		{
			m_ValuesAlignment = value;
			m_RefreshGraph();
		}
	}

	public string LegendText
	{
		get
		{
			return m_strLegendCaption;
		}
		set
		{
			m_strLegendCaption = value;
			m_RefreshGraph();
		}
	}

	public string[] ItemsHighlight
	{
		get
		{
			return m_arrItemsHighlight;
		}
		set
		{
			m_arrItemsHighlight = value;
			m_RefreshGraph();
		}
	}

	public Image[] SeriesPictures
	{
		get
		{
			return m_arrSeriesPictures;
		}
		set
		{
			m_arrSeriesPictures = value;
			m_RefreshGraph();
		}
	}

	public string YAxisNumericFormat
	{
		get
		{
			return m_YAxisNumericFormat;
		}
		set
		{
			m_YAxisNumericFormat = value;
			if (Operators.CompareString(value, " ", TextCompare: false) == 0)
			{
				m_YAxisLeftWidth = 0;
				m_YAxisTickLength = 0;
			}
			else
			{
				m_YAxisTickLength = 5;
			}
			m_RefreshGraph();
		}
	}

	public SCALEMODE YAxisScaleMode
	{
		get
		{
			return m_YAxisScaleMode;
		}
		set
		{
			m_YAxisScaleMode = value;
			m_GaugesScaleMode = null;
			m_DoCalc();
			m_RefreshGraph();
		}
	}

	public float YAxisScaleMinimum
	{
		get
		{
			return m_YAxisScaleMinimum;
		}
		set
		{
			m_YAxisScaleMinimum = value;
			m_ZoomYAxisScaleMinOriginal = value;
			m_GaugesScaleMinimum = null;
			m_DoCalc();
			m_RefreshGraph();
		}
	}

	public float YAxisScaleMaximum
	{
		get
		{
			return m_YAxisScaleMaximum;
		}
		set
		{
			m_YAxisScaleMaximum = value;
			m_ZoomYAxisScaleMaxOriginal = value;
			m_GaugesScaleMaximum = null;
			m_DoCalc();
			m_RefreshGraph();
		}
	}

	public SCALEMODE ZAxisScaleMode
	{
		get
		{
			return m_ZAxisScaleMode;
		}
		set
		{
			m_ZAxisScaleMode = value;
			m_DoCalc();
			m_RefreshGraph();
		}
	}

	public float ZAxisScaleMinimum
	{
		get
		{
			return m_ZAxisScaleMinimumNumeric;
		}
		set
		{
			m_ZAxisScaleMinimumNumeric = value;
			m_ZoomZAxisScaleMinOriginal = value;
			m_DoCalc();
			m_RefreshGraph();
		}
	}

	public float ZAxisScaleMaximum
	{
		get
		{
			return m_ZAxisScaleMaximumNumeric;
		}
		set
		{
			m_ZAxisScaleMaximumNumeric = value;
			m_ZoomZAxisScaleMaxOriginal = value;
			m_DoCalc();
			m_RefreshGraph();
		}
	}

	public bool ZAxisLabelsRotated
	{
		get
		{
			return m_blnZAxisLabelsRotated;
		}
		set
		{
			m_blnZAxisLabelsRotated = value;
			m_RefreshGraph();
		}
	}

	public string XAxisNumericFormat
	{
		get
		{
			return m_XAxisNumericFormat;
		}
		set
		{
			m_XAxisNumericFormat = value;
			m_RefreshGraph();
		}
	}

	public SCALEMODE XAxisScaleMode
	{
		get
		{
			return m_XAxisScaleMode;
		}
		set
		{
			m_XAxisScaleMode = value;
			m_DoCalc();
			m_RefreshGraph();
		}
	}

	public float XAxisScaleMinimum
	{
		get
		{
			return m_XAxisScaleMinimumNumeric;
		}
		set
		{
			m_XAxisScaleMinimumNumeric = value;
			m_ZoomXAxisScaleMinOriginal = value;
			m_DoCalc();
			m_RefreshGraph();
		}
	}

	public DateTime XAxisScaleMinimumDateTime
	{
		get
		{
			return m_XAxisScaleMinimumDateTime;
		}
		set
		{
			m_XAxisScaleMinimumDateTime = value;
			m_RefreshGraph();
		}
	}

	public float XAxisScaleMaximum
	{
		get
		{
			return m_XAxisScaleMaximumNumeric;
		}
		set
		{
			m_XAxisScaleMaximumNumeric = value;
			m_ZoomXAxisSCaleMaxOriginal = value;
			m_DoCalc();
			m_RefreshGraph();
		}
	}

	public DateTime XAxisScaleMaximumDateTime
	{
		get
		{
			return m_XAxisScaleMaximumDateTime;
		}
		set
		{
			m_XAxisScaleMaximumDateTime = value;
			m_RefreshGraph();
		}
	}

	public int MarginTop
	{
		get
		{
			return m_intMarginTop;
		}
		set
		{
			m_intMarginTop = value;
			m_RefreshGraph();
		}
	}

	public int MarginLeft
	{
		get
		{
			return m_intMarginLeft;
		}
		set
		{
			m_intMarginLeft = value;
			m_RefreshGraph();
		}
	}

	public int MarginRight
	{
		get
		{
			return m_intMarginRight;
		}
		set
		{
			m_intMarginRight = value;
			m_RefreshGraph();
		}
	}

	public int MarginBottom
	{
		get
		{
			return m_intMarginBottom;
		}
		set
		{
			m_intMarginBottom = value;
			m_RefreshGraph();
		}
	}

	internal double SeriesMaxY => m_dblSeriesMaxY;

	internal double SeriesMinY => m_dblSeriesMinY;

	public bool MarkHighest
	{
		get
		{
			return m_blnMarkHighest;
		}
		set
		{
			m_blnMarkHighest = value;
			m_RefreshGraph();
		}
	}

	public bool MarkLowest
	{
		get
		{
			return m_blnMarkLowest;
		}
		set
		{
			m_blnMarkLowest = value;
			m_RefreshGraph();
		}
	}

	public bool YAxisLabelsRotated
	{
		get
		{
			return m_blnYAxisLabelsRotated;
		}
		set
		{
			m_blnYAxisLabelsRotated = value;
			m_RefreshGraph();
		}
	}

	public bool XAxisLabelsRotated
	{
		get
		{
			return m_blnXAxisLabelsRotated;
		}
		set
		{
			m_blnXAxisLabelsRotated = value;
			m_blnXAxisLabelsRotated90 = false;
			m_RefreshGraph();
		}
	}

	public int BubbleMaxRadius
	{
		get
		{
			return m_BubbleMaxRadius;
		}
		set
		{
			m_BubbleMaxRadius = value;
			m_RefreshGraph();
		}
	}

	public STYLEPOINT PointStyle
	{
		get
		{
			return m_PointStyle;
		}
		set
		{
			m_PointStyle = value;
			m_RefreshGraph();
		}
	}

	public int PointSize
	{
		get
		{
			return m_PointSize;
		}
		set
		{
			m_PointSize = value;
			m_RefreshGraph();
		}
	}

	public Color DataTableColor
	{
		get
		{
			return m_DataTableColor;
		}
		set
		{
			m_DataTableColor = value;
			m_RefreshGraph();
		}
	}

	public Color DataTableBackColor
	{
		get
		{
			return m_DataTableBackColor;
		}
		set
		{
			m_DataTableBackColor = value;
			m_RefreshGraph();
		}
	}

	public int DataTableStartIndex
	{
		get
		{
			return m_DataTableStartIndex;
		}
		set
		{
			if (value >= 0)
			{
				m_DataTableStartIndex = value;
				m_RefreshGraph();
			}
		}
	}

	public int DataTableLastIndex
	{
		get
		{
			return m_DataTableLastIndex;
		}
		set
		{
			if (value >= 0)
			{
				m_DataTableLastIndex = value;
				m_RefreshGraph();
			}
		}
	}

	public Font DataTableFont
	{
		get
		{
			return m_DataTableFont;
		}
		set
		{
			m_DataTableFont = value;
			m_RefreshGraph();
		}
	}

	public bool ShowLegendInDataTable
	{
		get
		{
			return m_blnShowLegendInDatatable;
		}
		set
		{
			m_blnShowLegendInDatatable = value;
			m_RefreshGraph();
		}
	}

	public string DataTableText
	{
		get
		{
			return m_strDataTableCaption;
		}
		set
		{
			m_strDataTableCaption = value;
			m_RefreshGraph();
		}
	}

	public string[] DataTableAdditionalRowValues
	{
		get
		{
			return m_DataTableAdditionalRowValues;
		}
		set
		{
			m_DataTableAdditionalRowValues = value;
			m_RefreshGraph();
		}
	}

	public string DataTableAdditionalRowTitle
	{
		get
		{
			return m_DataTableAdditionalRowTitle;
		}
		set
		{
			m_DataTableAdditionalRowTitle = value;
			m_RefreshGraph();
		}
	}

	public STYLEWALLBACKGROUND WallsBackStyle
	{
		get
		{
			return m_WallsBackStyle;
		}
		set
		{
			m_WallsBackStyle = value;
			if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_SOLID)
			{
				m_WallsBackColorSecondary = m_WallsBackColorPrincipal;
			}
			m_RefreshGraph();
		}
	}

	public Color WallsBackColorPrincipal
	{
		get
		{
			return m_WallsBackColorPrincipal;
		}
		set
		{
			m_WallsBackColorPrincipal = value;
			if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_SOLID)
			{
				m_WallsBackColorSecondary = value;
			}
			else
			{
				m_WallsBackColorSecondary = ControlPaint.LightLight(m_WallsBackColorPrincipal);
			}
			m_RefreshGraph();
		}
	}

	public Color WallsBackColorSecondary
	{
		get
		{
			return m_WallsBackColorSecondary;
		}
		set
		{
			m_WallsBackColorSecondary = value;
			m_RefreshGraph();
		}
	}

	[Description("Unique licensee identifier.")]
	public string LicenseeIdentifier
	{
		get
		{
			return m_strLicenseeInfo;
		}
		set
		{
			if ((Operators.CompareString(value, "", TextCompare: false) == 0) | Versioned.IsNumeric(value))
			{
				return;
			}
			try
			{
				m_LicenseActivated = true;
				m_strLicenseeInfo = value;
				m_RefreshContextualMenu();
				m_RefreshGraph();
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	public Pen CalculationLineStyle
	{
		get
		{
			return m_CalculationLineStyle;
		}
		set
		{
			m_CalculationLineStyle = value;
			m_RefreshGraph();
		}
	}

	public CALCULATION Calculation
	{
		get
		{
			return m_CalculationStyle;
		}
		set
		{
			m_CalculationStyle = value;
			m_DoCalcAdditional();
			m_RefreshGraph();
		}
	}

	public Trendline CalculationTrendLine => Statistics.CalculateLinearRegression2D(Series[serieIndex]);

	public bool ShowXAxis
	{
		get
		{
			return m_blnXAxis;
		}
		set
		{
			m_blnXAxis = value;
			m_RefreshGraph();
		}
	}

	public bool ShowYAxis
	{
		get
		{
			return m_blnYAxis;
		}
		set
		{
			m_blnYAxis = value;
			m_RefreshGraph();
		}
	}

	public bool ShowZAxis
	{
		get
		{
			return m_blnZAxis;
		}
		set
		{
			m_blnZAxis = value;
			m_RefreshGraph();
		}
	}

	public bool AutoRefresh
	{
		get
		{
			return m_blnAutoRefresh;
		}
		set
		{
			if (value)
			{
				RefreshChart();
			}
			m_blnAutoRefresh = value;
		}
	}

	public bool ShowItemsLegend
	{
		get
		{
			return m_blnItemsLegend;
		}
		set
		{
			m_blnItemsLegend = value;
			m_RefreshGraph();
		}
	}

	public Color ValuesColor
	{
		get
		{
			return m_ValuesColor;
		}
		set
		{
			m_ValuesColor = value;
			m_RefreshGraph();
		}
	}

	public Color ValuesBackColor
	{
		get
		{
			return m_ValuesBackColor;
		}
		set
		{
			m_ValuesBackColor = value;
			m_RefreshGraph();
		}
	}

	public STYLECAPTION ValuesStyle
	{
		get
		{
			return m_ValuesStyle;
		}
		set
		{
			m_ValuesStyle = value;
			m_RefreshGraph();
		}
	}

	public STYLECAPTIONLOCATION ValuesLocationStyle
	{
		get
		{
			return m_ValuesLocationStyle;
		}
		set
		{
			m_ValuesLocationStyle = value;
			m_RefreshGraph();
		}
	}

	public string ValuesFormat
	{
		get
		{
			return m_strValuesFormat;
		}
		set
		{
			m_strValuesFormat = value;
			m_RefreshGraph();
		}
	}

	public int Resolution
	{
		get
		{
			return m_lngResolution;
		}
		set
		{
			m_lngResolution = value;
			m_RefreshGraph(blnForce: true);
		}
	}

	public bool ShowSurface
	{
		get
		{
			return m_blnSurface;
		}
		set
		{
			m_blnSurface = value;
			m_RefreshGraph();
		}
	}

	public bool ShowSolidColors
	{
		get
		{
			return m_blnSolidColor;
		}
		set
		{
			m_blnSolidColor = value;
			m_RefreshGraph();
		}
	}

	public bool ShowDataTable
	{
		get
		{
			return m_blnDataTable;
		}
		set
		{
			m_blnDataTable = value;
			m_RefreshGraph();
		}
	}

	public string[] SeriesLegend
	{
		get
		{
			return m_arrSeriesLegend;
		}
		set
		{
			m_arrSeriesLegend = value;
			m_RefreshGraph();
		}
	}

	public string[] ItemsLegend
	{
		get
		{
			return m_arrItemsLegend;
		}
		set
		{
			m_arrItemsLegend = value;
			m_RefreshGraph();
		}
	}

	public Color LegendColor
	{
		get
		{
			return m_LegendColor;
		}
		set
		{
			m_LegendColor = value;
			m_RefreshGraph();
		}
	}

	protected long DataTableHeight => m_DataTableHeight;

	public bool ShowLegend
	{
		get
		{
			return m_blnLegend;
		}
		set
		{
			m_blnLegend = value;
			m_RefreshGraph();
		}
	}

	public bool CastShadows
	{
		get
		{
			return m_blnShadow;
		}
		set
		{
			m_blnShadow = value;
			m_RefreshGraph();
		}
	}

	public Brush[] SeriesFillStyle
	{
		get
		{
			return m_arrSeriesFillStyle;
		}
		set
		{
			m_arrSeriesFillStyle = value;
			m_blnSeriesFillStyleSet = value != null;
			m_RefreshGraph();
		}
	}

	public Pen[] SeriesLineStyle
	{
		get
		{
			return m_arrSeriesLineStyle;
		}
		set
		{
			m_arrSeriesLineStyle = value;
			m_RefreshGraph();
		}
	}

	public ArrayList[] Series
	{
		get
		{
			return m_arrSeries;
		}
		set
		{
			m_caption = null;
			SelectionClear();
			m_arrSeries = value;
			m_DoCalc();
			m_RefreshGraph();
			m_RefreshContextualMenu();
		}
	}

	public string SeriesFromString
	{
		set
		{
			string[] array = value.Split(';');
			checked
			{
				ArrayList[] array2 = new ArrayList[array.Length - 1 + 1];
				int num = array.Length;
				for (int i = 1; i <= num; i++)
				{
					string[] array3 = array[i - 1].Split(',');
					array2[i - 1] = new ArrayList();
					int num2 = array3.Length;
					for (int j = 1; j <= num2; j++)
					{
						try
						{
							array2[i - 1].Add(Conversion.Val(array3[j - 1]));
						}
						catch (Exception projectError)
						{
							ProjectData.SetProjectError(projectError);
							array2[i - 1].Add(0);
							ProjectData.ClearProjectError();
						}
					}
				}
				Series = array2;
			}
		}
	}

	public bool YAxisShowDividers
	{
		get
		{
			return m_blnShowDividersY;
		}
		set
		{
			m_blnShowDividersY = value;
			m_RefreshGraph();
		}
	}

	public bool ZAxisShowDividers
	{
		get
		{
			return m_blnShowDividersZ;
		}
		set
		{
			m_blnShowDividersZ = value;
			m_RefreshGraph();
		}
	}

	public STYLEPOINT[] SeriesPointStyle
	{
		get
		{
			return m_SeriesPointStyle;
		}
		set
		{
			m_SeriesPointStyle = value;
			m_RefreshGraph();
		}
	}

	public int[] SeriesPointSize
	{
		get
		{
			return m_SeriesPointSize;
		}
		set
		{
			m_SeriesPointSize = value;
			m_RefreshGraph();
		}
	}

	public Color[] SeriesColor
	{
		get
		{
			return m_arrSeriesColor;
		}
		set
		{
			m_arrSeriesColor = value;
			m_blnSeriesFillStyleSet = false;
			checked
			{
				if (Information.IsArray(m_arrSeriesFillStyle))
				{
					int num = Math.Min(m_arrSeriesColor.Length, m_arrSeriesFillStyle.Length) - 1;
					for (int i = 0; i <= num; i++)
					{
						m_arrSeriesFillStyle[i] = new SolidBrush(m_arrSeriesColor[i]);
					}
				}
				if (Information.IsArray(m_arrSeriesLineStyle))
				{
					int num2 = Math.Min(m_arrSeriesColor.Length, m_arrSeriesLineStyle.Length) - 1;
					for (int j = 0; j <= num2; j++)
					{
						if (m_arrSeriesLineStyle[j] != null)
						{
							m_arrSeriesLineStyle[j] = new Pen(m_arrSeriesColor[j], m_arrSeriesLineStyle[j].Width);
						}
						else
						{
							m_arrSeriesLineStyle[j] = new Pen(m_arrSeriesColor[j]);
						}
					}
				}
				m_RefreshGraph();
			}
		}
	}

	public long YAxisDividersCount
	{
		get
		{
			return m_lngNumDividersY;
		}
		set
		{
			m_lngNumDividersY = value;
			m_RefreshGraph();
		}
	}

	public long XAxisDividersCount
	{
		get
		{
			return m_lngNumDividersX;
		}
		set
		{
			m_lngNumDividersX = value;
			m_RefreshGraph();
		}
	}

	public Color BorderColor
	{
		get
		{
			return m_BorderColor;
		}
		set
		{
			m_BorderColor = value;
			m_RefreshGraph();
		}
	}

	public bool ShowValues
	{
		get
		{
			return m_blnShowValues;
		}
		set
		{
			m_blnShowValues = value;
			m_RefreshGraph();
		}
	}

	public bool ShowDividersX
	{
		get
		{
			return m_blnShowDividersX;
		}
		set
		{
			m_blnShowDividersX = value;
			m_RefreshGraph();
		}
	}

	public bool ShowDividersZ
	{
		get
		{
			return m_blnShowDividersZ;
		}
		set
		{
			m_blnShowDividersZ = value;
			m_RefreshGraph();
		}
	}

	public STYLE2D3D Style
	{
		get
		{
			return m_lngStyle;
		}
		set
		{
			m_lngStyle = value;
			m_caption = null;
			m_XYZ_YAngle = 0.6283185f;
			m_XYZ_XAngle = 0.3141593f;
			m_XYZ_ZAngle = 0f;
			SelectionClear();
			m_DoCalc();
			m_RefreshContextualMenu();
			m_RefreshGraph();
		}
	}

	public string Title
	{
		get
		{
			return m_strTitle;
		}
		set
		{
			m_strTitle = value;
			m_RefreshGraph();
		}
	}

	public Font TitleFont
	{
		get
		{
			return m_TitleFont;
		}
		set
		{
			m_TitleFont = value;
			m_RefreshGraph();
		}
	}

	public Font ValuesFont
	{
		get
		{
			return m_ValuesFont;
		}
		set
		{
			m_ValuesFont = value;
			m_RefreshGraph();
		}
	}

	public Color TitleColor
	{
		get
		{
			return m_TitleColor;
		}
		set
		{
			m_TitleColor = value;
			m_RefreshGraph();
		}
	}

	public SmoothingMode Quality
	{
		get
		{
			return m_Quality;
		}
		set
		{
			m_Quality = value;
			m_RefreshGraph();
		}
	}

	public STYLEWALLS WallStyle
	{
		get
		{
			return m_WallsStyle;
		}
		set
		{
			m_WallsStyle = value;
			m_RefreshGraph();
		}
	}

	public int Depth
	{
		get
		{
			return m_intDepth;
		}
		set
		{
			m_intDepth = value;
			m_RefreshGraph();
		}
	}

	public float SlantX
	{
		get
		{
			return m_sngSlantX;
		}
		set
		{
			m_sngSlantX = Math.Max(5f, value);
			m_RefreshGraph();
		}
	}

	public float SlantY
	{
		get
		{
			return m_sngSlantY;
		}
		set
		{
			m_sngSlantY = Math.Max(5f, value);
			m_RefreshGraph();
		}
	}

	public override Color BackColor
	{
		get
		{
			return m_BackColor;
		}
		set
		{
			m_BackColor = value;
			m_RefreshGraph();
		}
	}

	public STYLEBACKGROUND BackStyle
	{
		get
		{
			return m_BackStyle;
		}
		set
		{
			m_BackStyle = value;
			m_RefreshGraph();
		}
	}

	public Image GridBackgroundImage
	{
		get
		{
			return m_GridBackgroundImage;
		}
		set
		{
			m_GridBackgroundImage = value;
			m_RefreshGraph();
		}
	}

	public int GridBackgroundImageTransparency
	{
		get
		{
			return m_GridBackgroundImageTransparency;
		}
		set
		{
			m_GridBackgroundImageTransparency = value;
			m_RefreshGraph();
		}
	}

	public Bitmap Image
	{
		get
		{
			return m_surface;
		}
		set
		{
			m_surface = value;
			Invalidate();
		}
	}

	public bool IsPie => (m_lngStyle == STYLE2D3D.STYLE2D_DOUGHNUT) | (m_lngStyle == STYLE2D3D.STYLE2D_PIE) | (m_lngStyle == STYLE2D3D.STYLE3D_DOUGHNUT) | (m_lngStyle == STYLE2D3D.STYLE3D_PIE);

	public string SettingsFromString
	{
		set
		{
			SettingsFactory settingsFactory = new SettingsFactory(this);
			settingsFactory.Apply(value);
		}
	}

	public DataGridView DataSource
	{
		get
		{
			return m_DataSource;
		}
		set
		{
			if (m_DataSource != null)
			{
				m_DataSource.CellValueChanged -= m_DataSource_CellValueChanged;
				m_DataSource.SelectionChanged -= m_DataSource_SelectionChanged;
			}
			m_DataSource = value;
			if (value != null)
			{
				DataSourceReload();
				value.CellValueChanged += m_DataSource_CellValueChanged;
				value.SelectionChanged += m_DataSource_SelectionChanged;
			}
		}
	}

	public DATASOURCE_SCHEME DataSourceMode
	{
		get
		{
			return m_DataSourceMode;
		}
		set
		{
			m_DataSourceMode = value;
			DataSourceReload();
		}
	}

	public event BeginPaintEventHandler BeginPaint;

	public event AfterPaintEventHandler AfterPaint;

	public event ValueClickEventHandler ValueClick;

	public Super2d3dGraph()
	{
		base.MouseClick += Super2d3dGraph_MouseClick;
		base.MouseDown += Super2d3dGraph_MouseDown;
		base.MouseMove += Super2D3dGraph_MouseMove;
		base.MouseWheel += Super2d3dGraph_MouseWheel;
		base.Resize += Super2DGraph_Resize;
		names_English = new string[45]
		{
			"2D Bars", "2D Stacked Bars (proportional)", "2D Stacked Bars (fixed)", "2D Lines", "2D Points", "2D Pie", "2D Stacked Area", "2D CandleStick", "2D High-Low-Close", "2D High-Low",
			"2D Splines", "2D X/Y", "2D X/Y Spline", "2D Bubbles", "2D Pyramids", "2D Pictures", "2D Doughnut", "2D Cylinders", "2D Rounded Bars", "2D Horizontal Bars",
			"2D Gauge", "3D Stacked Bars", "3D Lines", "3D Stacked Area", "3D Columns", "3D Pie", "3D Doughnut", "3D Cylinders", "3D Splines", "3D Spline Area",
			"3D Spline Stacked Area", "3D Stacked Bar", "3D Stacked Columns", "2D Lines (datetime x-axis)", "2D X/Y (datetime x-axis)", "2D X/Y Spline with error deviation", "2D Radar", "2D X/Y Lines", "2D Stacked Spline Area", "2D Tornado",
			"3D X/Y/Z Scatter", "3D X/Y/Z Lines", "3D X/Y/Z Mesh", "3D X/Y/Z Surface (quads)", "3D X/Y/Z Surface (tris)"
		};
		names_Spanish = new string[45]
		{
			"2D Barras", "2D Barras apiladas (proporcional)", "2D Barras apiladas (fijo)", "2D Líneas", "2D Puntos", "2D Tarta", "2D Área acumulada", "2D CandleStick", "2D Máximo-Mínimo-Cierre", "2D Máximo-Mínimo",
			"2D Curvas", "2D X/Y", "2D X/Y Spline", "2D Burbujas", "2D Pirámides", "2D Imágenes", "2D Doughnut", "2D Cilindros", "2D Barras redondeadas", "2D Barras horizontales",
			"2D Brújula", "3D Barras acumuladas", "3D Líneas", "3D Área acumulada", "3D Columnas", "3D Tarta", "3D Doughnut", "3D Cilindros", "3D Curvas", "3D Áreas curvas",
			"3D Áreas curvas acumuladas", "3D Barras apiladas", "3D Columnas apiladas", "2D Líneas (fecha en eje x)", "2D X/Y (fecha en eje x)", "2D X/Y Spline (con desviación de error)", "2D Radar", "2D X/Y Líneas", "2D Curvas apiladas", "2D Tornado",
			"3D X/Y/Z Puntos", "3D X/Y/Z Líneas", "3D X/Y/Z Malla", "3D X/Y/Z Superficie (quads)", "3D X/Y/Z Superficie (tris)"
		};
		names = names_English;
		values = new STYLE2D3D[45]
		{
			STYLE2D3D.STYLE2D_BAR,
			STYLE2D3D.STYLE2D_ACUM,
			STYLE2D3D.STYLE2D_ACUM_FIXED,
			STYLE2D3D.STYLE2D_LINE,
			STYLE2D3D.STYLE2D_POINT,
			STYLE2D3D.STYLE2D_PIE,
			STYLE2D3D.STYLE2D_STACKED_AREA,
			STYLE2D3D.STYLE2D_CANDLESTICK,
			STYLE2D3D.STYLE2D_HIGHLOWCLOSE,
			STYLE2D3D.STYLE2D_HIGHLOW,
			STYLE2D3D.STYLE2D_SPLINE,
			STYLE2D3D.STYLE2D_XY,
			STYLE2D3D.STYLE2D_XY_SPLINE,
			STYLE2D3D.STYLE2D_BUBBLE,
			STYLE2D3D.STYLE2D_PYRAMID,
			STYLE2D3D.STYLE2D_PICTURES,
			STYLE2D3D.STYLE2D_DOUGHNUT,
			STYLE2D3D.STYLE2D_CYLINDER,
			STYLE2D3D.STYLE2D_ROUNDED_BAR,
			STYLE2D3D.STYLE2D_HORIZONTAL_BAR,
			STYLE2D3D.STYLE2D_GAUGE,
			STYLE2D3D.STYLE3D_ACUM_BAR,
			STYLE2D3D.STYLE3D_LINE,
			STYLE2D3D.STYLE3D_STACKED_AREA,
			STYLE2D3D.STYLE3D_COLUMN,
			STYLE2D3D.STYLE3D_PIE,
			STYLE2D3D.STYLE3D_DOUGHNUT,
			STYLE2D3D.STYLE3D_CYLINDER,
			STYLE2D3D.STYLE3D_SPLINE,
			STYLE2D3D.STYLE3D_SPLINE_AREA,
			STYLE2D3D.STYLE3D_SPLINE_STACKED_AREA,
			STYLE2D3D.STYLE3D_STACKED_BAR,
			STYLE2D3D.STYLE3D_STACKED_COLUMN,
			STYLE2D3D.STYLE2D_XY_LINE_DATETIME,
			STYLE2D3D.STYLE2D_XY_DATETIME,
			STYLE2D3D.STYLE2D_XY_SPLINE_DEV,
			STYLE2D3D.STYLE2D_RADAR,
			STYLE2D3D.STYLE2D_XY_LINE,
			STYLE2D3D.STYLE2D_SPLINE_AREA,
			STYLE2D3D.STYLE2D_TORNADO,
			STYLE2D3D.STYLE3D_XYZ_SCATTER,
			STYLE2D3D.STYLE3D_XYZ_LINE,
			STYLE2D3D.STYLE3D_XYZ_MESH,
			STYLE2D3D.STYLE3D_XYZ_SURFACE,
			STYLE2D3D.STYLE3D_XYZ_SURFACE_TRIANGLE
		};
		chartDimensions = new int[45]
		{
			1, 1, 1, 1, 1, 1, 1, 4, 3, 2,
			1, 2, 2, 3, 1, 1, 1, 1, 1, 1,
			1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
			1, 1, 1, 1, 2, 3, 1, 2, 1, 1,
			3, 3, 3, 3, 3
		};
		additionalCalculations_English = new string[6] { "None", "Average", "Average (spline)", "Maximum", "Maximum (spline)", "Pareto" };
		additionalCalculations_Spanish = new string[6] { "Ninguno", "Media", "Media (spline)", "Maximo", "Maximo (spline)", "Pareto" };
		additionalCalculations = additionalCalculations_English;
		additionalCalculations_Values = new CALCULATION[6]
		{
			CALCULATION.CALCULATION_NONE,
			CALCULATION.CALCULATION_AVERAGE,
			CALCULATION.CALCULATION_AVERAGE_SPLINE,
			CALCULATION.CALCULATION_TOP_LINE,
			CALCULATION.CALCULATION_TOP_SPLINE,
			CALCULATION.CALCULATION_PARETO
		};
		backgroundStyles_English = new string[5] { "Solid color", "Gradient fill", "Gradient fill (inverted)", "Tubular fill", "Tubular fill (inverted)" };
		backgroundStyles_Spanish = new string[5] { "Color sólido", "Gradiente", "Gradiente invertido", "Gradiente tubular", "Gradiente tubular invertido" };
		backgroundStyles = backgroundStyles_English;
		backgroundStyles_Values = new STYLEBACKGROUND[5]
		{
			STYLEBACKGROUND.STYLEBACKGROUND_SOLID,
			STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT,
			STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_INVERTED,
			STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_TUBULAR,
			STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_TUBULAR_INVERTED
		};
		m_lngStyle = STYLE2D3D.STYLE2D_BAR;
		m_strTitle = "Title";
		m_strLegendCaption = "Legend";
		m_LegendFont = new Font("Verdana", 12f, FontStyle.Regular, GraphicsUnit.Point);
		m_LegendColor = Color.Black;
		m_TitleFont = new Font("Verdana", 14f, FontStyle.Bold, GraphicsUnit.Point);
		m_ValuesFont = new Font("Verdana", 11f, FontStyle.Regular, GraphicsUnit.Point);
		m_ValuesColor = Color.Black;
		m_ValuesBackColor = Color.FromArgb(255, 192, 255, 255);
		m_TitleColor = Color.Black;
		m_lngNumDividersY = 10L;
		m_blnShowDividersX = false;
		m_blnShowValues = true;
		m_BorderColor = Color.Red;
		m_BackColor = Color.White;
		m_BackStyle = STYLEBACKGROUND.STYLEBACKGROUND_SOLID;
		m_blnShadow = true;
		m_blnLegend = true;
		m_blnDataTable = true;
		m_DataTableFont = new Font("Verdana", 11f, FontStyle.Regular, GraphicsUnit.Point);
		m_strDataTableCaption = "Data Table";
		m_DataTableColor = Color.Black;
		m_lngResolution = 72;
		m_blnSolidColor = false;
		m_strValuesFormat = "N";
		m_ValuesStyle = STYLECAPTION.STYLECAPTION_ROUNDED_SQUARE;
		m_sngSlantX = 30f;
		m_sngSlantY = 30f;
		m_Quality = SmoothingMode.HighQuality;
		m_blnSurface = true;
		m_WallsStyle = STYLEWALLS.STYLEWALLS_NOWALLS;
		m_blnItemsLegend = false;
		m_blnAutoRefresh = false;
		m_blnXAxis = true;
		m_CalculationStyle = CALCULATION.CALCULATION_NONE;
		m_CalculationLineStyle = new Pen(Color.Blue, 3f);
		m_ValuesLocationStyle = STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_DEFAULT;
		m_WallsBackStyle = STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_BANDS;
		m_WallsBackColorPrincipal = Color.FromArgb(228, 249, 255);
		m_WallsBackColorSecondary = Color.FromArgb(201, 243, 255);
		m_DataTableBackColor = Color.White;
		m_PointStyle = STYLEPOINT.STYLEPOINT_CIRCLE;
		m_PointSize = 4;
		m_BubbleMaxRadius = 100;
		m_LicenseActivated = false;
		m_blnXAxisLabelsRotated = false;
		m_blnYAxisLabelsRotated = false;
		m_blnMarkHighest = false;
		m_blnMarkLowest = false;
		m_YAxisNumericFormat = "N";
		m_YAxisScaleMode = SCALEMODE.SCALEMODE_AUTOMATIC;
		m_XAxisNumericFormat = "N";
		m_XAxisScaleMode = SCALEMODE.SCALEMODE_AUTOMATIC;
		m_ValuesAlignment = StringAlignment.Far;
		m_YAxisTitle = "";
		m_YAxisTitleFont = new Font("Verdana", 11f, FontStyle.Bold, GraphicsUnit.Point);
		m_XAxisTitle = "";
		m_XAxisTitleFont = new Font("Verdana", 11f, FontStyle.Bold, GraphicsUnit.Point);
		m_LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_MIDDLE_RIGHT;
		m_intDepth = 30;
		m_blnShowPoints = true;
		m_intHoleSize = 40;
		m_sngThickness = 0.85f;
		m_blnAllowBuiltinDialog = true;
		m_BultInDialogLanguage = LANGUAGE.LANG_ENGLISH;
		m_strLicenseeInfo = "";
		m_YAxisValuesFont = new Font("Verdana", 11f, FontStyle.Regular, GraphicsUnit.Point);
		m_XAxisValuesFont = new Font("Verdana", 11f, FontStyle.Regular, GraphicsUnit.Point);
		m_intMarginRight = 20;
		m_intMarginLeft = 20;
		m_intMarginTop = 20;
		m_intMarginBottom = 20;
		m_intXAxisHeight = 1000;
		m_YAxisLocation = STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT;
		m_Charts = new Collection();
		m_YAxisLeftWidth = 0;
		m_YAxisRightWidth = 0;
		m_YAxisCurrentWidth = 0;
		m_blnCompositeMode = false;
		m_blnCompositing = false;
		m_YAxisColor = Color.Black;
		m_XAxisColor = Color.Black;
		m_LegendBackColor = Color.White;
		m_lngNumDividersX = 0L;
		m_intShadowOffset = 5;
		m_blnColoredShadows = false;
		m_blnShadowSmooth = true;
		m_blnShowDividersY = true;
		m_blnXAxisLabelsRotated90 = false;
		m_blnHotSpots = true;
		m_HotSpotBackColor = Color.FromArgb(220, 255, 255, 64);
		m_HotSpotColor = Color.FromArgb(255, 0, 0, 128);
		m_blnShowLegendInDatatable = true;
		m_GaugeMarginFactor = 0.1f;
		m_YAxisTickLength = 5;
		m_HotSpotCross = false;
		m_HotSpotCrossLineStyle = new Pen(Color.FromArgb(255, 220, 32, 32));
		m_HotSpotDateTimeFormat = "d";
		m_HotSpotNumericFormat = "N";
		m_SurfaceBrushStyle = new SolidBrush(Color.FromArgb(128, 128, 128, 128));
		m_GanttTodayLabel = "Today";
		m_DataTableHeight = 0L;
		m_blnPermisoEscrituraDisco = true;
		m_GridLineStyle = new Pen(Color.DarkGray);
		m_dblShowValuesMin = double.MinValue;
		m_dblShowValuesMax = double.MaxValue;
		m_PieBorderStyle = new Pen(Color.Transparent);
		m_DataTableStartIndex = 0;
		m_DataTableLastIndex = 0;
		m_blnShowDividersZ = true;
		m_ZAxisScaleMode = SCALEMODE.SCALEMODE_AUTOMATIC;
		m_blnYAxis = true;
		m_blnZAxis = true;
		m_XYZ_applyScale = false;
		m_XYZ_YAngle = 0.6283185f;
		m_XYZ_XAngle = 0.3141593f;
		m_XYZ_ZAngle = 0f;
		m_XYZ_YAngle_LastValue = -9f;
		m_XYZ_XAngle_LastValue = -9f;
		m_XYZ_ZAngle_LastValue = -9f;
		m_XAxisTickLength = 5;
		m_ZAxisTickLength = 5;
		m_lngNumDividersZ = 0L;
		m_ZAxisNumericFormat = "N";
		m_ZAxisValuesFont = new Font("Verdana", 11f, FontStyle.Regular, GraphicsUnit.Point);
		m_ZAxisColor = Color.Black;
		m_ZAxisTitle = "";
		m_ZAxisTitleFont = new Font("Verdana", 11f, FontStyle.Bold, GraphicsUnit.Point);
		m_BackgroundImage = null;
		m_SeriesPointSize = null;
		m_SeriesPointStyle = null;
		m_SurfaceBrushMinBrightness = 0;
		m_SurfaceBrushMaxBrightness = 100;
		m_sngSeriesGap = 0.25f;
		m_blnSeriesFillStyleSet = false;
		m_GaugeRangeColors = null;
		m_GaugeTitles = null;
		m_GaugeTitlesFont = new Font("Verdana", 10f);
		m_HotSpotHitTestPrecision = 10;
		m_GaugesScaleMode = null;
		m_GaugesScaleMinimum = null;
		m_GaugesScaleMaximum = null;
		m_GaugesNumericFormat = null;
		m_GaugesDividersCount = null;
		m_GaugesMin = null;
		m_GaugesMax = null;
		m_GaugesRange = null;
		m_FrontLayerShow = false;
		m_FrontLayerColor = Color.White;
		m_DataTableAdditionalRowValues = null;
		m_blnAnimating = false;
		m_HotSpotOutlineEnabled = true;
		m_HotSpotOutlineStyle = null;
		m_ItemsSelected = null;
		m_blnDataSourceUpdating = false;
		m_blnValueCaptionClickedWasSelected = false;
		m_blnZAxisLabelsRotated = false;
		m_SurfaceGradientType = SURFACE_GRADIENT_TYPE.ONE_COLOR;
		m_ZoomEnabled = false;
		m_ZoomFactor = 1f;
		m_ZoomTargetFactor = 1f;
		m_ZoomInterval = 0.1f;
		m_ZoomOldChanges = false;
		m_ZoomMode = ZOOM_MODE.BOTH_AXIS;
		m_XAxisReverse = false;
		_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR_0024Init = new StaticLocalInitFlag();
		_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR_0024Init = new StaticLocalInitFlag();
		_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC_0024Init = new StaticLocalInitFlag();
		_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC_0024Init = new StaticLocalInitFlag();
		_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue_0024Init = new StaticLocalInitFlag();
		VBMath.Randomize();
		_g = new CustomGraphics();
		timerZoom = new System.Windows.Forms.Timer();
		m_HotSpotCrossLineStyle.DashStyle = DashStyle.Dash;
		m_GridLineStyle.DashStyle = DashStyle.Dot;
		m_HotSpotOutlineStyle = new Pen(Color.Yellow);
		SelectionClear();
		InitializeComponent();
		m_Charts.Add(this);
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing)
		{
			if (m_DataSource != null)
			{
				m_DataSource.CellValueChanged -= m_DataSource_CellValueChanged;
				m_DataSource.SelectionChanged -= m_DataSource_SelectionChanged;
			}
			if (components != null)
			{
				components.Dispose();
			}
		}
		base.Dispose(disposing);
	}

	[System.Diagnostics.DebuggerStepThrough]
	private void InitializeComponent()
	{
		this.BackColor = System.Drawing.Color.White;
		this.Name = "Super2DGraph";
		System.Drawing.Size size = new System.Drawing.Size(512, 368);
		this.Size = size;
	}

	private void ContextMenu_Click(object sender, EventArgs e)
	{
		int num = Array.IndexOf(names, ((MenuItem)sender).Text);
		if (num >= 0)
		{
			int num2 = ContextMenu_SelectChart();
			NewLateBinding.LateSetComplex(m_Charts[num2], null, "Style", new object[1] { values[num] }, null, null, OptimisticSet: false, RValueBase: true);
			if (!m_blnAutoRefresh || num2 > 1)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_BackgroundStyle_Click(object sender, EventArgs e)
	{
		int num = Array.IndexOf(backgroundStyles, ((MenuItem)sender).Text);
		if (num >= 0)
		{
			BackStyle = backgroundStyles_Values[num];
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_additionalCalculations_Click(object sender, EventArgs e)
	{
		int num = Array.IndexOf(additionalCalculations, ((MenuItem)sender).Text);
		Calculation = additionalCalculations_Values[num];
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_BackGroundColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = BackColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			BackColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_HotSpotBackColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = m_HotSpotBackColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			HotSpotBackColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_HotSpotColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = m_HotSpotColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			HotSpotColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_HotSpot_Click(object sender, EventArgs e)
	{
		HotSpotsEnabled = !HotSpotsEnabled;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_HotSpotCross_Click(object sender, EventArgs e)
	{
		HotSpotShowCross = !HotSpotShowCross;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_RandomSeriesColors_Click(object sender, EventArgs e)
	{
		checked
		{
			Color[] array = new Color[m_arrSeries.Length - 1 + 1];
			int num = array.Length - 1;
			for (int i = 0; i <= num; i++)
			{
				ref Color reference = ref array[i];
				reference = Color.FromArgb((int)Math.Round(VBMath.Rnd() * 128f + 127f), (int)Math.Round(VBMath.Rnd() * 128f + 127f), (int)Math.Round(VBMath.Rnd() * 128f + 127f));
			}
			SeriesColor = array;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_DatatableBackgroundColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = DataTableBackColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			DataTableBackColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_PrimaryColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = WallsBackColorPrincipal;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			WallsBackColorPrincipal = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_SecondaryColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = WallsBackColorSecondary;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			WallsBackColorSecondary = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ValuesBackgroundColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = ValuesBackColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			ValuesBackColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ValuesColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = ValuesColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			ValuesColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_LegendColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = m_LegendColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			LegendColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_LegendBackColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = m_LegendBackColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			LegendBackColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_YAxisColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = m_YAxisColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			YAxisColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ZAxisColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = m_YAxisColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			ZAxisColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_SurfaceColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = m_YAxisColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			SurfaceBrushStyle = new SolidBrush(colorDialog.Color);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_XAxisColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = m_XAxisColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			XAxisColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_BorderColor_Click(object sender, EventArgs e)
	{
		ColorDialog colorDialog = new ColorDialog();
		colorDialog.FullOpen = true;
		colorDialog.Color = BorderColor;
		if (colorDialog.ShowDialog() == DialogResult.OK)
		{
			BorderColor = colorDialog.Color;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_Quality_Click(object sender, EventArgs e)
	{
		switch (((MenuItem)sender).Text)
		{
		case "Best (slowest)":
		case "Mejor (más lento)":
			Quality = SmoothingMode.HighQuality;
			break;
		case "High":
		case "Alta":
			Quality = SmoothingMode.AntiAlias;
			break;
		case "Standard":
		case "Normal":
			Quality = SmoothingMode.Default;
			break;
		case "Low (fastest)":
		case "Baja (más rápido)":
			Quality = SmoothingMode.None;
			break;
		}
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_Title_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el título:", "Cambiar el título de la gráfica", Title) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter title:", "Change chart's title", Title));
		if (Operators.CompareString(text, "", TextCompare: false) != 0)
		{
			Title = Strings.Trim(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_DataTable_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el título de la tabla de datos:", "Cambiar el título de la tabla de datos", DataTableText) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter datatable's title:", "Change datatable's title", DataTableText));
		if (Operators.CompareString(text, "", TextCompare: false) != 0)
		{
			DataTableText = text;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_Legend_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el título de la leyenda:", "Cambiar el título de la leyenda", LegendText) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter legend's title:", "Change legend's title", LegendText));
		if (Operators.CompareString(text, "", TextCompare: false) != 0)
		{
			LegendText = text;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_XAxisTitle_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el título del eje X:", "Cambiar el título del eje X", XAxisTitle) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter X-Axis' title:", "Change X-Axis' title", XAxisTitle));
		if (Operators.CompareString(text, "", TextCompare: false) != 0)
		{
			XAxisTitle = Strings.Trim(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_YAxisTitle_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el título del eje Y:", "Cambiar el título del eje Y", YAxisTitle) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter Y-Axis' title:", "Change Y-Axis' title", YAxisTitle));
		if (Operators.CompareString(text, "", TextCompare: false) != 0)
		{
			YAxisTitle = Strings.Trim(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ZAxisTitle_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el título del eje Z:", "Cambiar el título del eje Z", ZAxisTitle) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter Z-Axis' title:", "Change Z-Axis' title", YAxisTitle));
		if (Operators.CompareString(text, "", TextCompare: false) != 0)
		{
			ZAxisTitle = Strings.Trim(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_SaveVeryHighQuality_Click(object sender, EventArgs e)
	{
		SaveFileDialog saveFileDialog = new SaveFileDialog();
		int resolution = Resolution;
		saveFileDialog.AddExtension = true;
		saveFileDialog.DefaultExt = "PNG";
		if (m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH)
		{
			saveFileDialog.Filter = "PNG format|*.png";
			saveFileDialog.Title = "Save chart to file";
		}
		else
		{
			saveFileDialog.Filter = "Formato PNG|*.png";
			saveFileDialog.Title = "Salvar imagen de gráfica a disco";
		}
		if (saveFileDialog.ShowDialog() == DialogResult.OK)
		{
			Resolution = 300;
			Image.Save(saveFileDialog.FileName, ImageFormat.Png);
			Resolution = resolution;
		}
	}

	private void ContextMenu_SaveHighQuality_Click(object sender, EventArgs e)
	{
		SaveFileDialog saveFileDialog = new SaveFileDialog();
		int resolution = Resolution;
		saveFileDialog.AddExtension = true;
		saveFileDialog.DefaultExt = "PNG";
		if (m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH)
		{
			saveFileDialog.Filter = "PNG format|*.png";
			saveFileDialog.Title = "Save chart to file";
		}
		else
		{
			saveFileDialog.Filter = "Formato PNG|*.png";
			saveFileDialog.Title = "Salvar imagen de gráfica a disco";
		}
		if (saveFileDialog.ShowDialog() == DialogResult.OK)
		{
			Resolution = 200;
			Image.Save(saveFileDialog.FileName, ImageFormat.Png);
			Resolution = resolution;
		}
	}

	private void ContextMenu_SaveSVG_Click(object sender, EventArgs e)
	{
		SaveFileDialog saveFileDialog = new SaveFileDialog();
		int resolution = Resolution;
		saveFileDialog.DefaultExt = "SVG";
		saveFileDialog.AddExtension = true;
		if (m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH)
		{
			saveFileDialog.Filter = "SVG format|*.svg";
			saveFileDialog.Title = "Save chart to file";
		}
		else
		{
			saveFileDialog.Filter = "Formato SVG|*.svg";
			saveFileDialog.Title = "Salvar imagen de gráfica a disco";
		}
		if (saveFileDialog.ShowDialog() == DialogResult.OK)
		{
			Resolution = 72;
			File.WriteAllText(saveFileDialog.FileName, CreateSVG(scaleToFit: true));
			Resolution = resolution;
		}
	}

	private void ContextMenu_SaveAnimatedGIF_Click(object sender, EventArgs e)
	{
		SaveFileDialog saveFileDialog = new SaveFileDialog();
		int resolution = Resolution;
		saveFileDialog.DefaultExt = "GIF";
		saveFileDialog.AddExtension = true;
		if (m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH)
		{
			saveFileDialog.Filter = "GIF format|*.gif";
			saveFileDialog.Title = "Save chart to file";
		}
		else
		{
			saveFileDialog.Filter = "Formato GIF|*.gif";
			saveFileDialog.Title = "Salvar imagen de gráfica a disco";
		}
		if (saveFileDialog.ShowDialog() == DialogResult.OK)
		{
			Resolution = 72;
			CreateAnimatedGIF(20, 10, blnLoop: false, STYLEANIMATION.STYLEANIMATION_WAVE).Save(saveFileDialog.FileName);
			Resolution = resolution;
		}
	}

	private void ContextMenu_SaveStandardQuality_Click(object sender, EventArgs e)
	{
		SaveFileDialog saveFileDialog = new SaveFileDialog();
		int resolution = Resolution;
		saveFileDialog.DefaultExt = "PNG";
		saveFileDialog.AddExtension = true;
		if (m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH)
		{
			saveFileDialog.Filter = "PNG format|*.png";
			saveFileDialog.Title = "Save chart to file";
		}
		else
		{
			saveFileDialog.Filter = "Formato PNG|*.png";
			saveFileDialog.Title = "Salvar imagen de gráfica a disco";
		}
		if (saveFileDialog.ShowDialog() == DialogResult.OK)
		{
			Resolution = 72;
			Image.Save(saveFileDialog.FileName, ImageFormat.Png);
			Resolution = resolution;
		}
	}

	private void ContextMenu_ValuesStyle_Click(object sender, EventArgs e)
	{
		switch (((MenuItem)sender).Text)
		{
		case "Standard":
		case "Normal":
			ValuesStyle = STYLECAPTION.STYLECAPTION_STANDARD;
			break;
		case "Rounded square":
		case "Enmarcado":
			ValuesStyle = STYLECAPTION.STYLECAPTION_ROUNDED_SQUARE;
			break;
		case "Shadowed":
		case "Sombreado":
			ValuesStyle = STYLECAPTION.STYLECAPTION_SHADOWED;
			break;
		}
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ValuesLocation_Click(object sender, EventArgs e)
	{
		switch (((MenuItem)sender).Text)
		{
		case "Default":
		case "Normal":
			ValuesLocationStyle = STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_DEFAULT;
			break;
		case "Inside":
		case "Interior":
			ValuesLocationStyle = STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE;
			break;
		case "Smart":
		case "Inteligente":
			ValuesLocationStyle = STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_SMART_PLACEMENT;
			break;
		}
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_Values_Click(object sender, EventArgs e)
	{
		ShowValues = !ShowValues;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_RemarkMaximum_Click(object sender, EventArgs e)
	{
		MarkHighest = !MarkHighest;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_RemarkMinimum_Click(object sender, EventArgs e)
	{
		MarkLowest = !MarkLowest;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ShowLegend_Click(object sender, EventArgs e)
	{
		ShowLegend = !ShowLegend;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ShowDataTable_Click(object sender, EventArgs e)
	{
		ShowDataTable = !ShowDataTable;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ShowXAxisDividers_Click(object sender, EventArgs e)
	{
		ShowDividersX = !ShowDividersX;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ToggleShowYAxisDividers_Click(object sender, EventArgs e)
	{
		YAxisShowDividers = !YAxisShowDividers;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ToggleShowZAxisDividers_Click(object sender, EventArgs e)
	{
		ZAxisShowDividers = !ZAxisShowDividers;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ShowYAxisDividers_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el número de divisores en el eje Y (0=ocultar eje, 10=recomendado)", "Cambiar número de divisores en el eje Y", Conversions.ToString(YAxisDividersCount)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter number of Y-Axis dividers (0=hide, 10=recommended)", "Change Y-Axis dividers count", Conversions.ToString(YAxisDividersCount)));
		if (Versioned.IsNumeric(text))
		{
			YAxisDividersCount = Conversions.ToLong(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ShowZAxisDividers_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el número de divisores en el eje Z (0=ocultar eje, 10=recomendado)", "Cambiar número de divisores en el eje Z", Conversions.ToString(ZAxisDividersCount)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter number of Z-Axis dividers (0=hide, 10=recommended)", "Change Z-Axis dividers count", Conversions.ToString(ZAxisDividersCount)));
		if (Versioned.IsNumeric(text))
		{
			ZAxisDividersCount = Conversions.ToLong(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_XAxisDividersCount_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el número de divisores en el eje X (0=uno para cada elemento)", "Cambiar número de divisores en el eje X", Conversions.ToString(XAxisDividersCount)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter number of X-Axis dividers (0=one for each item)", "Change X-Axis dividers count", Conversions.ToString(XAxisDividersCount)));
		if (Versioned.IsNumeric(text))
		{
			XAxisDividersCount = Conversions.ToLong(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ShowXAxisItems_Click(object sender, EventArgs e)
	{
		ShowItemsLegend = !ShowItemsLegend;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ShowLegendInDatatable_Click(object sender, EventArgs e)
	{
		ShowLegendInDataTable = !ShowLegendInDataTable;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ShowXAxis_Click(object sender, EventArgs e)
	{
		ShowXAxis = !ShowXAxis;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_XAxisReverse_Click(object sender, EventArgs e)
	{
		XAxisReverseOrder = !XAxisReverseOrder;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_LegendAlignment_Click(object sender, EventArgs e)
	{
		switch (((MenuItem)sender).Text)
		{
		case "Align top/left":
		case "Alinear arriba/izquierda":
			LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_TOP_LEFT;
			break;
		case "Align top/center":
		case "Alinear arriba/centro":
			LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_TOP_CENTER;
			break;
		case "Align top/right":
		case "Alinear arriba/derecha":
			LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_TOP_RIGHT;
			break;
		case "Align middle/left":
		case "Alinear mitad/izquierda":
			LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_MIDDLE_LEFT;
			break;
		case "Align middle/right":
		case "Alinear mitad/derecha":
			LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_MIDDLE_RIGHT;
			break;
		case "Align bottom/left":
		case "Alinear abajo/izquierda":
			LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_LEFT;
			break;
		case "Align bottom/center":
		case "Alinear abajo/centro":
			LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_CENTER;
			break;
		case "Align bottom/right":
		case "Alinear abajo/derecha":
			LegendAlignment = STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_RIGHT;
			break;
		}
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_DataTableAlignment_Click(object sender, EventArgs e)
	{
		switch (((MenuItem)sender).Text)
		{
		case "Align values to the left":
		case "Alinear valores a la izquierda":
			ValuesAlignment = StringAlignment.Near;
			break;
		case "Align values to the center":
		case "Alinear valores al centro":
			ValuesAlignment = StringAlignment.Center;
			break;
		case "Align values to the right":
		case "Alinear valores a la derecha":
			ValuesAlignment = StringAlignment.Far;
			break;
		}
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_YAxisRotate_Click(object sender, EventArgs e)
	{
		YAxisLabelsRotated = !YAxisLabelsRotated;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_XAxisRotate_Click(object sender, EventArgs e)
	{
		XAxisLabelsRotated = !XAxisLabelsRotated;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_XAxisRotate90_Click(object sender, EventArgs e)
	{
		XAxisLabelsRotated90 = !XAxisLabelsRotated90;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_XAxisScaleAutomatic_Click(object sender, EventArgs e)
	{
		XAxisScaleMode = SCALEMODE.SCALEMODE_AUTOMATIC;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private int ContextMenu_SelectChart()
	{
		int count = m_Charts.Count;
		int num = default(int);
		if (count > 1)
		{
			num = checked((int)Math.Round(Conversion.Val(Interaction.InputBox(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Select one chart (1-" + Conversions.ToString(count) + ")", "Selecciona la gráfica a personalizar (1-" + Conversions.ToString(count) + ")")), Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Combo chart", "Gráfica combinada")), "1"))));
		}
		if (num < 1 || num > count)
		{
			num = 1;
		}
		return num;
	}

	private void ContextMenu_XAxisScaleAutomaticMinimumZero_Click(object sender, EventArgs e)
	{
		XAxisScaleMode = SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_YAxisScaleAutomaticMinimumZero_Click(object sender, EventArgs e)
	{
		YAxisScaleMode = SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ZAxisScaleAutomaticMinimumZero_Click(object sender, EventArgs e)
	{
		ZAxisScaleMode = SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ExplodePie_Click(object sender, EventArgs e)
	{
		foreach (ValueCaption item in m_ItemsSelected)
		{
			if (m_arrItemsHighlight.Length > item.itemIndex)
			{
				if (Operators.CompareString(m_arrItemsHighlight[item.itemIndex], "", TextCompare: false) == 0)
				{
					m_arrItemsHighlight[item.itemIndex] = "exploded";
				}
				else
				{
					m_arrItemsHighlight[item.itemIndex] = "";
				}
			}
		}
		m_caption = null;
		m_RefreshGraph(blnForce: true);
	}

	private void ContextMenu_SelectionValueMultiply_Click(object sender, EventArgs e)
	{
		float num = (float)Conversion.Val(Interaction.InputBox(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Multiply selection values by:", "Multiplicar la selección por:")), Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Math operations", "Operaciones matemáticas")), "2"));
		if (num != 0f)
		{
			m_ItemsSelected_MultiplyBy(1f, num);
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_SelectionValueDivide_Click(object sender, EventArgs e)
	{
		float num = (float)Conversion.Val(Interaction.InputBox(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Divide selection values by:", "Dividir la selección por:")), Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Math operations", "Operaciones matemáticas")), "2"));
		if (num != 0f)
		{
			m_ItemsSelected_MultiplyBy(1f, (float)(1.0 / (double)num));
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_SelectionValueAdd_Click(object sender, EventArgs e)
	{
		float num = (float)Conversion.Val(Interaction.InputBox(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Add to selection values:", "Sumar a la selección:")), Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Math operations", "Operaciones matemáticas")), "2"));
		if (num != 0f)
		{
			m_ItemsSelected_Add(0f, num);
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ZoomToggle(object sender, EventArgs e)
	{
		ZoomEnabled = !ZoomEnabled;
	}

	private void ContextMenu_ZoomIn(object sender, EventArgs e)
	{
		m_ZoomTargetFactor += ZoomInterval * 10f;
	}

	private void ContextMenu_ZoomOut(object sender, EventArgs e)
	{
		m_ZoomTargetFactor -= ZoomInterval * 10f;
	}

	private void ContextMenu_ZoomRestore(object sender, EventArgs e)
	{
		ZoomRestore();
	}

	private void ContextMenu_ZoomModeBothAxis(object sender, EventArgs e)
	{
		m_ZoomMode = ZOOM_MODE.BOTH_AXIS;
	}

	private void ContextMenu_ZoomModeOnlyXAxis(object sender, EventArgs e)
	{
		m_ZoomMode = ZOOM_MODE.XAXIS_ONLY;
	}

	private void ContextMenu_ZoomModeOnlyYAxis(object sender, EventArgs e)
	{
		m_ZoomMode = ZOOM_MODE.YAXIS_ONLY;
	}

	private void ContextMenu_ZoomModeOnlyZAxis(object sender, EventArgs e)
	{
		m_ZoomMode = ZOOM_MODE.ZAXIS_ONLY;
	}

	private void ContextMenu_SelectionValueSubtract_Click(object sender, EventArgs e)
	{
		float num = (float)Conversion.Val(Interaction.InputBox(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Subtract to selection values:", "Restar a la selección:")), Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Math operations", "Operaciones matemáticas")), "2"));
		if (num != 0f)
		{
			m_ItemsSelected_Add(0f, 0f - num);
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_XAxisScaleFixed_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca los valores mínimo y máximo separados por una coma (ejemplo: -500,1500):", "Especificar escala para eje X", Conversions.ToString(XAxisScaleMinimum) + "," + Conversions.ToString(XAxisScaleMaximum)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter minimum and maximum values separated by a comma (eg: -500,1500):", "Specify scale for X-axis", Conversions.ToString(XAxisScaleMinimum) + "," + Conversions.ToString(XAxisScaleMaximum)));
		if (text.IndexOf(",") >= 0)
		{
			string[] array = text.Split(',');
			XAxisScaleMinimum = Conversions.ToSingle(array[0]);
			XAxisScaleMaximum = Conversions.ToSingle(array[1]);
			XAxisScaleMode = SCALEMODE.SCALEMODE_FIXED;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_YAxisScaleAutomatic_Click(object sender, EventArgs e)
	{
		YAxisScaleMode = SCALEMODE.SCALEMODE_AUTOMATIC;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ZAxisScaleAutomatic_Click(object sender, EventArgs e)
	{
		ZAxisScaleMode = SCALEMODE.SCALEMODE_AUTOMATIC;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_YAxisScaleFixed_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca los valores mínimo y máximo separados por una coma (ejemplo, -500,1500):", "Especificar escala para eje Y", Conversions.ToString(YAxisScaleMinimum) + "," + Conversions.ToString(YAxisScaleMaximum)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter minimum and maximum values separated by a comma (eg: -500,1500):", "Specify scale for Y-axis", Conversions.ToString(YAxisScaleMinimum) + "," + Conversions.ToString(YAxisScaleMaximum)));
		if (text.IndexOf(",") >= 0)
		{
			string[] array = text.Split(',');
			YAxisScaleMinimum = Conversions.ToSingle(array[0]);
			YAxisScaleMaximum = Conversions.ToSingle(array[1]);
			YAxisScaleMode = SCALEMODE.SCALEMODE_FIXED;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ZAxisScaleFixed_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca los valores mínimo y máximo separados por una coma (ejemplo, -500,1500):", "Especificar escala para eje Z", Conversions.ToString(ZAxisScaleMinimum) + "," + Conversions.ToString(ZAxisScaleMaximum)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter minimum and maximum values separated by a comma (eg: -500,1500):", "Specify scale for Z-axis", Conversions.ToString(ZAxisScaleMinimum) + "," + Conversions.ToString(ZAxisScaleMaximum)));
		if (text.IndexOf(",") >= 0)
		{
			string[] array = text.Split(',');
			ZAxisScaleMinimum = Conversions.ToSingle(array[0]);
			ZAxisScaleMaximum = Conversions.ToSingle(array[1]);
			ZAxisScaleMode = SCALEMODE.SCALEMODE_FIXED;
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_CastShadows_Click(object sender, EventArgs e)
	{
		CastShadows = !CastShadows;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ToggleColoredShadows_Click(object sender, EventArgs e)
	{
		ShadowColored = !ShadowColored;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_ToggleShadowsSmooth_Click(object sender, EventArgs e)
	{
		ShadowSmooth = !ShadowSmooth;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_SolidColors_Click(object sender, EventArgs e)
	{
		ShowSolidColors = true;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_GradientFill_Click(object sender, EventArgs e)
	{
		ShowSolidColors = false;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_Surface_Click(object sender, EventArgs e)
	{
		ShowSurface = !ShowSurface;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_WallStyle_Click(object sender, EventArgs e)
	{
		switch (((MenuItem)sender).Text)
		{
		case "Hidden":
		case "Ocultas":
			WallStyle = STYLEWALLS.STYLEWALLS_NOWALLS;
			break;
		case "Wire box":
		case "Alambre":
			WallStyle = STYLEWALLS.STYLEWALLS_BOXED;
			break;
		case "Visible":
		case "Visibles":
			WallStyle = STYLEWALLS.STYLEWALLS_VISIBLE;
			break;
		}
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_GridBackgroundImage_Click(object sender, EventArgs e)
	{
		OpenFileDialog openFileDialog = new OpenFileDialog();
		openFileDialog.Filter = "Pictures (*.gif,*.jpg,*.png,*.bmp,*.tif)|*.gif;*.jpg;*.png;*.bmp;*.tif";
		openFileDialog.CheckFileExists = true;
		if (openFileDialog.ShowDialog() == DialogResult.OK)
		{
			GridBackgroundImage = System.Drawing.Image.FromFile(openFileDialog.FileName);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_GridBackgroundImageTransparency_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el porcentaje de transparencia para la imagen de fondo de la rejilla (0-100)", "Especificar transparencia de imagen", Conversions.ToString(GridBackgroundImageTransparency)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter the transparency percentage of image (0-100)", "Specify transparency percentage for grid's background image", Conversions.ToString(GridBackgroundImageTransparency)));
		if (Versioned.IsNumeric(text))
		{
			GridBackgroundImageTransparency = Conversions.ToInteger(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_GridStyle_Click(object sender, EventArgs e)
	{
		switch (((MenuItem)sender).Text)
		{
		case "Transparent":
		case "Transparente":
			WallsBackStyle = STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_TRANSPARENT;
			break;
		case "Solid":
		case "Color sólido":
			WallsBackStyle = STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_SOLID;
			break;
		case "Bands pattern":
		case "Bandas":
			WallsBackStyle = STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_BANDS;
			break;
		case "Chess pattern":
		case "Efecto ajedrez":
			WallsBackStyle = STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_CHESS;
			break;
		case "Vertical gradient":
		case "Gradente vertical":
			WallsBackStyle = STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_GRADIENT;
			break;
		case "Vertical gradient (inverted)":
		case "Gradiente vertical (invertido)":
			WallsBackStyle = STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_GRADIENT_INVERTED;
			break;
		}
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_PointStyle_Click(object sender, EventArgs e)
	{
		switch (((MenuItem)sender).Text)
		{
		case "Circles":
		case "Círculos":
			PointStyle = STYLEPOINT.STYLEPOINT_CIRCLE;
			break;
		case "Squares":
		case "Cuadrados":
			PointStyle = STYLEPOINT.STYLEPOINT_RECTANGLE;
			break;
		case "Triangles":
		case "Triángulos":
			PointStyle = STYLEPOINT.STYLEPOINT_TRIANGLE;
			break;
		}
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_SlantX_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el factor de rotación X", "Especificar rotación X", Conversions.ToString(SlantX)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter the slant X factor", "Specify X rotation for chart", Conversions.ToString(SlantX)));
		if (Versioned.IsNumeric(text))
		{
			SlantX = Conversions.ToSingle(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_XAxisAngle_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el ángulo de rotación del eje X", "Especificar rotación del eje X", Conversions.ToString((double)(XAxisAngle * 180f) / Math.PI)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter the angle of rotation for X axis", "Specify X axis rotation angle", Conversions.ToString((double)(XAxisAngle * 180f) / Math.PI)));
		if (Versioned.IsNumeric(text))
		{
			XAxisAngle = (float)(Conversions.ToDouble(text) * Math.PI / 180.0);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_YAxisAngle_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el ángulo de rotación del eje Y", "Especificar rotación del eje Y", Conversions.ToString((double)(XAxisAngle * 180f) / Math.PI)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter the angle of rotation for Y axis", "Specify Y axis rotation angle", Conversions.ToString((double)(XAxisAngle * 180f) / Math.PI)));
		if (Versioned.IsNumeric(text))
		{
			YAxisAngle = (float)(Conversions.ToDouble(text) * Math.PI / 180.0);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ZAxisAngle_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el ángulo de rotación del eje Z", "Especificar rotación del eje Z", Conversions.ToString((double)(XAxisAngle * 180f) / Math.PI)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter the angle of rotation for Z axis", "Specify Z axis rotation angle", Conversions.ToString((double)(XAxisAngle * 180f) / Math.PI)));
		if (Versioned.IsNumeric(text))
		{
			ZAxisAngle = (float)(Conversions.ToDouble(text) * Math.PI / 180.0);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ShadowsDistance_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca la distancia de la sombra", "Distancia de sombra", Conversions.ToString(m_intShadowOffset)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter the distance of the shadow", "Shadow distance", Conversions.ToString(m_intShadowOffset)));
		if (Versioned.IsNumeric(text))
		{
			ShadowOffset = Conversions.ToInteger(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_SlantY_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el factor de rotación Y", "Especificar rotación Y", Conversions.ToString(SlantY)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter the slant Y factor", "Specify Y rotation for chart", Conversions.ToString(SlantY)));
		if (Versioned.IsNumeric(text))
		{
			SlantY = Conversions.ToSingle(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_Thickness_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el grosor para las gráficas de cilindros, columnas y máximo/mínimo", "Especificar grosor", Conversions.ToString(Thickness)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter thickness for cylinder, column and high-low charts", "Specify grosor", Conversions.ToString(Thickness)));
		if (Versioned.IsNumeric(text))
		{
			Thickness = Conversions.ToSingle(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_Depth_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca la profundidad para las gráficas tarta y doughnut (sólo 3D)", "Especificar profundidad", Conversions.ToString(Thickness)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter depth for doughnut and pie charts (only 3D)", "Specify depth", Conversions.ToString(Thickness)));
		if (Versioned.IsNumeric(text))
		{
			Depth = Conversions.ToInteger(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_HoleSize_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el tamaño en porcentage del agujero central para las gráficas doughnut (5-95)", "Especificar tamaño del agujero central", Conversions.ToString(HoleSize)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter size of hole for doughnut charts as a percentage (5-95)", "Specify hole size", Conversions.ToString(HoleSize)));
		if (Versioned.IsNumeric(text))
		{
			HoleSize = Conversions.ToInteger(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_TopMargin_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el tamaño en pixels del margen superior:", "Cambiar el tamaño del margen superior", Conversions.ToString(m_intMarginTop)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter height of top margin (in pixels):", "Change top margin", Conversions.ToString(m_intMarginTop)));
		if (Versioned.IsNumeric(text))
		{
			MarginTop = Conversions.ToInteger(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_BottomMargin_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el tamaño en pixels del margen inferior:", "Cambiar el tamaño del margen inferior", Conversions.ToString(m_intMarginBottom)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter height of bottom margin (in pixels):", "Change bottom margin", Conversions.ToString(m_intMarginBottom)));
		if (Versioned.IsNumeric(text))
		{
			MarginBottom = Conversions.ToInteger(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_RightMargin_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el tamaño en pixels del margen derecho:", "Cambiar el tamaño del margen derecho", Conversions.ToString(m_intMarginRight)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter width of right margin (in pixels):", "Change right margin", Conversions.ToString(m_intMarginRight)));
		if (Versioned.IsNumeric(text))
		{
			MarginRight = Conversions.ToInteger(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_LeftMargin_Click(object sender, EventArgs e)
	{
		string text = ((m_BultInDialogLanguage != 0) ? MyInputBox.InputBox2(m_BultInDialogLanguage, "Introduzca el tamaño en pixels del margen izquierdo:", "Cambiar el tamaño del margen izquierdo", Conversions.ToString(m_intMarginLeft)) : MyInputBox.InputBox2(m_BultInDialogLanguage, "Enter width of left margin (in pixels):", "Change left margin", Conversions.ToString(m_intMarginLeft)));
		if (Versioned.IsNumeric(text))
		{
			MarginLeft = Conversions.ToInteger(text);
			if (!m_blnAutoRefresh)
			{
				m_RefreshGraph(blnForce: true);
			}
		}
	}

	private void ContextMenu_ShowPoints_Click(object sender, EventArgs e)
	{
		ShowPoints = !ShowPoints;
		if (!m_blnAutoRefresh)
		{
			m_RefreshGraph(blnForce: true);
		}
	}

	private void ContextMenu_Animate(object sender, EventArgs e)
	{
		Animate();
	}

	private void m_RefreshContextualMenu()
	{
		string[] array = (string[])names.Clone();
		bool flag = true;
		int seriesDimensions = SeriesDimensions;
		if (!m_blnAllowBuiltinDialog)
		{
			return;
		}
		EventHandler onClick = ContextMenu_Click;
		ContextMenu = new ContextMenu();
		ContextMenu contextMenu = ContextMenu;
		MenuItem menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "--- Customize chart ---", "--- Personalizar gráfica ---")));
		menuItem.DefaultItem = true;
		contextMenu.MenuItems.Add(menuItem);
		contextMenu.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Title", "Título")), ContextMenu_Title_Click);
		menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Chart type", "Tipo de gráfica")));
		MenuItem menuItem2 = menuItem.MenuItems.Add("2D");
		Array.Sort(array);
		int num = Information.UBound(array);
		for (int i = 0; i <= num; i = checked(i + 1))
		{
			if (Operators.CompareString(array[i].Substring(0, 2), "3D", TextCompare: false) == 0 && flag)
			{
				flag = false;
				menuItem2 = menuItem.MenuItems.Add("3D");
			}
			MenuItem menuItem3 = menuItem2.MenuItems.Add(array[i], onClick);
			int num2 = Array.IndexOf(names, array[i]);
			if (num2 >= 0)
			{
				menuItem3.Enabled = ((chartDimensions[num2] <= seriesDimensions) & (chartDimensions[num2] > 1)) | (seriesDimensions == chartDimensions[num2] && seriesDimensions == 1);
			}
			else
			{
				menuItem3.Enabled = false;
			}
		}
		contextMenu.MenuItems.Add(menuItem);
		menuItem = (MenuItem)NewLateBinding.LateGet(contextMenu.MenuItems, null, "Add", new object[1] { RuntimeHelpers.GetObjectValue(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Additional calculation", "Cálculo adicional")) }, null, null, null);
		int num3 = Information.UBound(additionalCalculations);
		checked
		{
			for (int i = 0; i <= num3; i++)
			{
				menuItem.MenuItems.Add(additionalCalculations[i], ContextMenu_additionalCalculations_Click);
			}
			menuItem = (MenuItem)NewLateBinding.LateGet(contextMenu.MenuItems, null, "Add", new object[1] { RuntimeHelpers.GetObjectValue(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Margins", "Márgenes")) }, null, null, null);
			menuItem.MenuItems.Add("Top margin", ContextMenu_TopMargin_Click);
			menuItem.MenuItems.Add("Right margin", ContextMenu_RightMargin_Click);
			menuItem.MenuItems.Add("Bottom margin", ContextMenu_BottomMargin_Click);
			menuItem.MenuItems.Add("Left margin", ContextMenu_LeftMargin_Click);
			contextMenu.MenuItems.Add("-");
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Datatable", "Tabla de datos")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide", "Mostrar/ocultar")), ContextMenu_ShowDataTable_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Datatable title", "Título de la tabla de datos")), ContextMenu_DataTable_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide X-axis items names on datatable", "Mostrar/ocultar nombres de elementos en la tabla de datos")), ContextMenu_ShowXAxisItems_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide series names on datatable", "Mostrar/ocultar nombres de las series en la tabla de datos")), ContextMenu_ShowLegendInDatatable_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align values to the left", "Alinear valores a la izquierda")), ContextMenu_DataTableAlignment_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align values to the center", "Alinear valores a la derecha")), ContextMenu_DataTableAlignment_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align values to the right", "Alinear valores al centro")), ContextMenu_DataTableAlignment_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Legend", "Leyenda")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide", "Mostrar/ocultar")), ContextMenu_ShowLegend_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Legend title", "Título de la leyenda")), ContextMenu_Legend_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align top/left", "Alinear arriba/izquierda")), ContextMenu_LegendAlignment_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align top/center", "Alinear arriba/centro")), ContextMenu_LegendAlignment_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align top/right", "Alinear arriba/derecha")), ContextMenu_LegendAlignment_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align middle/left", "Alinear mitad/izquierda")), ContextMenu_LegendAlignment_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align middle/right", "Alinear mitad/derecha")), ContextMenu_LegendAlignment_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align bottom/left", "Alinear abajo/izquierda")), ContextMenu_LegendAlignment_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align bottom/center", "Alinear abajo/centro")), ContextMenu_LegendAlignment_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Align bottom/right", "Alinear abajo/derecha")), ContextMenu_LegendAlignment_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Markers", "Marcadores")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide", "Mostrar/ocultar")), ContextMenu_ShowPoints_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Circles", "Círculos")), ContextMenu_PointStyle_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Squares", "Cuadrados")), ContextMenu_PointStyle_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Triangles", "Triángulos")), ContextMenu_PointStyle_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Values", "Valores")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide", "Mostrar/ocultar")), ContextMenu_Values_Click);
			MenuItem menuItem3 = (MenuItem)NewLateBinding.LateGet(menuItem.MenuItems, null, "Add", new object[1] { RuntimeHelpers.GetObjectValue(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Style", "Estilo")) }, null, null, null);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Standard", "Normal")), ContextMenu_ValuesStyle_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Rounded square", "Enmarcado")), ContextMenu_ValuesStyle_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Shadowed", "Sombreado")), ContextMenu_ValuesStyle_Click);
			menuItem3 = (MenuItem)NewLateBinding.LateGet(menuItem.MenuItems, null, "Add", new object[1] { RuntimeHelpers.GetObjectValue(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Location", "Ubicación")) }, null, null, null);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Default", "Normal")), ContextMenu_ValuesLocation_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Inside", "Interior")), ContextMenu_ValuesLocation_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Smart", "Inteligente")), ContextMenu_ValuesLocation_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Toggle remark maximum", "Marcar/desmarcar valor máximo")), ContextMenu_RemarkMaximum_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Toggle remark minimum", "Marcar/desmarcar valor mínimo")), ContextMenu_RemarkMinimum_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "X-axis", "Eje X")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide", "Mostrar/ocultar")), ContextMenu_ShowXAxis_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Reverse order", "Invertir orden")), ContextMenu_XAxisReverse_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Rotate X-axis labels 45º", "Rotar 45º las etiquetas en el eje X")), ContextMenu_XAxisRotate_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Rotate X-axis labels 90º", "Rotar 90º las etiquetas en el eje X")), ContextMenu_XAxisRotate90_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide X-axis dividers", "Mostrar/ocultar divisores eje X")), ContextMenu_ShowXAxisDividers_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "X-axis dividers count", "Número de divisores en el eje X")), ContextMenu_XAxisDividersCount_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "X-axis title", "Título del eje X")), ContextMenu_XAxisTitle_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Automatic scale", "Escala automática")), ContextMenu_XAxisScaleAutomatic_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Automatic scale (0 minimum)", "Escala automática (mínimo 0)")), ContextMenu_XAxisScaleAutomaticMinimumZero_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Fixed scale", "Escala fija")), ContextMenu_XAxisScaleFixed_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Y-axis", "Eje Y")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Number of Y-axis dividers", "Número de divisores en el eje Y")), ContextMenu_ShowYAxisDividers_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide Y-axis dividers", "Mostrar/ocultar divisores en el eje Y")), ContextMenu_ToggleShowYAxisDividers_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Rotate Y-axis values", "Rotar etiquetas en el eje Y")), ContextMenu_YAxisRotate_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Y-axis title", "Título del eje Y")), ContextMenu_YAxisTitle_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Automatic scale", "Escala automática")), ContextMenu_YAxisScaleAutomatic_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Automatic scale (0 minimum)", "Escala automática (mínimo 0)")), ContextMenu_YAxisScaleAutomaticMinimumZero_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Fixed scale", "Escala fija")), ContextMenu_YAxisScaleFixed_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Z-axis", "Eje Z")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Number of Z-axis dividers", "Número de divisores en el eje Z")), ContextMenu_ShowZAxisDividers_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide Z-axis dividers", "Mostrar/ocultar divisores en el eje Z")), ContextMenu_ToggleShowZAxisDividers_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Z-axis title", "Título del eje Z")), ContextMenu_ZAxisTitle_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Automatic scale", "Escala automática")), ContextMenu_ZAxisScaleAutomatic_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Automatic scale (0 minimum)", "Escala automática (mínimo 0)")), ContextMenu_ZAxisScaleAutomaticMinimumZero_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Fixed scale", "Escala fija")), ContextMenu_ZAxisScaleFixed_Click);
			contextMenu.MenuItems.Add(menuItem);
			contextMenu.MenuItems.Add("-");
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Selection", "Selección")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Explode pieces (only pies)", "Separar sectores (sólo tartas)")), ContextMenu_ExplodePie_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Multiply", "Multiplicar")), ContextMenu_SelectionValueMultiply_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Divide", "Dividir")), ContextMenu_SelectionValueDivide_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Add", "Sumar")), ContextMenu_SelectionValueAdd_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Subtract", "Restar")), ContextMenu_SelectionValueSubtract_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Zoom", "Ampliar")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Enable/disable zoom", "Permitir/impedir ampliar")), ContextMenu_ZoomToggle);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Zoom in", "Ampliar")), ContextMenu_ZoomIn);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Zoom out", "Alejar")), ContextMenu_ZoomOut);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Restore", "Restaurar")), ContextMenu_ZoomRestore);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Apply zoom on each axis", "Aplicar ampliación sobre todos los ejes")), ContextMenu_ZoomModeBothAxis);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Apply zoom only on X-axis", "Aplicar ampliación sólo sobre el eje X")), ContextMenu_ZoomModeOnlyXAxis);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Apply zoom only on Y-axis", "Aplicar ampliación sólo sobre el eje Y")), ContextMenu_ZoomModeOnlyYAxis);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Apply zoom only on Z-axis", "Aplicar ampliación sólo sobre el eje Z")), ContextMenu_ZoomModeOnlyZAxis);
			contextMenu.MenuItems.Add(menuItem);
			menuItem.Enabled = (m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE3D_XYZ_SURFACE) | (m_lngStyle == STYLE2D3D.STYLE3D_XYZ_SCATTER) | (m_lngStyle == STYLE2D3D.STYLE3D_XYZ_SURFACE_TRIANGLE) | (m_lngStyle == STYLE2D3D.STYLE3D_XYZ_LINE);
			contextMenu.MenuItems.Add("-");
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Colors", "Colores")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Random series colors", "Colores de series aleatorios")), ContextMenu_RandomSeriesColors_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Background color", "Color de fondo")), ContextMenu_BackGroundColor_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Border color", "Color del borde")), ContextMenu_BorderColor_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Datatable background color", "Color del fondo de la tabla de datos")), ContextMenu_DatatableBackgroundColor_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "HotSpot backcolor", "Color de fondo de las etiquetas activas")), ContextMenu_HotSpotBackColor_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "HotSpot text color", "Color del texto de las etiquetas activas")), ContextMenu_HotSpotColor_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Grid primay background color", "Color primario para el fondo de rejilla")), ContextMenu_PrimaryColor_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Grid secondary background color", "Color secundario para el fondo de rejilla")), ContextMenu_SecondaryColor_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Legend color", "Color de leyenda")), ContextMenu_LegendColor_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Legend background color", "Color de fondo de la leyenda")), ContextMenu_LegendBackColor_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Values background color", "Color del fondo de los valores")), ContextMenu_ValuesBackgroundColor_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Values color", "Color de los valores")), ContextMenu_ValuesColor_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "X-axis labels color", "Color de las etiquetas del eje X")), ContextMenu_XAxisColor_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Y-axis labels color", "Color de las etiquetas del eje Y")), ContextMenu_YAxisColor_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Z-axis labels color", "Color de las etiquetas del eje Z")), ContextMenu_ZAxisColor_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Surface color", "Color de la superficie")), ContextMenu_SurfaceColor_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "HotSpots", "Etiquetas activas")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Show/hide", "Mostrar/ocultar")), ContextMenu_HotSpot_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Toggle cross", "Conmutar cruz de seguimiento")), ContextMenu_HotSpotCross_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Quality", "Calidad")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Best (slowest)", "Mejor (más lento)")), ContextMenu_Quality_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "High", "Alta")), ContextMenu_Quality_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Standard", "Normal")), ContextMenu_Quality_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Low (fastest)", "Baja (más rápido)")), ContextMenu_Quality_Click);
			contextMenu.MenuItems.Add(menuItem);
			menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Special effects", "Efectos especiales")));
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Solid colors (faster)", "Colores sólidos (más rápido)")), ContextMenu_SolidColors_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Gradient fill (nicer but slower)", "Gradientes de color (más bonito pero más lento)")), ContextMenu_GradientFill_Click);
			menuItem.MenuItems.Add("-");
			menuItem3 = (MenuItem)NewLateBinding.LateGet(menuItem.MenuItems, null, "Add", new object[1] { RuntimeHelpers.GetObjectValue(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Background fill", "Relleno del fondo")) }, null, null, null);
			int num4 = Information.UBound(backgroundStyles);
			for (int i = 0; i <= num4; i++)
			{
				menuItem3.MenuItems.Add(backgroundStyles[i], ContextMenu_BackgroundStyle_Click);
			}
			menuItem3 = (MenuItem)NewLateBinding.LateGet(menuItem.MenuItems, null, "Add", new object[1] { RuntimeHelpers.GetObjectValue(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Grid", "Rejilla")) }, null, null, null);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Background image", "Imagen de fondo")), ContextMenu_GridBackgroundImage_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Background image transparency", "Transparencia de la imagen de fondo")), ContextMenu_GridBackgroundImageTransparency_Click);
			menuItem3.MenuItems.Add("-");
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Transparent", "Transparente")), ContextMenu_GridStyle_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Solid", "Color sólido")), ContextMenu_GridStyle_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Bands pattern", "Bandas")), ContextMenu_GridStyle_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Chess pattern", "Efecto ajedrez")), ContextMenu_GridStyle_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Vertical gradient", "Gradiente vertical")), ContextMenu_GridStyle_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Vertical gradient (inverted)", "Gradiente vertical (invertido)")), ContextMenu_GridStyle_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Cast shadows (only 2D charts)", "Mostrar/ocultar sombras (sólo gráficas 2D)")), ContextMenu_CastShadows_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Toggle smooth/solid shadow", "Cambiar sombra difuminada/sólida")), ContextMenu_ToggleShadowsSmooth_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Shadow distance", "Distancia de la sombra")), ContextMenu_ShadowsDistance_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Toggle grey/colored shadows", "Cambiar sombras color<->gris")), ContextMenu_ToggleColoredShadows_Click);
			menuItem.MenuItems.Add("-");
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Hole size (doughnut)", "Tamaño del agujero central (doughnut)")), ContextMenu_HoleSize_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Thickness", "Grosor")), ContextMenu_Thickness_Click);
			menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Toggle surface", "Muestra/oculta el nivel de superficie")), ContextMenu_Surface_Click);
			menuItem.MenuItems.Add("-");
			menuItem3 = menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "3D charts", "Gráficas 3D")), ContextMenu_CastShadows_Click);
			menuItem2 = (MenuItem)NewLateBinding.LateGet(menuItem3.MenuItems, null, "Add", new object[1] { RuntimeHelpers.GetObjectValue(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "3D walls", "Paredes 3D")) }, null, null, null);
			menuItem2.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Hidden", "Ocultas")), ContextMenu_WallStyle_Click);
			menuItem2.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Wire box", "Alambre")), ContextMenu_WallStyle_Click);
			menuItem2.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Visible", "Visibles")), ContextMenu_WallStyle_Click);
			menuItem3.MenuItems.Add("-");
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Slant X", "Distorsión X")), ContextMenu_SlantX_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Slant Y", "Distorsión Y")), ContextMenu_SlantY_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Depth (pie and doughnut 3D)", "Produndidad (tarta y doughnut 3D)")), ContextMenu_Depth_Click);
			menuItem3.MenuItems.Add("-");
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "X axis rotation angle (only XYZ charts)", "Ángulo de rotación del eje X (sólo gráficas XYZ)")), ContextMenu_XAxisAngle_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Y axis rotation angle (only XYZ charts)", "Ángulo de rotación del eje Y (sólo gráficas XYZ)")), ContextMenu_YAxisAngle_Click);
			menuItem3.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Z axis rotation angle (only XYZ charts)", "Ángulo de rotación del eje Z (sólo gráficas XYZ)")), ContextMenu_ZAxisAngle_Click);
			contextMenu.MenuItems.Add(menuItem);
			contextMenu.MenuItems.Add("-");
			contextMenu.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Animate", "Animar")), ContextMenu_Animate);
			if (m_blnPermisoEscrituraDisco)
			{
				menuItem = new MenuItem(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "Save image to file", "Salvar imagen a disco")));
				menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "PNG format - very high quality (300 dpi)", "Formato PNG - muy alta calidad (300 ppp)")), ContextMenu_SaveVeryHighQuality_Click);
				menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "PNG format - high quality (200 dpi)", "Formato PNG - alta calidad (200 ppp)")), ContextMenu_SaveHighQuality_Click);
				menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "PNG format - standard quality (72 dpi)", "Formato PNG - calidad normal (72 ppp)")), ContextMenu_SaveStandardQuality_Click);
				menuItem.MenuItems.Add("-");
				menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "SVG format (vector)", "Formato SVG (vectorial)")), ContextMenu_SaveSVG_Click);
				menuItem.MenuItems.Add("-");
				menuItem.MenuItems.Add(Conversions.ToString(Interaction.IIf(m_BultInDialogLanguage == LANGUAGE.LANG_ENGLISH, "GIF format (animated)", "Formato GIF (animado)")), ContextMenu_SaveAnimatedGIF_Click);
				contextMenu.MenuItems.Add(menuItem);
			}
			contextMenu = null;
		}
	}

	public void Reset(bool clearData)
	{
		Super2d3dGraph component = new Super2d3dGraph();
		PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(component);
		PropertyDescriptorCollection properties2 = TypeDescriptor.GetProperties(this);
		bool blnAutoRefresh = m_blnAutoRefresh;
		m_blnAutoRefresh = false;
		foreach (PropertyDescriptor item in properties)
		{
			if (((clearData | (Operators.CompareString(item.Name, "Series", TextCompare: false) != 0)) & !item.IsReadOnly & (Operators.CompareString(item.ComponentType.Name, "Super2d3dGraph", TextCompare: false) == 0)) && properties2.Contains(item))
			{
				PropertyDescriptor propertyDescriptor2 = properties2[item.Name];
				propertyDescriptor2.SetValue(this, RuntimeHelpers.GetObjectValue(item.GetValue(component)));
			}
		}
		m_blnAutoRefresh = blnAutoRefresh;
		if (m_blnAutoRefresh)
		{
			RefreshChart();
		}
	}

	public object Clone()
	{
		Hashtable hashtable = new Hashtable();
		Super2d3dGraph super2d3dGraph = new Super2d3dGraph();
		super2d3dGraph.AutoRefresh = false;
		PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this);
		foreach (PropertyDescriptor item in properties)
		{
			try
			{
				if (item.PropertyType.IsSerializable)
				{
					hashtable.Add(item.Name, RuntimeHelpers.GetObjectValue(item.GetValue(this)));
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
		PropertyDescriptorCollection properties2 = TypeDescriptor.GetProperties(super2d3dGraph);
		bool autoRefresh = default(bool);
		foreach (PropertyDescriptor item2 in properties2)
		{
			if (!hashtable.Contains(item2.Name))
			{
				continue;
			}
			object objectValue = RuntimeHelpers.GetObjectValue(hashtable[item2.Name]);
			try
			{
				if (Operators.CompareString(item2.Name, "AutoRefresh", TextCompare: false) == 0)
				{
					autoRefresh = Conversions.ToBoolean(objectValue);
				}
				else
				{
					item2.SetValue(super2d3dGraph, RuntimeHelpers.GetObjectValue(objectValue));
				}
			}
			catch (Exception ex3)
			{
				ProjectData.SetProjectError(ex3);
				Exception ex4 = ex3;
				ProjectData.ClearProjectError();
			}
		}
		super2d3dGraph.AutoRefresh = autoRefresh;
		return super2d3dGraph;
	}

	object ICloneable.Clone()
	{
		//ILSpy generated this explicit interface implementation from .override directive in Clone
		return this.Clone();
	}

	private void ValidateZoomScaleParameters()
	{
		if (!m_ZoomEnabled)
		{
			return;
		}
		if ((m_XAxisScaleMode != SCALEMODE.SCALEMODE_FIXED) & (m_XAxisScaleMode != SCALEMODE.SCALEMODE_FIXED_DATETIME))
		{
			m_XAxisScaleMinimumDateTime = m_XAxisMinDateTime;
			m_XAxisScaleMaximumDateTime = m_XAxisMaxDateTime;
			m_XAxisScaleMinimumNumeric = (float)m_dblSeriesMinX;
			m_XAxisScaleMaximumNumeric = (float)m_dblSeriesMaxX;
			if ((m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME))
			{
				m_XAxisScaleMode = SCALEMODE.SCALEMODE_FIXED_DATETIME;
			}
			else
			{
				m_XAxisScaleMode = SCALEMODE.SCALEMODE_FIXED;
			}
		}
		if (m_YAxisScaleMode != SCALEMODE.SCALEMODE_FIXED)
		{
			m_YAxisScaleMinimum = (float)m_dblSeriesMinY;
			m_YAxisScaleMaximum = (float)m_dblSeriesMaxY;
			m_YAxisScaleMode = SCALEMODE.SCALEMODE_FIXED;
		}
		if (m_ZAxisScaleMode != SCALEMODE.SCALEMODE_FIXED)
		{
			m_ZAxisScaleMinimumNumeric = (float)m_dblSeriesMinZ;
			m_ZAxisScaleMaximumNumeric = (float)m_dblSeriesMaxZ;
			m_ZAxisScaleMode = SCALEMODE.SCALEMODE_FIXED;
		}
	}

	private void TimerEventProcessor(object myObject, EventArgs myEventArgs)
	{
		bool flag = default(bool);
		if ((double)Math.Abs(m_ZoomTargetFactor - m_ZoomFactor) > (double)m_ZoomInterval / 10.0)
		{
			m_ZoomFactor += (m_ZoomTargetFactor - m_ZoomFactor) / 2f;
			if (m_ZoomFactor < m_ZoomInterval)
			{
				m_ZoomTargetFactor = m_ZoomInterval;
				m_ZoomFactor = m_ZoomInterval;
			}
			else if (m_ZoomFactor > 90f)
			{
				m_ZoomTargetFactor = 90f;
				m_ZoomFactor = 90f;
			}
			flag = true;
		}
		if (Math.Abs(m_ZoomTargetOffsetX - m_ZoomOffsetX) > 1f)
		{
			m_ZoomOffsetX += (m_ZoomTargetOffsetX - m_ZoomOffsetX) / 2f;
			flag = true;
		}
		if (Math.Abs(m_ZoomTargetOffsetY - m_ZoomOffsetY) > 1f)
		{
			m_ZoomOffsetY += (m_ZoomTargetOffsetY - m_ZoomOffsetY) / 2f;
			flag = true;
		}
		if (Math.Abs(m_ZoomTargetOffsetZ - m_ZoomOffsetZ) > 1f)
		{
			m_ZoomOffsetZ += (m_ZoomTargetOffsetZ - m_ZoomOffsetZ) / 2f;
			flag = true;
		}
		if (flag)
		{
			SmoothingMode quality = m_Quality;
			m_Quality = SmoothingMode.HighSpeed;
			m_caption = null;
			m_RefreshGraph(blnForce: true);
			m_Quality = quality;
			m_ZoomOldChanges = true;
		}
		else if (m_ZoomOldChanges)
		{
			m_RefreshGraph(blnForce: true);
			m_ZoomOldChanges = false;
		}
	}

	public void ZoomRestore()
	{
		m_ZoomTargetFactor = 1f;
		m_ZoomFactor = 1f;
		m_ZoomOffsetX = 0f;
		m_ZoomOffsetY = 0f;
		m_ZoomOffsetZ = 0f;
		m_ZoomTargetOffsetX = 0f;
		m_ZoomTargetOffsetY = 0f;
		m_ZoomTargetOffsetZ = 0f;
		XAxisScaleMaximum = m_ZoomXAxisSCaleMaxOriginal;
		XAxisScaleMinimum = m_ZoomXAxisScaleMinOriginal;
		YAxisScaleMaximum = m_ZoomYAxisScaleMaxOriginal;
		YAxisScaleMinimum = m_ZoomYAxisScaleMinOriginal;
		ZAxisScaleMaximum = m_ZoomZAxisScaleMaxOriginal;
		ZAxisScaleMinimum = m_ZoomZAxisScaleMinOriginal;
		m_RefreshGraph(blnForce: true);
	}

	public string CreateSVG(bool scaleToFit)
	{
		_g.svgMode = true;
		RefreshChart();
		string result = _g.get_svgText(scaleToFit);
		_g.svgMode = false;
		return result;
	}

	public int ChartCount()
	{
		return m_Charts.Count;
	}

	public void ChartAddNew()
	{
		ChartAdd(new Super2d3dGraph());
	}

	public void ChartAdd(Super2d3dGraph oChart)
	{
		m_Charts.Add(oChart);
	}

	public Super2d3dGraph ChartItem(int index)
	{
		return (Super2d3dGraph)m_Charts[index];
	}

	public void ChartRemove(int index)
	{
		if (index > 1)
		{
			m_Charts.Remove(index);
		}
	}

	public void SetAllSeriesLineStyle(Pen p)
	{
		m_SeriesLineStyleDefault = p;
	}

	protected override void OnPaintBackground(PaintEventArgs e)
	{
		if (m_surface == null)
		{
			return;
		}
		if (m_lngResolution != 72)
		{
			switch (m_Quality)
			{
			case SmoothingMode.HighQuality:
				e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
				break;
			case SmoothingMode.AntiAlias:
				e.Graphics.InterpolationMode = InterpolationMode.HighQualityBilinear;
				break;
			case SmoothingMode.Default:
				e.Graphics.InterpolationMode = InterpolationMode.High;
				break;
			case SmoothingMode.HighSpeed:
				e.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
				break;
			}
			e.Graphics.DrawImage(m_surface, 0, 0, Width, Height);
		}
		else
		{
			e.Graphics.DrawImage(m_surface, e.ClipRectangle, e.ClipRectangle, GraphicsUnit.Pixel);
		}
	}

	[Description("Realiza cálculos de un array con valores multidimensionales previos al dibujado de la gráfica, tales como máximos, mínimos, totales, etc.")]
	private void m_DoCalcMulti()
	{
		if (!Versioned.IsNumeric(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null))))
		{
			return;
		}
		m_dblSeriesMaxY = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null));
		m_dblSeriesMinY = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null));
		checked
		{
			m_dblSeriesRangeSumY = new double[Information.UBound(m_arrSeries) + 1];
			int num = Information.UBound(m_arrSeries);
			for (int i = 0; i <= num; i++)
			{
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					int num2 = Information.UBound((Array)enumerator.Current);
					for (int j = 0; j <= num2; j++)
					{
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { j }, null), m_dblSeriesMaxY, TextCompare: false))
						{
							m_dblSeriesMaxY = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { j }, null));
						}
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { j }, null), m_dblSeriesMinY, TextCompare: false))
						{
							m_dblSeriesMinY = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { j }, null));
						}
						double[] dblSeriesRangeSumY = m_dblSeriesRangeSumY;
						int num3 = i;
						object left = dblSeriesRangeSumY[num3];
						Type typeFromHandle = typeof(Math);
						object[] array = new object[1];
						object[] array2 = array;
						object current = enumerator.Current;
						array2[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(current, new object[1] { j }, null));
						object[] array3 = array;
						bool[] array4 = new bool[1] { true };
						object right = NewLateBinding.LateGet(null, typeFromHandle, "Abs", array3, null, null, array4);
						if (array4[0])
						{
							NewLateBinding.LateIndexSetComplex(current, new object[2]
							{
								j,
								RuntimeHelpers.GetObjectValue(array3[0])
							}, null, OptimisticSet: true, RValueBase: true);
						}
						dblSeriesRangeSumY[num3] = Conversions.ToDouble(Operators.AddObject(left, right));
					}
				}
			}
			if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
			{
				m_dblSeriesMinY = m_YAxisScaleMinimum;
				m_dblSeriesMaxY = m_YAxisScaleMaximum;
			}
			m_dblSeriesRangeY = Math.Abs(m_dblSeriesMaxY - m_dblSeriesMinY);
			if (m_dblSeriesRangeY == 0.0)
			{
				m_dblSeriesRangeY = 1.0;
			}
			if (m_dblSeriesMaxY * m_dblSeriesMinY > 0.0)
			{
				m_dblSeriesMiddleY = 0.0;
			}
			else
			{
				m_dblSeriesMiddleY = Math.Abs(m_dblSeriesMinY);
			}
		}
	}

	[Description("Realiza cálculos de un array con valores multidimensionales que especifican coordenadas X e Y previos al dibujado de la gráfica, tales como máximos, mínimos, totales, etc.")]
	private void m_DoCalcMulti2d()
	{
		checked
		{
			try
			{
				m_arrSeriesAcum = new ArrayList[Information.UBound(m_arrSeries) + 1];
				if (!Versioned.IsNumeric(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null))))
				{
					return;
				}
				m_dblSeriesMaxX = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null));
				m_dblSeriesMinX = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null));
				m_dblSeriesMaxY = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 1 }, null));
				m_dblSeriesMinY = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 1 }, null));
				m_dblSeriesRangeSumX = new double[Information.UBound(m_arrSeries) + 1];
				m_dblSeriesRangeSumY = new double[Information.UBound(m_arrSeries) + 1];
				int num = Information.UBound(m_arrSeries);
				for (int i = 0; i <= num; i++)
				{
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMaxX, TextCompare: false))
						{
							m_dblSeriesMaxX = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null));
						}
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX, TextCompare: false))
						{
							m_dblSeriesMinX = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null));
						}
						double[] dblSeriesRangeSumX = m_dblSeriesRangeSumX;
						double[] array = dblSeriesRangeSumX;
						int num2 = i;
						int num3 = num2;
						object left = dblSeriesRangeSumX[num2];
						Type typeFromHandle = typeof(Math);
						object[] array2 = new object[1];
						object[] array3 = array2;
						object current = enumerator.Current;
						object instance = current;
						object[] array4 = new object[1];
						object[] array5 = array4;
						int num4 = 0;
						array5[0] = num4;
						array3[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, array4, null));
						object[] array6 = array2;
						object[] arguments = array6;
						bool[] array7 = new bool[1] { true };
						object right = NewLateBinding.LateGet(null, typeFromHandle, "Abs", arguments, null, null, array7);
						if (array7[0])
						{
							NewLateBinding.LateIndexSetComplex(current, new object[2]
							{
								num4,
								RuntimeHelpers.GetObjectValue(array6[0])
							}, null, OptimisticSet: true, RValueBase: true);
						}
						array[num3] = Conversions.ToDouble(Operators.AddObject(left, right));
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMaxY, TextCompare: false))
						{
							m_dblSeriesMaxY = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null));
						}
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY, TextCompare: false))
						{
							m_dblSeriesMinY = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null));
						}
						dblSeriesRangeSumX = m_dblSeriesRangeSumY;
						double[] array8 = dblSeriesRangeSumX;
						num4 = i;
						int num5 = num4;
						object left2 = dblSeriesRangeSumX[num4];
						Type typeFromHandle2 = typeof(Math);
						array6 = new object[1];
						object[] array9 = array6;
						current = enumerator.Current;
						object instance2 = current;
						object[] array10 = new object[1];
						object[] array11 = array10;
						num2 = 1;
						array11[0] = num2;
						array9[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance2, array10, null));
						array4 = array6;
						object[] arguments2 = array4;
						array7 = new bool[1] { true };
						object right2 = NewLateBinding.LateGet(null, typeFromHandle2, "Abs", arguments2, null, null, array7);
						if (array7[0])
						{
							NewLateBinding.LateIndexSetComplex(current, new object[2]
							{
								num2,
								RuntimeHelpers.GetObjectValue(array4[0])
							}, null, OptimisticSet: true, RValueBase: true);
						}
						array8[num5] = Conversions.ToDouble(Operators.AddObject(left2, right2));
					}
				}
				if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
				{
					m_dblSeriesMinY = m_YAxisScaleMinimum;
					m_dblSeriesMaxY = m_YAxisScaleMaximum;
				}
				else if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO)
				{
					m_dblSeriesMinY = 0.0;
					m_dblSeriesMaxY = m_dblSeriesMaxY;
				}
				if (m_XAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
				{
					m_dblSeriesMinX = m_XAxisScaleMinimumNumeric;
					m_dblSeriesMaxX = m_XAxisScaleMaximumNumeric;
				}
				else if (m_XAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO)
				{
					m_dblSeriesMinX = 0.0;
					m_dblSeriesMaxX = m_dblSeriesMaxX;
				}
				m_dblSeriesRangeX = Math.Abs(m_dblSeriesMaxX - m_dblSeriesMinX);
				if (m_dblSeriesRangeX == 0.0)
				{
					m_dblSeriesRangeX = 1.0;
				}
				if (m_dblSeriesMaxX * m_dblSeriesMinX > 0.0)
				{
					m_dblSeriesMiddleX = 0.0;
				}
				else
				{
					m_dblSeriesMiddleX = Math.Abs(m_dblSeriesMinX);
				}
				m_dblSeriesRangeY = Math.Abs(m_dblSeriesMaxY - m_dblSeriesMinY);
				if (m_dblSeriesRangeY == 0.0)
				{
					m_dblSeriesRangeY = 1.0;
				}
				if (m_dblSeriesMaxY * m_dblSeriesMinY > 0.0)
				{
					m_dblSeriesMiddleY = 0.0;
				}
				else
				{
					m_dblSeriesMiddleY = Math.Abs(m_dblSeriesMinY);
				}
				if (Information.UBound((Array)m_arrSeries[0][0]) < 2)
				{
					return;
				}
				m_dblSeriesMaxZ = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 2 }, null));
				m_dblSeriesMinZ = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 2 }, null));
				int num6 = Information.UBound(m_arrSeries);
				for (int i = 0; i <= num6; i++)
				{
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMaxZ, TextCompare: false))
						{
							m_dblSeriesMaxZ = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null));
						}
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinZ, TextCompare: false))
						{
							m_dblSeriesMinZ = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null));
						}
					}
				}
				m_dblSeriesRangeZ = Math.Abs(m_dblSeriesMaxZ - m_dblSeriesMinZ);
				if (m_dblSeriesRangeZ == 0.0)
				{
					m_dblSeriesRangeZ = 1.0;
				}
				if (m_dblSeriesMaxZ * m_dblSeriesMinZ > 0.0)
				{
					m_dblSeriesMiddleZ = 0.0;
				}
				else
				{
					m_dblSeriesMiddleZ = Math.Abs(m_dblSeriesMinZ);
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	[Description("Realiza cálculos de un array con valores multidimensionales que especifican coordenadas X e Y previos al dibujado de la gráfica, tales como máximos, mínimos, totales, etc.")]
	private void m_DoCalcMultiXYZ()
	{
		checked
		{
			try
			{
				m_arrSeriesAcum = new ArrayList[Information.UBound(m_arrSeries) + 1];
				if (!Versioned.IsNumeric(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null))))
				{
					return;
				}
				m_lngNumZ = m_arrSeries.Length;
				m_lngNumX = m_arrSeries[0].Count;
				m_dblSeriesMaxX = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null));
				m_dblSeriesMinX = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null));
				m_dblSeriesMaxY = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 1 }, null));
				m_dblSeriesMinY = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 1 }, null));
				m_dblSeriesMaxZ = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 2 }, null));
				m_dblSeriesMinZ = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 2 }, null));
				m_dblSeriesRangeSumX = new double[Information.UBound(m_arrSeries) + 1];
				m_dblSeriesRangeSumY = new double[Information.UBound(m_arrSeries) + 1];
				m_dblSeriesRangeSumZ = new double[Information.UBound(m_arrSeries) + 1];
				int num = Information.UBound(m_arrSeries);
				for (int i = 0; i <= num; i++)
				{
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMaxX, TextCompare: false))
						{
							m_dblSeriesMaxX = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null));
						}
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX, TextCompare: false))
						{
							m_dblSeriesMinX = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null));
						}
						double[] dblSeriesRangeSumX = m_dblSeriesRangeSumX;
						double[] array = dblSeriesRangeSumX;
						int num2 = i;
						array[num2] = dblSeriesRangeSumX[num2] + Math.Abs(Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)));
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMaxY, TextCompare: false))
						{
							m_dblSeriesMaxY = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null));
						}
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY, TextCompare: false))
						{
							m_dblSeriesMinY = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null));
						}
						dblSeriesRangeSumX = m_dblSeriesRangeSumZ;
						double[] array2 = dblSeriesRangeSumX;
						num2 = i;
						array2[num2] = dblSeriesRangeSumX[num2] + Math.Abs(Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)));
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMaxZ, TextCompare: false))
						{
							m_dblSeriesMaxZ = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null));
						}
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinZ, TextCompare: false))
						{
							m_dblSeriesMinZ = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null));
						}
						dblSeriesRangeSumX = m_dblSeriesRangeSumZ;
						double[] array3 = dblSeriesRangeSumX;
						num2 = i;
						array3[num2] = dblSeriesRangeSumX[num2] + Math.Abs(Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)));
					}
				}
				if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
				{
					m_dblSeriesMinY = m_YAxisScaleMinimum;
					m_dblSeriesMaxY = m_YAxisScaleMaximum;
				}
				else if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO)
				{
					m_dblSeriesMinY = 0.0;
					m_dblSeriesMaxY = m_dblSeriesMaxY;
				}
				if (m_XAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
				{
					m_dblSeriesMinX = m_XAxisScaleMinimumNumeric;
					m_dblSeriesMaxX = m_XAxisScaleMaximumNumeric;
				}
				else if (m_XAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO)
				{
					m_dblSeriesMinX = 0.0;
					m_dblSeriesMaxX = m_dblSeriesMaxX;
				}
				if (m_ZAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
				{
					m_dblSeriesMinZ = m_ZAxisScaleMinimumNumeric;
					m_dblSeriesMaxZ = m_ZAxisScaleMaximumNumeric;
				}
				else if (m_ZAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO)
				{
					m_dblSeriesMinZ = 0.0;
					m_dblSeriesMaxZ = m_dblSeriesMaxZ;
				}
				m_dblSeriesRangeX = Math.Abs(m_dblSeriesMaxX - m_dblSeriesMinX);
				if (m_dblSeriesRangeX == 0.0)
				{
					m_dblSeriesRangeX = 1.0;
				}
				if (m_dblSeriesMaxX * m_dblSeriesMinX > 0.0)
				{
					m_dblSeriesMiddleX = 0.0;
				}
				else
				{
					m_dblSeriesMiddleX = Math.Abs(m_dblSeriesMinX);
				}
				m_dblSeriesRangeY = Math.Abs(m_dblSeriesMaxY - m_dblSeriesMinY);
				if (m_dblSeriesRangeY == 0.0)
				{
					m_dblSeriesRangeY = 1.0;
				}
				if (m_dblSeriesMaxY * m_dblSeriesMinY > 0.0)
				{
					m_dblSeriesMiddleY = 0.0;
				}
				else
				{
					m_dblSeriesMiddleY = Math.Abs(m_dblSeriesMinY);
				}
				m_dblSeriesRangeZ = Math.Abs(m_dblSeriesMaxZ - m_dblSeriesMinZ);
				if (m_dblSeriesRangeZ == 0.0)
				{
					m_dblSeriesRangeZ = 1.0;
				}
				if (m_dblSeriesMaxZ * m_dblSeriesMinZ > 0.0)
				{
					m_dblSeriesMiddleZ = 0.0;
				}
				else
				{
					m_dblSeriesMiddleZ = Math.Abs(m_dblSeriesMinZ);
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	[Description("Realiza cálculos de un array con valores multidimensionales que especifican coordenadas X e Y previos al dibujado de la gráfica, tales como máximos, mínimos, totales, etc.")]
	private void m_DoCalcMulti2dDateTime()
	{
		checked
		{
			try
			{
				if (!Information.IsDate(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null))))
				{
					return;
				}
				DateTime dateTime = Conversions.ToDate(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null));
				DateTime dateTime2 = dateTime;
				m_dblSeriesMaxY = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 1 }, null));
				m_dblSeriesMinY = m_dblSeriesMaxY;
				m_dblSeriesRangeSumY = new double[Information.UBound(m_arrSeries) + 1];
				int num = Information.UBound(m_arrSeries);
				for (int i = 0; i <= num; i++)
				{
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), dateTime, TextCompare: false))
						{
							dateTime = Conversions.ToDate(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null));
						}
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), dateTime2, TextCompare: false))
						{
							dateTime2 = Conversions.ToDate(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null));
						}
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMaxY, TextCompare: false))
						{
							m_dblSeriesMaxY = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null));
						}
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY, TextCompare: false))
						{
							m_dblSeriesMinY = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null));
						}
						double[] dblSeriesRangeSumY = m_dblSeriesRangeSumY;
						int num2 = i;
						object left = dblSeriesRangeSumY[num2];
						Type typeFromHandle = typeof(Math);
						object[] array = new object[1];
						object[] array2 = array;
						object current = enumerator.Current;
						object[] array3 = new object[1];
						object[] array4 = array3;
						int num3 = 1;
						array4[0] = num3;
						array2[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(current, array3, null));
						object[] array5 = array;
						bool[] array6 = new bool[1] { true };
						object right = NewLateBinding.LateGet(null, typeFromHandle, "Abs", array5, null, null, array6);
						if (array6[0])
						{
							NewLateBinding.LateIndexSetComplex(current, new object[2]
							{
								num3,
								RuntimeHelpers.GetObjectValue(array5[0])
							}, null, OptimisticSet: true, RValueBase: true);
						}
						dblSeriesRangeSumY[num2] = Conversions.ToDouble(Operators.AddObject(left, right));
					}
				}
				if ((m_XAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC) | (m_XAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO))
				{
					m_XAxisMinDateTime = dateTime;
					m_XAxisMaxDateTime = dateTime2;
				}
				else
				{
					m_XAxisMinDateTime = m_XAxisScaleMinimumDateTime;
					m_XAxisMaxDateTime = m_XAxisScaleMaximumDateTime;
				}
				if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
				{
					m_dblSeriesMinY = m_YAxisScaleMinimum;
					m_dblSeriesMaxY = m_YAxisScaleMaximum;
				}
				m_dblSeriesRangeY = Math.Abs(m_dblSeriesMaxY - m_dblSeriesMinY);
				if (m_dblSeriesRangeY == 0.0)
				{
					m_dblSeriesRangeY = 1.0;
				}
				if (m_dblSeriesMaxY * m_dblSeriesMinY > 0.0)
				{
					m_dblSeriesMiddleY = 0.0;
				}
				else
				{
					m_dblSeriesMiddleY = Math.Abs(m_dblSeriesMinY);
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				Application.DoEvents();
				ProjectData.ClearProjectError();
			}
		}
	}

	private void m_DoCalcGantt()
	{
		checked
		{
			m_arrSeriesAcum = new ArrayList[Information.UBound(m_arrSeries) + 1];
			try
			{
				DateTime dateTime = Conversions.ToDate(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 0 }, null));
				DateTime dateTime2 = Conversions.ToDate(NewLateBinding.LateIndexGet(m_arrSeries[0][0], new object[1] { 1 }, null));
				int num = Information.UBound(m_arrSeries);
				for (int i = 0; i <= num; i++)
				{
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), dateTime, TextCompare: false))
						{
							dateTime = Conversions.ToDate(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null));
						}
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { Information.UBound((Array)enumerator.Current) - 1 }, null), dateTime2, TextCompare: false))
						{
							dateTime2 = Conversions.ToDate(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { Information.UBound((Array)enumerator.Current) - 1 }, null));
						}
					}
				}
				if ((m_XAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC) | (m_XAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO))
				{
					m_XAxisMinDateTime = dateTime;
					m_XAxisMaxDateTime = dateTime2;
				}
				else
				{
					m_XAxisMinDateTime = m_XAxisScaleMinimumDateTime;
					m_XAxisMaxDateTime = m_XAxisScaleMaximumDateTime;
				}
				if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
				{
					m_dblSeriesMinY = m_YAxisScaleMinimum;
					m_dblSeriesMaxY = m_YAxisScaleMaximum;
				}
			}
			catch (Exception projectError)
			{
				ProjectData.SetProjectError(projectError);
				ProjectData.ClearProjectError();
			}
		}
	}

	[Description("Realiza cálculos previos al dibujado de la gráfica, tales como máximos, mínimos, totales, etc.")]
	private void m_DoCalc()
	{
		if (!Information.IsArray(m_arrSeries))
		{
			return;
		}
		m_lngNumX = m_arrSeries[0].Count;
		long num = 1L;
		long num2 = Information.UBound(m_arrSeries);
		checked
		{
			for (long num3 = num; num3 <= num2; num3++)
			{
				if (m_arrSeries[(int)num3].Count > m_lngNumX)
				{
					m_lngNumX = m_arrSeries[(int)num3].Count;
				}
			}
			if (m_lngNumX == 0)
			{
				return;
			}
			if (m_lngStyle == STYLE2D3D.STYLE2D_GAUGE)
			{
				m_DoCalcGauge();
				return;
			}
			if (Information.IsArray(RuntimeHelpers.GetObjectValue(m_arrSeries[0][0])))
			{
				if ((m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME) | Information.IsDate(RuntimeHelpers.GetObjectValue(m_arrSeries[0][0])))
				{
					m_DoCalcMulti2dDateTime();
				}
				else if (m_lngStyle == STYLE2D3D.STYLE2D_GANTT)
				{
					m_DoCalcGantt();
				}
				else if ((m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE_DEV) | (m_lngStyle == STYLE2D3D.STYLE2D_BUBBLE))
				{
					m_DoCalcMulti2d();
				}
				else if (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER)
				{
					m_DoCalcMultiXYZ();
				}
				else
				{
					m_DoCalcMulti();
				}
				return;
			}
			m_dblSeriesMaxY = Conversions.ToDouble(m_arrSeries[0][0]);
			m_dblSeriesMinY = Conversions.ToDouble(m_arrSeries[0][0]);
			m_dblSeriesRangeSumY = new double[Information.UBound(m_arrSeries) + 1];
			long num4 = 0L;
			long num5 = Information.UBound(m_arrSeries);
			for (long num3 = num4; num3 <= num5; num3++)
			{
				IEnumerator enumerator = m_arrSeries[(int)num3].GetEnumerator();
				while (enumerator.MoveNext())
				{
					double num6 = Conversions.ToDouble(enumerator.Current);
					switch (m_YAxisScaleMode)
					{
					case SCALEMODE.SCALEMODE_FIXED:
						if (num6 < (double)m_YAxisScaleMinimum)
						{
							num6 = m_YAxisScaleMinimum;
						}
						else if (num6 > (double)m_YAxisScaleMinimum)
						{
							num6 -= (double)m_YAxisScaleMinimum;
						}
						if (num6 > (double)m_YAxisScaleMaximum)
						{
							num6 = m_YAxisScaleMaximum;
						}
						break;
					case SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO:
						if (num6 > (double)m_YAxisScaleMaximum)
						{
							num6 = m_YAxisScaleMaximum;
						}
						break;
					}
					if (num6 > m_dblSeriesMaxY)
					{
						m_dblSeriesMaxY = num6;
					}
					if (num6 < m_dblSeriesMinY)
					{
						m_dblSeriesMinY = num6;
					}
					double[] dblSeriesRangeSumY = m_dblSeriesRangeSumY;
					double[] array = dblSeriesRangeSumY;
					int num7 = (int)num3;
					array[num7] = dblSeriesRangeSumY[num7] + Math.Abs(num6);
				}
			}
			if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
			{
				m_dblSeriesMinY = m_YAxisScaleMinimum;
				m_dblSeriesMaxY = m_YAxisScaleMaximum;
			}
			else if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO)
			{
				m_dblSeriesMinY = 0.0;
				m_dblSeriesMaxY = m_dblSeriesMaxY;
			}
			m_dblSeriesRangeY = Math.Abs(m_dblSeriesMaxY - m_dblSeriesMinY);
			if (m_dblSeriesRangeY == 0.0)
			{
				m_dblSeriesRangeY = 1.0;
			}
			if (m_dblSeriesMaxY * m_dblSeriesMinY > 0.0)
			{
				m_dblSeriesMiddleY = 0.0;
			}
			else
			{
				m_dblSeriesMiddleY = Math.Abs(m_dblSeriesMinY);
			}
			m_arrSeriesSum = new double[(int)(m_lngNumX - 1) + 1];
			long num8 = 0L;
			long num9 = Information.UBound(m_arrSeries);
			for (long num3 = num8; num3 <= num9; num3++)
			{
				long num10 = 0L;
				IEnumerator enumerator = m_arrSeries[(int)num3].GetEnumerator();
				while (enumerator.MoveNext())
				{
					if (num10 > Information.UBound(m_arrSeriesSum))
					{
						m_arrSeriesSum = (double[])Utils.CopyArray(m_arrSeriesSum, new double[(int)num10 + 1]);
						m_lngNumX = num10;
					}
					if (num3 == 0)
					{
						m_arrSeriesSum[(int)num10] = Conversions.ToDouble(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null));
					}
					else
					{
						double[] dblSeriesRangeSumY = m_arrSeriesSum;
						double[] array2 = dblSeriesRangeSumY;
						int num7 = (int)num10;
						array2[num7] = Conversions.ToDouble(Operators.AddObject(dblSeriesRangeSumY[num7], NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null)));
					}
					num10++;
				}
			}
			m_dblSeriesMaxYAcum = Conversions.ToDouble(m_arrSeries[0][0]);
			m_dblSeriesMinYAcum = Conversions.ToDouble(m_arrSeries[0][0]);
			double[] array3 = new double[(int)(m_lngNumX - 1) + 1];
			m_arrSeriesAcum = new ArrayList[Information.UBound(m_arrSeries) + 1];
			long num11 = 0L;
			long num12 = Information.UBound(m_arrSeries);
			for (long num3 = num11; num3 <= num12; num3++)
			{
				long num10 = 0L;
				IEnumerator enumerator = m_arrSeries[(int)num3].GetEnumerator();
				m_arrSeriesAcum[(int)num3] = new ArrayList();
				while (enumerator.MoveNext())
				{
					if (num10 > Information.UBound(array3))
					{
						array3 = (double[])Utils.CopyArray(array3, new double[(int)num10 + 1]);
					}
					if (num3 == 0)
					{
						array3[(int)num10] = Conversions.ToDouble(enumerator.Current);
					}
					else
					{
						double[] dblSeriesRangeSumY = array3;
						double[] array4 = dblSeriesRangeSumY;
						int num7 = (int)num10;
						array4[num7] = Conversions.ToDouble(Operators.AddObject(dblSeriesRangeSumY[num7], enumerator.Current));
					}
					m_arrSeriesAcum[(int)num3].Add(array3[(int)num10]);
					if (array3[(int)num10] < m_dblSeriesMinYAcum)
					{
						m_dblSeriesMinYAcum = array3[(int)num10];
					}
					if (array3[(int)num10] > m_dblSeriesMaxYAcum)
					{
						m_dblSeriesMaxYAcum = array3[(int)num10];
					}
					num10++;
				}
			}
			if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_FIXED)
			{
				m_dblSeriesMinYAcum = m_YAxisScaleMinimum;
				m_dblSeriesMaxYAcum = m_YAxisScaleMaximum;
			}
			else if (m_YAxisScaleMode == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO)
			{
				m_dblSeriesMinYAcum = 0.0;
				m_dblSeriesMaxYAcum = m_dblSeriesMaxYAcum;
			}
			m_dblSeriesRangeYAcum = Math.Abs(m_dblSeriesMaxYAcum - m_dblSeriesMinYAcum);
			if (m_dblSeriesRangeYAcum == 0.0)
			{
				m_dblSeriesRangeYAcum = 1.0;
			}
			if (m_dblSeriesMaxYAcum * m_dblSeriesMinYAcum > 0.0)
			{
				m_dblSeriesMiddleYAcum = 0.0;
			}
			else
			{
				m_dblSeriesMiddleYAcum = Math.Abs(m_dblSeriesMinYAcum);
			}
			m_DoCalcAdditional();
		}
	}

	private void m_DoCalcGauge()
	{
		int num = Information.UBound(m_arrSeries);
		checked
		{
			m_arrSeriesAcum = new ArrayList[num + 1];
			m_GaugesMax = new float[num + 1];
			m_GaugesMin = new float[num + 1];
			m_GaugesRange = new float[num + 1];
			try
			{
				if (m_GaugesScaleMode == null)
				{
					m_GaugesScaleMode = new SCALEMODE[1];
					m_GaugesScaleMode[0] = m_YAxisScaleMode;
				}
				if (Information.UBound(m_GaugesScaleMode) < num)
				{
					m_GaugesScaleMode = new SCALEMODE[num + 1];
					long num2 = 0L;
					long num3 = num;
					for (long num4 = num2; num4 <= num3; num4++)
					{
						m_GaugesScaleMode[(int)num4] = m_YAxisScaleMode;
					}
				}
				if (m_GaugesScaleMinimum == null)
				{
					m_GaugesScaleMinimum = new float[1];
					m_GaugesScaleMinimum[0] = m_YAxisScaleMinimum;
				}
				if (Information.UBound(m_GaugesScaleMinimum) < num)
				{
					m_GaugesScaleMinimum = (float[])Utils.CopyArray(m_GaugesScaleMinimum, new float[num + 1]);
					long num5 = 0L;
					long num6 = num;
					for (long num4 = num5; num4 <= num6; num4++)
					{
						m_GaugesScaleMinimum[(int)num4] = m_YAxisScaleMinimum;
					}
				}
				if (m_GaugesScaleMaximum == null)
				{
					m_GaugesScaleMaximum = new float[1];
					m_GaugesScaleMaximum[0] = m_YAxisScaleMaximum;
				}
				if (Information.UBound(m_GaugesScaleMaximum) < num)
				{
					m_GaugesScaleMaximum = new float[num + 1];
					long num7 = 0L;
					long num8 = num;
					for (long num4 = num7; num4 <= num8; num4++)
					{
						m_GaugesScaleMaximum[(int)num4] = m_YAxisScaleMaximum;
					}
				}
				if (m_GaugesDividersCount == null)
				{
					m_GaugesDividersCount = new int[1];
					m_GaugesDividersCount[0] = (int)m_lngNumDividersY;
				}
				if (Information.UBound(m_GaugesDividersCount) < num)
				{
					m_GaugesDividersCount = new int[num + 1];
					long num9 = 0L;
					long num10 = num;
					for (long num4 = num9; num4 <= num10; num4++)
					{
						m_GaugesDividersCount[(int)num4] = (int)m_lngNumDividersY;
					}
				}
				if (m_GaugesNumericFormat == null)
				{
					m_GaugesNumericFormat = new string[1];
					m_GaugesNumericFormat[0] = YAxisNumericFormat;
				}
				if (Information.UBound(m_GaugesNumericFormat) < num)
				{
					m_GaugesNumericFormat = new string[num + 1];
					long num11 = 0L;
					long num12 = num;
					for (long num4 = num11; num4 <= num12; num4++)
					{
						m_GaugesNumericFormat[(int)num4] = YAxisNumericFormat;
					}
				}
				long num13 = 0L;
				long num14 = num;
				for (long num4 = num13; num4 <= num14; num4++)
				{
					m_GaugesMax[(int)num4] = Conversions.ToSingle(m_arrSeries[(int)num4][0]);
					m_GaugesMin[(int)num4] = Conversions.ToSingle(m_arrSeries[(int)num4][0]);
					IEnumerator enumerator = m_arrSeries[(int)num4].GetEnumerator();
					while (enumerator.MoveNext())
					{
						double num15 = Conversions.ToDouble(enumerator.Current);
						switch (m_GaugesScaleMode[(int)num4])
						{
						case SCALEMODE.SCALEMODE_FIXED:
							if (num15 < (double)m_GaugesMin[(int)num4])
							{
								num15 = m_GaugesMin[(int)num4];
							}
							else if (num15 > (double)m_GaugesMin[(int)num4])
							{
								num15 -= (double)m_GaugesMin[(int)num4];
							}
							if (num15 > (double)m_GaugesMax[(int)num4])
							{
								num15 = m_GaugesMax[(int)num4];
							}
							break;
						case SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO:
							if (num15 > (double)m_GaugesMax[(int)num4])
							{
								num15 = m_GaugesMax[(int)num4];
							}
							break;
						}
						if (num15 > (double)m_GaugesMax[(int)num4])
						{
							m_GaugesMax[(int)num4] = (float)num15;
						}
						if (num15 < (double)m_GaugesMin[(int)num4])
						{
							m_GaugesMin[(int)num4] = (float)num15;
						}
					}
					if (m_GaugesScaleMode[(int)num4] == SCALEMODE.SCALEMODE_FIXED)
					{
						m_GaugesMin[(int)num4] = m_GaugesScaleMinimum[(int)num4];
						m_GaugesMax[(int)num4] = m_GaugesScaleMaximum[(int)num4];
					}
					else if (m_GaugesScaleMode[(int)num4] == SCALEMODE.SCALEMODE_AUTOMATIC_MIN_ZERO)
					{
						m_GaugesMin[(int)num4] = 0f;
						m_GaugesMax[(int)num4] = m_GaugesMax[(int)num4];
					}
					m_GaugesRange[(int)num4] = Math.Abs(m_GaugesMax[(int)num4] - m_GaugesMin[(int)num4]);
					if (m_GaugesRange[(int)num4] == 0f)
					{
						m_GaugesRange[(int)num4] = 1f;
					}
					m_dblSeriesRangeY = m_GaugesRange[(int)num4];
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	private void m_DoCalcAdditional()
	{
		if (!Information.IsArray(m_arrSeries))
		{
			return;
		}
		int count = m_arrSeries[0].Count;
		int num = m_arrSeries.Length;
		checked
		{
			m_arrCalculation = new double[count - 1 + 1];
			double[] array = new double[count - 1 + 1];
			switch (m_CalculationStyle)
			{
			case CALCULATION.CALCULATION_TOP_LINE:
			case CALCULATION.CALCULATION_TOP_SPLINE:
			{
				int num8 = count;
				for (int i = 1; i <= num8; i++)
				{
					double num9 = double.MinValue;
					if (Information.IsArray(RuntimeHelpers.GetObjectValue(m_arrSeries[0][i - 1])))
					{
						int num10 = num;
						for (int j = 1; j <= num10; j++)
						{
							if (NewLateBinding.LateIndexGet(m_arrSeries[j - 1][i - 1], new object[1] { Information.UBound((Array)m_arrSeries[j - 1][i - 1]) }, null) != null)
							{
								object left = j == 1;
								object left2 = Math.Abs(num9);
								Type typeFromHandle = typeof(Math);
								object[] array2 = new object[1];
								object instance = m_arrSeries[j - 1][i - 1];
								object[] array3 = new object[1];
								int num11 = Information.UBound((Array)m_arrSeries[j - 1][i - 1]);
								array3[0] = num11;
								array2[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, array3, null));
								object[] array4 = array2;
								bool[] array5 = new bool[1] { true };
								object right = NewLateBinding.LateGet(null, typeFromHandle, "Abs", array4, null, null, array5);
								if (array5[0])
								{
									NewLateBinding.LateIndexSetComplex(instance, new object[2]
									{
										num11,
										RuntimeHelpers.GetObjectValue(array4[0])
									}, null, OptimisticSet: true, RValueBase: true);
								}
								if (Conversions.ToBoolean(Operators.OrObject(left, Operators.CompareObjectLess(left2, right, TextCompare: false))))
								{
									num9 = Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[j - 1][i - 1], new object[1] { Information.UBound((Array)m_arrSeries[j - 1][i - 1]) }, null));
								}
							}
						}
					}
					else
					{
						int num12 = num;
						for (int j = 1; j <= num12; j++)
						{
							if (m_arrSeries[j - 1][i - 1] != null)
							{
								object left3 = j == 1;
								object left4 = num9;
								Type typeFromHandle2 = typeof(Math);
								object[] array6 = new object[1];
								object[] array7 = array6;
								ArrayList[] arrSeries = m_arrSeries;
								int num11 = j - 1;
								ArrayList obj = arrSeries[num11];
								int index = i - 1;
								array7[0] = RuntimeHelpers.GetObjectValue(obj[index]);
								object[] array8 = array6;
								object[] arguments = array8;
								bool[] array5 = new bool[1] { true };
								object right2 = NewLateBinding.LateGet(null, typeFromHandle2, "Abs", arguments, null, null, array5);
								if (array5[0])
								{
									arrSeries[num11][index] = RuntimeHelpers.GetObjectValue(array8[0]);
								}
								if (Conversions.ToBoolean(Operators.OrObject(left3, Operators.CompareObjectLess(left4, right2, TextCompare: false))))
								{
									num9 = Conversions.ToDouble(m_arrSeries[j - 1][i - 1]);
								}
							}
						}
					}
					array[i - 1] = num9;
				}
				int num13 = count;
				for (int i = 1; i <= num13; i++)
				{
					m_arrCalculation[i - 1] = array[i - 1];
				}
				break;
			}
			case CALCULATION.CALCULATION_AVERAGE:
			case CALCULATION.CALCULATION_AVERAGE_SPLINE:
			{
				int num14 = count;
				for (int i = 1; i <= num14; i++)
				{
					double num4 = double.MinValue;
					if (Information.IsArray(RuntimeHelpers.GetObjectValue(m_arrSeries[0][i - 1])))
					{
						int num15 = num;
						for (int j = 1; j <= num15; j++)
						{
							if (m_arrSeries[j - 1].Count >= j && NewLateBinding.LateIndexGet(m_arrSeries[j - 1][i - 1], new object[1] { Information.UBound((Array)m_arrSeries[j - 1][i - 1]) }, null) != null)
							{
								if (num4 == double.MinValue)
								{
									num4 = 0.0;
								}
								num4 = Conversions.ToDouble(Operators.AddObject(num4, NewLateBinding.LateIndexGet(m_arrSeries[j - 1][i - 1], new object[1] { Information.UBound((Array)m_arrSeries[j - 1][i - 1]) }, null)));
							}
						}
					}
					else
					{
						int num16 = num;
						for (int j = 1; j <= num16; j++)
						{
							if (m_arrSeries[j - 1][i - 1] != null)
							{
								if (num4 == double.MinValue)
								{
									num4 = 0.0;
								}
								num4 = Conversions.ToDouble(Operators.AddObject(num4, m_arrSeries[j - 1][i - 1]));
							}
						}
					}
					if (num4 == double.MinValue)
					{
						array[i - 1] = double.MinValue;
					}
					else
					{
						array[i - 1] = num4 / (double)num;
					}
				}
				m_arrCalculation[0] = array[0];
				m_arrCalculation[count - 1] = array[count - 1];
				int num17 = count - 1;
				for (int i = 2; i <= num17; i++)
				{
					int j = 0;
					m_arrCalculation[i - 1] = 0.0;
					if (array[i - 2] > double.MinValue)
					{
						double[] arrCalculation = m_arrCalculation;
						double[] array9 = arrCalculation;
						int index = i - 1;
						array9[index] = arrCalculation[index] + array[i - 2];
						j++;
						if (array[i - 1] > double.MinValue)
						{
							arrCalculation = m_arrCalculation;
							double[] array10 = arrCalculation;
							index = i - 1;
							array10[index] = arrCalculation[index] + array[i - 1];
							j++;
							if (array[i] > double.MinValue)
							{
								arrCalculation = m_arrCalculation;
								double[] array11 = arrCalculation;
								index = i - 1;
								array11[index] = arrCalculation[index] + array[i];
								j++;
							}
						}
					}
					if (j > 0)
					{
						double[] arrCalculation = m_arrCalculation;
						double[] array12 = arrCalculation;
						int index = i - 1;
						array12[index] = arrCalculation[index] / (double)j;
					}
					else
					{
						m_arrCalculation[i - 1] = double.MinValue;
					}
				}
				break;
			}
			case CALCULATION.CALCULATION_PARETO:
			{
				double num2 = 0.0;
				int num3 = count;
				for (int i = 1; i <= num3; i++)
				{
					double num4 = double.MinValue;
					if (Information.IsArray(RuntimeHelpers.GetObjectValue(m_arrSeries[0][i - 1])))
					{
						int num5 = num;
						for (int j = 1; j <= num5; j++)
						{
							if (NewLateBinding.LateIndexGet(m_arrSeries[j - 1][i - 1], new object[1] { Information.UBound((Array)m_arrSeries[j - 1][i - 1]) }, null) != null)
							{
								if (num4 == double.MinValue)
								{
									num4 = 0.0;
								}
								num4 = Conversions.ToDouble(Operators.AddObject(num4, NewLateBinding.LateIndexGet(m_arrSeries[j - 1][i - 1], new object[1] { Information.UBound((Array)m_arrSeries[j - 1][i - 1]) }, null)));
							}
						}
					}
					else
					{
						int num6 = num;
						for (int j = 1; j <= num6; j++)
						{
							if (m_arrSeries[j - 1][i - 1] != null)
							{
								if (num4 == double.MinValue)
								{
									num4 = 0.0;
								}
								num4 = Conversions.ToDouble(Operators.AddObject(num4, m_arrSeries[j - 1][i - 1]));
							}
						}
					}
					if (num4 > double.MinValue)
					{
						num4 /= (double)num;
						num2 += num4;
						array[i - 1] = num2;
					}
					else
					{
						array[i - 1] = double.MinValue;
					}
				}
				int num7 = count;
				for (int i = 1; i <= num7; i++)
				{
					if (array[i - 1] > double.MinValue)
					{
						m_arrCalculation[i - 1] = m_dblSeriesMinY + m_dblSeriesRangeY * array[i - 1] / num2;
					}
					else
					{
						m_arrCalculation[i - 1] = array[i - 1];
					}
				}
				break;
			}
			case (CALCULATION)12:
			case (CALCULATION)13:
			case (CALCULATION)14:
			case (CALCULATION)15:
			case (CALCULATION)16:
			case (CALCULATION)17:
			case (CALCULATION)18:
			case (CALCULATION)19:
			case (CALCULATION)21:
			case (CALCULATION)22:
			case (CALCULATION)23:
			case (CALCULATION)24:
			case (CALCULATION)25:
			case (CALCULATION)26:
			case (CALCULATION)27:
			case (CALCULATION)28:
			case (CALCULATION)29:
				break;
			}
		}
	}

	public void RefreshChart()
	{
		m_blnCompositing = false;
		int count = m_Charts.Count;
		for (int i = 1; i <= count; i = checked(i + 1))
		{
			NewLateBinding.LateSetComplex(m_Charts[i], null, "YAxisCurrentWidth", new object[2]
			{
				STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT,
				0
			}, null, null, OptimisticSet: false, RValueBase: true);
			if (i > 1)
			{
				NewLateBinding.LateSetComplex(m_Charts[i], null, "MarginLeft", new object[1] { RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(m_Charts[1], null, "MarginLeft", new object[0], null, null, null)) }, null, null, OptimisticSet: false, RValueBase: true);
				NewLateBinding.LateSetComplex(m_Charts[i], null, "MarginRight", new object[1] { RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(m_Charts[1], null, "MarginRight", new object[0], null, null, null)) }, null, null, OptimisticSet: false, RValueBase: true);
				NewLateBinding.LateSetComplex(m_Charts[i], null, "MarginTop", new object[1] { RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(m_Charts[1], null, "MarginTop", new object[0], null, null, null)) }, null, null, OptimisticSet: false, RValueBase: true);
				NewLateBinding.LateSetComplex(m_Charts[i], null, "MarginBottom", new object[1] { RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(m_Charts[1], null, "MarginBottom", new object[0], null, null, null)) }, null, null, OptimisticSet: false, RValueBase: true);
				NewLateBinding.LateSetComplex(m_Charts[i], null, "LegendAlignment", new object[1] { RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(m_Charts[1], null, "LegendAlignment", new object[0], null, null, null)) }, null, null, OptimisticSet: false, RValueBase: true);
				NewLateBinding.LateSetComplex(m_Charts[i], null, "Width", new object[1] { RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(m_Charts[1], null, "Width", new object[0], null, null, null)) }, null, null, OptimisticSet: false, RValueBase: true);
				NewLateBinding.LateSetComplex(m_Charts[i], null, "height", new object[1] { RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(m_Charts[1], null, "height", new object[0], null, null, null)) }, null, null, OptimisticSet: false, RValueBase: true);
				NewLateBinding.LateSetComplex(m_Charts[i], null, "Resolution", new object[1] { RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(m_Charts[1], null, "Resolution", new object[0], null, null, null)) }, null, null, OptimisticSet: false, RValueBase: true);
			}
		}
		ValidateZoomScaleParameters();
		m_RefreshGraph(blnForce: true);
	}

	private void m_DrawBackground()
	{
		Rectangle rectangle = checked(new Rectangle(0, 0, Width - 1, Height - 1));
		if (!((rectangle.Width > 0) & (rectangle.Height > 0)))
		{
			return;
		}
		switch (m_BackStyle)
		{
		case STYLEBACKGROUND.STYLEBACKGROUND_IMAGE:
			if (m_BackgroundImage != null)
			{
				_g.g.DrawImage(m_BackgroundImage, rectangle);
			}
			break;
		case STYLEBACKGROUND.STYLEBACKGROUND_SOLID:
			_g.Clear(Color.White);
			_g.FillRectangle(new SolidBrush(m_BackColor), rectangle);
			break;
		case STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT:
		{
			Color color2 = ControlPaint.Dark(m_BackColor, 0.01f);
			Color color = ControlPaint.Light(m_BackColor, 0.01f);
			color2 = Color.FromArgb(255, color2.R, color2.G, color2.B);
			color = Color.FromArgb(255, color.R, color.G, color.B);
			_g.FillRectangle(new LinearGradientBrush(rectangle, color2, color, LinearGradientMode.Vertical), rectangle);
			break;
		}
		case STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_INVERTED:
		{
			Color color = ControlPaint.Dark(m_BackColor, 0.01f);
			Color color2 = ControlPaint.Light(m_BackColor, 0.01f);
			color2 = Color.FromArgb(255, color2.R, color2.G, color2.B);
			color = Color.FromArgb(255, color.R, color.G, color.B);
			_g.FillRectangle(new LinearGradientBrush(rectangle, color2, color, LinearGradientMode.Vertical), rectangle);
			break;
		}
		case STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_TUBULAR:
		{
			Color color = ControlPaint.Dark(m_BackColor, 0.01f);
			Color color2 = ControlPaint.Light(m_BackColor, 0.01f);
			color2 = Color.FromArgb(255, color2.R, color2.G, color2.B);
			color = Color.FromArgb(255, color.R, color.G, color.B);
			LinearGradientBrush linearGradientBrush2 = new LinearGradientBrush(rectangle, color2, color, LinearGradientMode.Vertical);
			linearGradientBrush2.SetSigmaBellShape(0.5f);
			_g.FillRectangle(linearGradientBrush2, rectangle);
			break;
		}
		case STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_TUBULAR_INVERTED:
		{
			Color color = ControlPaint.Dark(m_BackColor, 0.01f);
			Color color2 = ControlPaint.Light(m_BackColor, 0.01f);
			color2 = Color.FromArgb(255, color2.R, color2.G, color2.B);
			color = Color.FromArgb(255, color.R, color.G, color.B);
			LinearGradientBrush linearGradientBrush = new LinearGradientBrush(rectangle, color, color2, LinearGradientMode.Vertical);
			linearGradientBrush.SetSigmaBellShape(0.5f);
			_g.FillRectangle(linearGradientBrush, rectangle);
			break;
		}
		case STYLEBACKGROUND.STYLEBACKGROUND_TRANSPARENT:
			Visible = false;
			Visible = true;
			break;
		}
	}

	private void m_DrawFrontLayer()
	{
		if (m_FrontLayerShow)
		{
			Rectangle r = checked(new Rectangle(0, 0, Width - 1, Height - 1));
			_g.FillRectangle(new SolidBrush(m_FrontLayerColor), r);
		}
	}

	private void m_DrawCalculationAverageHorizontal(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round((double)r.Left + m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Width);
			float num3 = default(float);
			float num4 = default(float);
			if (m_lngStyle == STYLE2D3D.STYLE2D_HORIZONTAL_BAR)
			{
				num3 = (float)((double)r.Height / (double)m_lngNumX);
				num4 = (float)r.Top + num3 / 2f;
			}
			long num5 = -1L;
			int num6 = Information.UBound(m_arrCalculation);
			for (int i = 0; i <= num6; i++)
			{
				try
				{
					if (m_arrCalculation[i] > double.MinValue)
					{
						long num7 = (long)Math.Round((m_arrCalculation[i] - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Width - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Width);
						if (num5 != -1)
						{
							_g.DrawLine(m_CalculationLineStyle, num2 + num5, num4 - num3, num2 + num7, num4);
						}
						num5 = num7;
					}
					num4 += num3;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					ProjectData.ClearProjectError();
				}
			}
		}
	}

	private void m_DrawCalculationAverageSplineHorizontal(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round((double)r.Left + m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Width);
			float num3 = default(float);
			float num4 = default(float);
			if (m_lngStyle == STYLE2D3D.STYLE2D_HORIZONTAL_BAR)
			{
				num3 = (float)((double)r.Height / (double)m_lngNumX);
				num4 = (float)r.Top + num3 / 2f;
			}
			long num5 = -1L;
			Point[] array = new Point[Information.UBound(m_arrCalculation) + 1];
			int num6 = Information.UBound(m_arrCalculation);
			for (int i = 0; i <= num6; i++)
			{
				try
				{
					if (m_arrCalculation[i] > double.MinValue)
					{
						long num7 = (long)Math.Round((m_arrCalculation[i] - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Width - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Width);
						ref Point reference = ref array[i];
						reference = new Point((int)(num2 + num7), (int)Math.Round(num4));
					}
					num4 += num3;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					ProjectData.ClearProjectError();
				}
			}
			_g.DrawCurve(m_CalculationLineStyle, array);
		}
	}

	private void m_DrawCalculationHorizontal(Rectangle r)
	{
		switch (m_CalculationStyle)
		{
		case CALCULATION.CALCULATION_AVERAGE:
		case CALCULATION.CALCULATION_PARETO:
		case CALCULATION.CALCULATION_TOP_LINE:
			m_DrawCalculationAverageHorizontal(r);
			break;
		case CALCULATION.CALCULATION_AVERAGE_SPLINE:
		case CALCULATION.CALCULATION_TOP_SPLINE:
			m_DrawCalculationAverageSplineHorizontal(r);
			break;
		case (CALCULATION)12:
		case (CALCULATION)13:
		case (CALCULATION)14:
		case (CALCULATION)15:
		case (CALCULATION)16:
		case (CALCULATION)17:
		case (CALCULATION)18:
		case (CALCULATION)19:
		case (CALCULATION)21:
		case (CALCULATION)22:
		case (CALCULATION)23:
		case (CALCULATION)24:
		case (CALCULATION)25:
		case (CALCULATION)26:
		case (CALCULATION)27:
		case (CALCULATION)28:
		case (CALCULATION)29:
			break;
		}
	}

	protected bool m_blnIsPie()
	{
		return (m_lngStyle == STYLE2D3D.STYLE2D_PIE) | (m_lngStyle == STYLE2D3D.STYLE2D_DOUGHNUT) | (m_lngStyle == STYLE2D3D.STYLE3D_PIE) | (m_lngStyle == STYLE2D3D.STYLE3D_DOUGHNUT);
	}

	protected bool m_blnIsDotty()
	{
		return (m_lngStyle == STYLE2D3D.STYLE2D_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE2D_LINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_POINT) | (m_lngStyle == STYLE2D3D.STYLE2D_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE2D_SPLINE_AREA) | (m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE_DEV) | (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER) | (m_lngStyle == STYLE2D3D.STYLE2D_GAUGE) | (m_lngStyle == STYLE2D3D.STYLE3D_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE3D_SPLINE_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_SPLINE_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE2D_RADAR);
	}

	[Description("Verifica que se han proporcionado todos los valores adecuados")]
	public void ValidateParameters()
	{
		checked
		{
			try
			{
				int num;
				int num2;
				if (!Information.IsArray(m_arrSeries))
				{
					num = 0;
					num2 = 0;
				}
				else
				{
					num = m_arrSeries.Length;
					num2 = m_arrSeries[0].Count;
				}
				int num3 = ((!((m_lngStyle == STYLE2D3D.STYLE2D_GANTT) | (m_lngStyle == STYLE2D3D.STYLE2D_DOUGHNUT) | (m_lngStyle == STYLE2D3D.STYLE2D_PIE) | (m_lngStyle == STYLE2D3D.STYLE3D_DOUGHNUT) | (m_lngStyle == STYLE2D3D.STYLE3D_PIE))) ? num : num2);
				int i = (Information.IsArray(m_arrItemsLegend) ? m_arrItemsLegend.Length : 0);
				if (i < num2)
				{
					m_arrItemsLegend = (string[])Utils.CopyArray(m_arrItemsLegend, new string[num2 - 1 + 1]);
					for (; i < num2; i++)
					{
						m_arrItemsLegend[i] = "Item " + Conversions.ToString(i + 1);
					}
				}
				i = (Information.IsArray(m_arrItemsHighlight) ? m_arrItemsHighlight.Length : 0);
				if (i < num2)
				{
					m_arrItemsHighlight = (string[])Utils.CopyArray(m_arrItemsHighlight, new string[num2 - 1 + 1]);
					for (; i < num2; i++)
					{
						m_arrItemsHighlight[i] = "";
					}
				}
				i = (Information.IsArray(m_arrSeriesBorderStyle) ? m_arrSeriesBorderStyle.Length : 0);
				if (i < num)
				{
					m_arrSeriesBorderStyle = (Pen[])Utils.CopyArray(m_arrSeriesBorderStyle, new Pen[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_arrSeriesBorderStyle[i] = new Pen(Color.Black, 1f);
					}
				}
				i = (Information.IsArray(m_arrSeriesColor) ? m_arrSeriesColor.Length : 0);
				if (i < num3)
				{
					m_arrSeriesColor = (Color[])Utils.CopyArray(m_arrSeriesColor, new Color[num3 - 1 + 1]);
					for (; i < num3; i++)
					{
						if (m_lngStyle == STYLE2D3D.STYLE2D_GANTT)
						{
							ref Color reference = ref m_arrSeriesColor[i];
							reference = m_arrSeriesColor[0];
						}
						else
						{
							ref Color reference2 = ref m_arrSeriesColor[i];
							reference2 = Color.FromArgb(255, (int)Math.Round(VBMath.Rnd() * 255f), (int)Math.Round(VBMath.Rnd() * 255f), (int)Math.Round(VBMath.Rnd() * 255f));
						}
					}
				}
				i = (Information.IsArray(m_arrSeriesFillStyle) ? m_arrSeriesFillStyle.Length : 0);
				if (i < num3)
				{
					m_arrSeriesFillStyle = (Brush[])Utils.CopyArray(m_arrSeriesFillStyle, new Brush[num3 - 1 + 1]);
					for (; i < num3; i++)
					{
						m_arrSeriesFillStyle[i] = new SolidBrush(m_arrSeriesColor[i]);
					}
				}
				i = (Information.IsArray(m_arrSeriesLineStyle) ? m_arrSeriesLineStyle.Length : 0);
				if (i < num3)
				{
					m_arrSeriesLineStyle = (Pen[])Utils.CopyArray(m_arrSeriesLineStyle, new Pen[num3 - 1 + 1]);
					for (; i < num3; i++)
					{
						Pen pen;
						if (m_SeriesLineStyleDefault != null)
						{
							pen = m_SeriesLineStyleDefault;
						}
						else
						{
							pen = new Pen(Color.FromArgb(255, (int)Math.Round(VBMath.Rnd() * 255f), (int)Math.Round(VBMath.Rnd() * 255f), (int)Math.Round(VBMath.Rnd() * 255f)));
							float num4 = Conversion.Int(VBMath.Rnd() * 4f);
							if (num4 == 0f)
							{
								pen.DashStyle = DashStyle.Dash;
							}
							else if (num4 == 1f)
							{
								pen.DashStyle = DashStyle.Dot;
							}
							else if (num4 == 2f)
							{
								pen.DashStyle = DashStyle.DashDotDot;
							}
							else if (num4 == 3f)
							{
								pen.DashStyle = DashStyle.DashDot;
							}
							else if (num4 == 4f)
							{
								pen.DashStyle = DashStyle.Dash;
							}
						}
						m_arrSeriesLineStyle[i] = pen;
					}
				}
				i = (Information.IsArray(m_arrSeriesLegend) ? m_arrSeriesLegend.Length : 0);
				if (i < num)
				{
					m_arrSeriesLegend = (string[])Utils.CopyArray(m_arrSeriesLegend, new string[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_arrSeriesLegend[i] = "Legend " + Conversions.ToString(i);
					}
				}
				i = (Information.IsArray(m_arrSeriesPictures) ? m_arrSeriesPictures.Length : 0);
				if (i < num)
				{
					m_arrSeriesPictures = (Image[])Utils.CopyArray(m_arrSeriesPictures, new Image[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_arrSeriesPictures[i] = new Bitmap(10, 10);
					}
				}
				if ((m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_GANTT) | (m_XAxisScaleMode == SCALEMODE.SCALEMODE_FIXED_DATETIME))
				{
					if ((Operators.CompareString(m_XAxisNumericFormat, "N", TextCompare: false) == 0) | (Operators.CompareString(m_XAxisNumericFormat, "0", TextCompare: false) == 0))
					{
						m_XAxisNumericFormat = "d";
					}
				}
				else if (Operators.CompareString(m_XAxisNumericFormat, "d", TextCompare: false) == 0)
				{
					m_XAxisNumericFormat = "N";
				}
				i = (Information.IsArray(m_GaugeBackStyle) ? m_GaugeBackStyle.Length : 0);
				if (i < num)
				{
					m_GaugeBackStyle = (SolidBrush[])Utils.CopyArray(m_GaugeBackStyle, new SolidBrush[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_GaugeBackStyle[i] = new SolidBrush(m_arrSeriesColor[i]);
					}
				}
				i = (Information.IsArray(m_GaugeBigTickStyle) ? m_GaugeBigTickStyle.Length : 0);
				if (i < num)
				{
					m_GaugeBigTickStyle = (Pen[])Utils.CopyArray(m_GaugeBigTickStyle, new Pen[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_GaugeBigTickStyle[i] = new Pen(m_arrSeriesColor[i], 5f);
					}
				}
				i = (Information.IsArray(m_GaugeSmallTickStyle) ? m_GaugeSmallTickStyle.Length : 0);
				if (i < num)
				{
					m_GaugeSmallTickStyle = (Pen[])Utils.CopyArray(m_GaugeSmallTickStyle, new Pen[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_GaugeSmallTickStyle[i] = new Pen(m_arrSeriesColor[i], 1f);
					}
				}
				i = (Information.IsArray(m_GaugeBorderStyle) ? m_GaugeBorderStyle.Length : 0);
				if (i < num)
				{
					m_GaugeBorderStyle = (Pen[])Utils.CopyArray(m_GaugeBorderStyle, new Pen[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_GaugeBorderStyle[i] = new Pen(m_arrSeriesColor[i], 3f);
					}
				}
				i = (Information.IsArray(m_GaugeCentralCircleBackStyle) ? m_GaugeCentralCircleBackStyle.Length : 0);
				if (i < num)
				{
					m_GaugeCentralCircleBackStyle = (SolidBrush[])Utils.CopyArray(m_GaugeCentralCircleBackStyle, new SolidBrush[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_GaugeCentralCircleBackStyle[i] = new SolidBrush(m_arrSeriesColor[i]);
					}
				}
				i = (Information.IsArray(m_GaugeCentralCircleBorderStyle) ? m_GaugeCentralCircleBorderStyle.Length : 0);
				if (i < num)
				{
					m_GaugeCentralCircleBorderStyle = (Pen[])Utils.CopyArray(m_GaugeCentralCircleBorderStyle, new Pen[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_GaugeCentralCircleBorderStyle[i] = new Pen(m_arrSeriesColor[i]);
					}
				}
				i = (Information.IsArray(m_GaugeCentralCircleRadius) ? m_GaugeCentralCircleRadius.Length : 0);
				if (i < num)
				{
					m_GaugeCentralCircleRadius = (float[])Utils.CopyArray(m_GaugeCentralCircleRadius, new float[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_GaugeCentralCircleRadius[i] = 0.25f;
					}
				}
				i = (Information.IsArray(m_GaugeNeedleStyle) ? m_GaugeNeedleStyle.Length : 0);
				if (i < num)
				{
					m_GaugeNeedleStyle = (Pen[])Utils.CopyArray(m_GaugeNeedleStyle, new Pen[num - 1 + 1]);
					for (; i < num; i++)
					{
						m_GaugeNeedleStyle[i] = new Pen(Color.Blue, 4f);
					}
				}
				if (DateAndTime.Year(m_GanttTodayDate) <= 1900)
				{
					m_GanttTodayDate = DateAndTime.Now;
				}
				i = (Information.IsArray(m_HotSpotToolTips) ? m_HotSpotToolTips.Length : 0);
				if (i < num)
				{
					m_HotSpotToolTips = (ArrayList[])Utils.CopyArray(m_HotSpotToolTips, new ArrayList[num - 1 + 1]);
				}
				int num5 = num;
				for (i = 1; i <= num5; i++)
				{
					if (m_HotSpotToolTips[i - 1] == null)
					{
						m_HotSpotToolTips[i - 1] = new ArrayList();
					}
					while (m_HotSpotToolTips[i - 1].Count < m_arrSeries[i - 1].Count)
					{
						m_HotSpotToolTips[i - 1].Add("$$");
					}
				}
				if (!Information.IsArray(m_ValuesCaptions))
				{
					m_ValuesCaptions = new string[1];
					m_ValuesCaptions[0] = "";
				}
				m_blnItemsLegendSet = false;
				if (Information.IsArray(m_arrItemsLegend) && m_arrItemsLegend.Length > 0)
				{
					m_blnItemsLegendSet = (num2 >= m_arrItemsLegend.Length - 1) & (Operators.CompareString(m_arrItemsLegend[0], "Item 1", TextCompare: false) != 0);
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	private void m_RefreshGraphGauge(ref Rectangle r)
	{
		m_rectChart = r;
		if (m_arrSeries == null)
		{
			return;
		}
		m_vcc = new ValueCaptionRenderer(_g, blnHorizontalChart: false, m_dblShowValuesMin, m_dblShowValuesMax);
		if (m_GridBackgroundImage != null)
		{
			if (m_GridBackgroundImageTransparency > 0)
			{
				float[][] newColorMatrix = new float[5][]
				{
					new float[5] { 1f, 0f, 0f, 0f, 0f },
					new float[5] { 0f, 1f, 0f, 0f, 0f },
					new float[5] { 0f, 0f, 1f, 0f, 0f },
					new float[5]
					{
						0f,
						0f,
						0f,
						(float)((double)m_GridBackgroundImageTransparency / 100.0),
						0f
					},
					new float[5] { 0f, 0f, 0f, 0f, 1f }
				};
				ColorMatrix newColorMatrix2 = new ColorMatrix(newColorMatrix);
				ImageAttributes imageAttributes = new ImageAttributes();
				imageAttributes.SetColorMatrix(newColorMatrix2, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
				_g.g.DrawImage(m_GridBackgroundImage, r, 0, 0, m_GridBackgroundImage.Width, m_GridBackgroundImage.Height, GraphicsUnit.Pixel, imageAttributes);
			}
			else
			{
				_g.g.DrawImage(m_GridBackgroundImage, r);
			}
		}
		int num;
		int num2;
		switch (m_arrSeries.Length)
		{
		case 1:
			num = 1;
			num2 = 1;
			break;
		case 2:
			num = 1;
			num2 = 2;
			break;
		case 3:
		case 4:
			num = 2;
			num2 = 2;
			break;
		case 5:
		case 6:
			num = 2;
			num2 = 3;
			break;
		case 7:
		case 8:
		case 9:
			num = 3;
			num2 = 3;
			break;
		default:
			num = 3;
			num2 = 4;
			break;
		}
		checked
		{
			int num3 = (int)Math.Round((double)r.Width / (double)num2);
			int num4 = (int)Math.Round((double)r.Height / (double)num);
			int num5 = 0;
			int num6 = num - 1;
			for (int i = 0; i <= num6; i++)
			{
				int num7 = num2 - 1;
				for (int j = 0; j <= num7; j++)
				{
					if (num5 < m_arrSeries.Length)
					{
						Rectangle r2 = new Rectangle((int)Math.Round((float)(r.Left + j * num3) + (float)num3 * m_GaugeMarginFactor), (int)Math.Round((float)(r.Top + i * num4) + (float)num4 * m_GaugeMarginFactor), (int)Math.Round((float)num3 * (1f - m_GaugeMarginFactor * 2f)), (int)Math.Round((float)num4 * (1f - m_GaugeMarginFactor * 2f)));
						m_DrawGaugeGraph(r2, num5);
						num5++;
					}
				}
			}
			m_vcc.HighlightSelection(this);
		}
	}

	private void m_DrawGaugeGraph(Rectangle r, int seriesIndex)
	{
		checked
		{
			try
			{
				if (m_GaugeTitles != null && Information.UBound(m_GaugeTitles) >= seriesIndex)
				{
					int num = (int)Math.Round(_g.MeasureString(m_GaugeTitles[seriesIndex], m_GaugeTitlesFont).Height);
					StringFormat stringFormat = new StringFormat();
					stringFormat.Alignment = StringAlignment.Center;
					stringFormat.LineAlignment = StringAlignment.Center;
					Rectangle rectangle = new Rectangle(r.Left, r.Top, r.Width, num);
					_g.DrawString(m_GaugeTitles[seriesIndex], m_GaugeTitlesFont, new SolidBrush(Color.Black), rectangle, stringFormat);
					r = new Rectangle(r.X, r.Y + num + 5, r.Width, r.Height - num - 5);
				}
				r = ((r.Width <= r.Height) ? new Rectangle(r.Left, (int)Math.Round((double)r.Top + (double)r.Height / 2.0 - (double)r.Width / 2.0), r.Width, r.Width) : new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0 - (double)r.Height / 2.0), r.Top, r.Height, r.Height));
				Color color = m_GaugeBackStyle[seriesIndex].Color;
				Color c = default(Color);
				Color c2 = default(Color);
				Color c1a = default(Color);
				Color c2a = default(Color);
				m_CalculateColorRampFromColor(color, ref c, ref c2, ref c1a, ref c2a, blnSombraTransparente: true);
				if (m_blnShadow)
				{
					Rectangle r2 = Rectangle.FromLTRB(r.Left + 5, r.Top + 5, r.Right + 5, r.Bottom + 5);
					_g.FillEllipse(new SolidBrush(c1a), r2);
				}
				GraphicsPath graphicsPath = new GraphicsPath();
				graphicsPath.AddEllipse(r);
				PathGradientBrush pathGradientBrush = new PathGradientBrush(graphicsPath);
				PointF centerPoint = new PointF((float)((double)r.Left + (double)r.Width / 4.0), (float)((double)r.Top + (double)r.Height / 4.0));
				pathGradientBrush.CenterPoint = centerPoint;
				pathGradientBrush.SurroundColors = new Color[1] { c };
				pathGradientBrush.CenterColor = c2;
				_g.FillBubble(pathGradientBrush, r);
				_g.DrawEllipse(m_GaugeBorderStyle[seriesIndex], r);
				if (m_GaugeRangeColors != null && Information.UBound(m_GaugeRangeColors) >= seriesIndex)
				{
					float num2 = 135f;
					int num3 = (int)Math.Round(m_GaugeCentralCircleRadius[seriesIndex] * (float)r.Width);
					int num4 = (int)Math.Round(m_GaugeCentralCircleRadius[seriesIndex] * (float)r.Height);
					int count = m_GaugeRangeColors[seriesIndex].Count;
					Color color2 = default(Color);
					for (int i = 1; i <= count; i++)
					{
						float num5 = Conversions.ToSingle(NewLateBinding.LateIndexGet(m_GaugeRangeColors[seriesIndex][i - 1], new object[1] { 0 }, null));
						float num6 = Conversions.ToSingle(NewLateBinding.LateIndexGet(m_GaugeRangeColors[seriesIndex][i - 1], new object[1] { 1 }, null));
						object obj = NewLateBinding.LateIndexGet(m_GaugeRangeColors[seriesIndex][i - 1], new object[1] { 2 }, null);
						Color color3 = ((obj != null) ? ((Color)obj) : color2);
						float num7 = Math.Abs(num6 - num5) * 270f / m_GaugesRange[seriesIndex];
						Rectangle rectangle2 = r;
						r = new Rectangle((int)Math.Round((double)r.X + (double)r.Width * 0.025), (int)Math.Round((double)r.Y + (double)r.Height * 0.025), (int)Math.Round((double)r.Width * 0.95), (int)Math.Round((double)r.Height * 0.95));
						graphicsPath = new GraphicsPath();
						graphicsPath.AddArc(r, num2, num7);
						Rectangle rect = new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0 - (double)num3 / 2.0), (int)Math.Round((double)r.Top + (double)r.Height / 2.0 - (double)num4 / 2.0), num3, num4);
						graphicsPath.AddArc(rect, num2 + num7, 0f - num7);
						graphicsPath.CloseFigure();
						_g.g.FillPath(new SolidBrush(color3), graphicsPath);
						r = rectangle2;
						num2 += num7;
					}
				}
				if (m_GaugesDividersCount[seriesIndex] > 1)
				{
					float num8 = (float)Math.PI * 3f / 4f;
					float num9 = (float)(4.71238898038469 / (double)(m_GaugesDividersCount[seriesIndex] - 1));
					int num10 = m_GaugesDividersCount[seriesIndex] - 1;
					for (int j = 0; j <= num10; j++)
					{
						int num11 = (int)Math.Round((double)r.Left + (double)r.Width / 2.0 + Math.Cos(num8) * ((double)r.Width / 2.0) * 0.8);
						int num12 = (int)Math.Round((double)r.Top + (double)r.Height / 2.0 + Math.Sin(num8) * ((double)r.Height / 2.0) * 0.8);
						string text = (m_GaugesMin[seriesIndex] + m_GaugesRange[seriesIndex] * (float)j / (float)(m_GaugesDividersCount[seriesIndex] - 1)).ToString(m_GaugesNumericFormat[seriesIndex]);
						SizeF sizeF = _g.MeasureString(text, m_YAxisValuesFont);
						if ((double)num11 > (double)r.Left + (double)r.Width / 2.0)
						{
							num11 = (int)Math.Round((float)num11 - sizeF.Width);
						}
						if ((double)num12 > (double)r.Top + (double)r.Height / 2.0)
						{
							num12 = (int)Math.Round((float)num12 - sizeF.Height);
						}
						_g.DrawString(text, m_YAxisValuesFont, new SolidBrush(m_YAxisColor), num11, num12);
						num11 = (int)Math.Round((double)r.Left + (double)r.Width / 2.0 + Math.Cos(num8) * ((double)r.Width / 2.0) * 0.81);
						num12 = (int)Math.Round((double)r.Top + (double)r.Height / 2.0 + Math.Sin(num8) * ((double)r.Height / 2.0) * 0.81);
						int num13 = (int)Math.Round((double)r.Left + (double)r.Width / 2.0 + Math.Cos(num8) * ((double)r.Width / 2.0) * 0.95);
						int num14 = (int)Math.Round((double)r.Top + (double)r.Height / 2.0 + Math.Sin(num8) * ((double)r.Height / 2.0) * 0.95);
						_g.DrawLine(m_GaugeBigTickStyle[seriesIndex], num11, num12, num13, num14);
						if (j < m_GaugesDividersCount[seriesIndex] - 1)
						{
							num11 = (int)Math.Round((double)r.Left + (double)r.Width / 2.0 + Math.Cos(num8 + num9 / 2f) * ((double)r.Width / 2.0) * 0.85);
							num12 = (int)Math.Round((double)r.Top + (double)r.Height / 2.0 + Math.Sin(num8 + num9 / 2f) * ((double)r.Height / 2.0) * 0.85);
							num13 = (int)Math.Round((double)r.Left + (double)r.Width / 2.0 + Math.Cos(num8 + num9 / 2f) * ((double)r.Width / 2.0) * 0.95);
							num14 = (int)Math.Round((double)r.Top + (double)r.Height / 2.0 + Math.Sin(num8 + num9 / 2f) * ((double)r.Height / 2.0) * 0.95);
							_g.DrawLine(m_GaugeSmallTickStyle[seriesIndex], num11, num12, num13, num14);
						}
						num8 += num9;
					}
					IEnumerator enumerator = m_arrSeries[seriesIndex].GetEnumerator();
					Pen pen = (Pen)m_GaugeNeedleStyle[seriesIndex].Clone();
					int itemIndex = -1;
					pen.Color = m_GaugeBackStyle[seriesIndex].Color;
					while (enumerator.MoveNext())
					{
						itemIndex++;
						float num15 = Conversions.ToSingle(Operators.AddObject(Math.PI * 3.0 / 4.0, Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(enumerator.Current, m_GaugesMin[seriesIndex]), 4.71238898038469), m_GaugesRange[seriesIndex])));
						int num11 = (int)Math.Round((double)r.Left + (double)r.Width / 2.0 + Math.Cos(num15) * ((double)r.Width / 2.0) * (double)m_GaugeCentralCircleRadius[seriesIndex]);
						int num12 = (int)Math.Round((double)r.Top + (double)r.Height / 2.0 + Math.Sin(num15) * ((double)r.Height / 2.0) * (double)m_GaugeCentralCircleRadius[seriesIndex]);
						int num13 = (int)Math.Round((double)r.Left + (double)r.Width / 2.0 + Math.Cos(num15) * ((double)r.Width / 2.0) * 0.8);
						int num14 = (int)Math.Round((double)r.Top + (double)r.Height / 2.0 + Math.Sin(num15) * ((double)r.Height / 2.0) * 0.8);
						_g.DrawLine(pen, num11 + 1, num12 + 1, num13 + 1, num14 + 1);
						_g.DrawLine(m_GaugeNeedleStyle[seriesIndex], num11, num12, num13, num14);
						if (m_blnHotSpots)
						{
							float sngPosX = num13;
							float sngPosY = num14;
							ValueCaption vc = new ValueCaption(ref seriesIndex, ref itemIndex, ref sngPosX, ref sngPosY, Conversions.ToDouble(enumerator.Current));
							m_vcc.AddCaption(vc);
						}
					}
				}
				Rectangle rectangle3 = new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0 - (double)((float)r.Width * m_GaugeCentralCircleRadius[seriesIndex] / 2f)), (int)Math.Round((double)r.Top + (double)r.Height / 2.0 - (double)((float)r.Height * m_GaugeCentralCircleRadius[seriesIndex] / 2f)), (int)Math.Round((float)r.Width * m_GaugeCentralCircleRadius[seriesIndex]), (int)Math.Round((float)r.Height * m_GaugeCentralCircleRadius[seriesIndex]));
				m_CalculateColorRampFromColor(m_GaugeCentralCircleBackStyle[seriesIndex].Color, ref c, ref c2, ref c1a, ref c2a, blnSombraTransparente: true);
				GraphicsPath graphicsPath2 = new GraphicsPath();
				graphicsPath2.AddEllipse(rectangle3);
				PathGradientBrush pathGradientBrush2 = new PathGradientBrush(graphicsPath2);
				centerPoint = new PointF((float)((double)rectangle3.Left + (double)rectangle3.Width / 4.0), (float)((double)rectangle3.Top + (double)rectangle3.Height / 4.0));
				pathGradientBrush2.CenterPoint = centerPoint;
				pathGradientBrush2.SurroundColors = new Color[1] { c };
				pathGradientBrush2.CenterColor = c2;
				_g.FillBubble(pathGradientBrush2, rectangle3);
				_g.DrawEllipse(m_GaugeCentralCircleBorderStyle[seriesIndex], rectangle3);
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	private void m_RefreshGraphHorizontal(ref Rectangle r)
	{
		if ((m_lngStyle == STYLE2D3D.STYLE2D_HORIZONTAL_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_TORNADO))
		{
			m_vcc = new ValueCaptionRenderer(_g, blnHorizontalChart: true, m_dblShowValuesMin, m_dblShowValuesMax);
		}
		else
		{
			if (m_ValuesLocationStyle == STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE)
			{
				m_ValuesLocationStyle = STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_SMART_PLACEMENT;
			}
			m_vcc = new ValueCaptionRenderer(_g, blnHorizontalChart: true, m_dblShowValuesMin, m_dblShowValuesMax);
		}
		checked
		{
			long num = (long)Math.Round(_g.MeasureString(m_dblSeriesMaxY.ToString(m_YAxisNumericFormat), m_YAxisValuesFont).Width + 10f);
			if (m_lngNumDividersY > 0)
			{
				if (YAxisLabelsRotated)
				{
					int num2 = (int)Math.Round(_g.MeasureString(SeriesMaxY.ToString(YAxisNumericFormat), m_YAxisValuesFont).Width);
					r = new Rectangle(r.Left, r.Top, r.Width, (int)Math.Round((double)r.Height - (double)num2 / 1.1415 - 30.0));
				}
				else
				{
					int num3 = (int)Math.Round(_g.MeasureString(Conversions.ToString(SeriesMaxY), m_YAxisValuesFont).Height);
					r = new Rectangle(r.Left, r.Top, r.Width, r.Height - num3 - 30);
				}
			}
			if (m_ValuesLocationStyle != STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE)
			{
				r = new Rectangle(r.Left, r.Top, r.Width - 20, r.Height);
			}
			int num5;
			if ((Operators.CompareString(m_XAxisTitle, "", TextCompare: false) != 0) & !m_blnIsPie())
			{
				StringFormat stringFormat = new StringFormat();
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Center;
				CustomGraphics g = _g;
				string xAxisTitle = m_XAxisTitle;
				Font xAxisTitleFont = m_XAxisTitleFont;
				SizeF sizef = new SizeF(1000f, 1000f);
				int num4 = (int)Math.Round(g.MeasureString(xAxisTitle, xAxisTitleFont, sizef, stringFormat).Width + 20f);
				CustomGraphics g2 = _g;
				string xAxisTitle2 = m_XAxisTitle;
				Font xAxisTitleFont2 = m_XAxisTitleFont;
				SizeF sizef2 = new SizeF(1000f, 1000f);
				num5 = (int)Math.Round(g2.MeasureString(xAxisTitle2, xAxisTitleFont2, sizef2, stringFormat).Height);
				RectangleF rectangleF = new RectangleF(r.Left + num5, (float)((double)r.Top + (double)r.Height / 2.0 - (double)num4 / 2.0), num4, num5);
				_g.TranslateTransform(rectangleF.Left, rectangleF.Top);
				_g.RotateTransform(90f);
				rectangleF = new RectangleF(0f, 0f, rectangleF.Width, rectangleF.Height);
				_g.DrawString(m_XAxisTitle, m_XAxisTitleFont, new SolidBrush(m_XAxisColor), rectangleF, stringFormat);
				_g.ResetTransform();
				r = new Rectangle(r.Left + num5, r.Top, r.Width - num5, r.Height);
			}
			if (m_lngNumDividersY > 0)
			{
				r = new Rectangle((int)(r.Left + num), r.Top, (int)(r.Width - num), r.Height);
			}
			if ((Operators.CompareString(m_YAxisTitle, "", TextCompare: false) != 0) & !m_blnIsPie())
			{
				StringFormat stringFormat2 = new StringFormat();
				stringFormat2.Alignment = StringAlignment.Center;
				stringFormat2.LineAlignment = StringAlignment.Near;
				int num6 = (int)Math.Round(_g.MeasureString(m_YAxisTitle, m_YAxisTitleFont).Height);
				RectangleF rectangleF = new RectangleF(r.Left, r.Bottom - num6, r.Width, num6);
				_g.DrawString(m_YAxisTitle, m_YAxisTitleFont, new SolidBrush(m_YAxisColor), rectangleF, stringFormat2);
				r = new Rectangle(r.Left, r.Top, r.Width, r.Height - num6 - 40);
			}
			num5 = 0;
			if (m_blnXAxis & (Information.UBound(m_arrItemsLegend) > 0))
			{
				num5 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[0], m_XAxisValuesFont).Height);
				if (m_blnXAxisLabelsRotated90)
				{
					int num7 = Information.UBound(m_arrItemsLegend);
					for (int i = 0; i <= num7; i++)
					{
						long num8 = (long)Math.Round(_g.MeasureString(m_arrItemsLegend[i], m_XAxisValuesFont).Width + 10f);
						if (num8 > num5)
						{
							num5 = (int)num8;
						}
					}
				}
				else if (m_blnXAxisLabelsRotated)
				{
					int num9 = Information.UBound(m_arrItemsLegend);
					for (int j = 0; j <= num9; j++)
					{
						long num10 = (long)Math.Round((double)_g.MeasureString(m_arrItemsLegend[j], m_XAxisValuesFont).Width / 1.4142135623731);
						if (num10 > num5)
						{
							num5 = (int)num10;
						}
					}
				}
				num5 = Math.Min(m_intXAxisHeight, num5);
				r = new Rectangle(r.Left + num5, r.Top, r.Width - num5, r.Height);
			}
			if (m_arrSeries != null)
			{
				if (m_GridBackgroundImage != null)
				{
					if (m_GridBackgroundImageTransparency > 0)
					{
						float[][] newColorMatrix = new float[5][]
						{
							new float[5] { 1f, 0f, 0f, 0f, 0f },
							new float[5] { 0f, 1f, 0f, 0f, 0f },
							new float[5] { 0f, 0f, 1f, 0f, 0f },
							new float[5]
							{
								0f,
								0f,
								0f,
								(float)((double)m_GridBackgroundImageTransparency / 100.0),
								0f
							},
							new float[5] { 0f, 0f, 0f, 0f, 1f }
						};
						ColorMatrix newColorMatrix2 = new ColorMatrix(newColorMatrix);
						ImageAttributes imageAttributes = new ImageAttributes();
						imageAttributes.SetColorMatrix(newColorMatrix2, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
						_g.g.DrawImage(m_GridBackgroundImage, r, 0, 0, m_GridBackgroundImage.Width, m_GridBackgroundImage.Height, GraphicsUnit.Pixel, imageAttributes);
					}
					else
					{
						_g.g.DrawImage(m_GridBackgroundImage, r);
					}
				}
				int seriesDimensions = SeriesDimensions;
				if (seriesDimensions == 1)
				{
					switch (m_lngStyle)
					{
					case STYLE2D3D.STYLE2D_HORIZONTAL_BAR:
						m_DrawHorizontalBarGraph(r);
						break;
					case STYLE2D3D.STYLE2D_TORNADO:
						m_DrawTornadoGraph(r);
						break;
					}
				}
				if ((m_lngStyle < STYLE2D3D.STYLE3D_ACUM_BAR) & !m_blnIsPie() & (m_lngNumDividersY > 0))
				{
					Pen pen = new Pen(m_YAxisColor);
					_g.DrawLine(pen, r.Left, r.Top, r.Right, r.Top);
					_g.DrawLine(pen, r.Left, r.Bottom, r.Right, r.Bottom);
					pen = new Pen(m_XAxisColor);
					_g.DrawLine(pen, r.Left, r.Top, r.Left, r.Bottom);
					_g.DrawLine(pen, r.Right, r.Top, r.Right, r.Bottom);
				}
			}
			if ((m_CalculationStyle != CALCULATION.CALCULATION_NONE) & (m_lngStyle == STYLE2D3D.STYLE2D_HORIZONTAL_BAR))
			{
				m_DrawCalculationHorizontal(r);
			}
			if (m_blnShowValues)
			{
				ValueCaptionRenderer vcc = m_vcc;
				Rectangle rectChart = r;
				ArrayList itemsSelected = m_ItemsSelected;
				Super2d3dGraph chart = this;
				vcc.Render(blnShowDisplacementLine: false, rectChart, itemsSelected, ref chart);
			}
			m_vcc.HighlightSelection(this);
		}
	}

	private void m_DrawGanttGraph(Rectangle r)
	{
		checked
		{
			long num = m_XAxisMaxDateTime.Ticks - m_XAxisMinDateTime.Ticks;
			if (m_lngNumX == 0)
			{
				return;
			}
			int num2 = Information.UBound(m_arrSeries);
			long num3 = m_arrItemsLegend.Length;
			float num4 = (float)((double)r.Height / (double)num3);
			float num5 = (float)((double)num4 * 0.1);
			int num6 = 0;
			int num7 = num2;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (int i = 0; i <= num7; i++)
			{
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						int num8 = Information.UBound((Array)enumerator.Current);
						for (int j = 0; j <= num8; j += 3)
						{
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							float num9 = (float)r.Top + (float)num6 * num4;
							float num10 = Conversions.ToSingle(Operators.AddObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { j }, null), null, "Ticks", new object[0], null, null, null), m_XAxisMinDateTime.Ticks), num), r.Width), r.Left));
							float num11 = Conversions.ToSingle(Operators.AddObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { j + 1 }, null), null, "Ticks", new object[0], null, null, null), m_XAxisMinDateTime.Ticks), num), r.Width), r.Left));
							if (num11 <= num10)
							{
								num11 = num10 + 1f;
							}
							else if (num11 < num10 + 1f)
							{
								num11 += 1f;
							}
							Rectangle rectangle = new Rectangle((int)Math.Round(num10), (int)Math.Round(num9 + num5), (int)Math.Round(num11 - num10), (int)Math.Round(num4 - num5 * 2f));
							m_DrawRectShadow(rectangle, c1a, c2a);
						}
						itemIndex++;
						num6++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			num6 = 0;
			int num12 = num2;
			for (int i = 0; i <= num12; i++)
			{
				int itemIndex2 = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						int num13 = Information.UBound((Array)enumerator.Current);
						for (int k = 0; k <= num13; k += 3)
						{
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref i, ref itemIndex2, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							float num9 = (float)r.Top + (float)num6 * num4;
							float num10 = Conversions.ToSingle(Operators.AddObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { k }, null), null, "Ticks", new object[0], null, null, null), m_XAxisMinDateTime.Ticks), num), r.Width), r.Left));
							float num11 = Conversions.ToSingle(Operators.AddObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { k + 1 }, null), null, "Ticks", new object[0], null, null, null), m_XAxisMinDateTime.Ticks), num), r.Width), r.Left));
							if (num11 <= num10)
							{
								num11 = num10 + 1f;
							}
							else if (num11 < num10 + 1f)
							{
								num11 += 1f;
							}
							Rectangle rectangle = new Rectangle((int)Math.Round(num10), (int)Math.Round(num9 + num5), (int)Math.Round(num11 - num10), (int)Math.Round(num4 - num5 * 2f));
							_g.FillRectangle(new LinearGradientBrush(rectangle, c, c2, LinearGradientMode.Horizontal), rectangle);
							_g.DrawRectangle(m_arrSeriesBorderStyle[i], rectangle);
							Type typeFromHandle = typeof(Math);
							object[] array = new object[2];
							object current = enumerator.Current;
							object[] array2 = new object[1];
							object[] array3 = array2;
							int num14 = k + 2;
							array3[0] = num14;
							array[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(current, array2, null));
							array[1] = 1;
							object[] array4 = array;
							object[] arguments = array4;
							bool[] array5 = new bool[2] { true, false };
							object value = NewLateBinding.LateGet(null, typeFromHandle, "Min", arguments, null, null, array5);
							if (array5[0])
							{
								NewLateBinding.LateIndexSetComplex(current, new object[2]
								{
									num14,
									RuntimeHelpers.GetObjectValue(array4[0])
								}, null, OptimisticSet: true, RValueBase: true);
							}
							float num15 = Conversions.ToSingle(value);
							if (num15 > 0f)
							{
								float num16 = (num11 - num10) * num15;
								Rectangle r2 = new Rectangle((int)Math.Round(num10), (int)Math.Round(num9 + num4 / 2f - num5), (int)Math.Round(num16), (int)Math.Round(num5 * 2f));
								_g.FillRectangle(new SolidBrush(Color.Black), r2);
							}
							if (m_blnShowValues | m_blnHotSpots)
							{
								percentage = (num10 + num11) / 2f;
								float sngPosY = num9 + num4 / 2f;
								ValueCaption valueCaption = new ValueCaption(ref i, ref itemIndex2, ref percentage, ref sngPosY, num15.ToString(m_strValuesFormat));
								valueCaption.AddZoneRectangle(ref rectangle);
								m_vcc.AddCaption(valueCaption);
							}
							if (m_caption != null && rectangle.Contains((int)Math.Round(m_caption.X), (int)Math.Round(m_caption.Y)))
							{
								string caption = m_arrItemsLegend[num6] + ": " + Conversions.ToDate(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString("d") + "-" + Conversions.ToDate(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_HotSpotDateTimeFormat) + " (" + num15.ToString("p0") + ")";
								m_caption.Caption = caption;
							}
						}
						itemIndex2++;
						num6++;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
			if ((DateTime.Compare(m_GanttTodayDate, m_XAxisMinDateTime) >= 0) & (DateTime.Compare(m_GanttTodayDate, m_XAxisMaxDateTime) <= 0))
			{
				float num10 = (float)((double)(m_GanttTodayDate.Ticks - m_XAxisMinDateTime.Ticks) / (double)num * (double)r.Width + (double)r.Left);
				if (m_blnSurface)
				{
					CustomGraphics g = _g;
					Brush surfaceBrushStyle = m_SurfaceBrushStyle;
					RectangleF r3 = new RectangleF(r.Left, r.Top, num10 - (float)r.Left, r.Height);
					g.FillRectangle(surfaceBrushStyle, r3);
				}
				_g.DrawLine(new Pen(Color.Black, 2f), num10, r.Top, num10, r.Bottom);
				StringFormat stringFormat = new StringFormat();
				stringFormat.FormatFlags = StringFormatFlags.DirectionVertical;
				SizeF sizeF = _g.MeasureString(m_GanttTodayLabel, m_YAxisTitleFont);
				RectangleF rectangleF = new RectangleF(num10 - sizeF.Height - 10f, r.Top, sizeF.Width + 10f, sizeF.Height + 10f);
				_g.TranslateTransform(rectangleF.Left, rectangleF.Top);
				_g.RotateTransform(180f);
				_g.TranslateTransform(0f - rectangleF.Height, 0f - rectangleF.Width);
				rectangleF = new RectangleF(0f, 0f, rectangleF.Height, rectangleF.Width);
				_g.DrawString(m_GanttTodayLabel, m_YAxisTitleFont, new SolidBrush(m_YAxisColor), rectangleF, stringFormat);
				_g.ResetTransform();
			}
		}
	}

	private void m_RefreshGraphGantt(Rectangle r)
	{
		int num = m_arrItemsLegend.Length;
		m_vcc = new ValueCaptionRenderer(_g, blnHorizontalChart: true, m_dblShowValuesMin, m_dblShowValuesMax);
		checked
		{
			int num2 = default(int);
			Rectangle rectangle = default(Rectangle);
			if (Operators.CompareString(m_YAxisTitle, "", TextCompare: false) != 0)
			{
				num2 = (int)Math.Round(_g.MeasureString(m_YAxisTitle, m_YAxisTitleFont).Height);
				if (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT)
				{
					rectangle = new Rectangle(r.Left, r.Top, r.Width, r.Height);
					r = new Rectangle(r.Left + num2 + 10, r.Top, r.Width - num2 - 10, r.Height);
				}
				else
				{
					rectangle = new Rectangle(r.Right - num2, r.Top, num2, r.Height);
					r = new Rectangle(r.Left, r.Top, r.Width - num2 - 10, r.Height);
				}
			}
			int yAxisLeftWidth = m_intDataTableItemsMaxWidth();
			m_YAxisLeftWidth = yAxisLeftWidth;
			if (unchecked(m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT && num > 0))
			{
				m_YAxisCurrentWidth = m_YAxisLeftWidth;
				r = new Rectangle(r.Left + m_YAxisLeftWidth, r.Top, r.Width - m_YAxisLeftWidth - m_YAxisRightWidth, r.Height);
			}
			else
			{
				m_YAxisCurrentWidth = m_YAxisRightWidth;
				r = new Rectangle(r.Left + m_YAxisLeftWidth, r.Top, r.Width - m_YAxisLeftWidth - m_YAxisRightWidth, r.Height);
			}
			if (Operators.CompareString(m_XAxisTitle, "", TextCompare: false) != 0)
			{
				StringFormat stringFormat = new StringFormat();
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Near;
				int num3 = (int)Math.Round(_g.MeasureString(m_XAxisTitle, m_XAxisTitleFont).Height);
				if (!m_blnCompositeMode)
				{
					RectangleF rf = new RectangleF(r.Left, r.Bottom - num3 - 10, r.Width, num3);
					_g.DrawString(m_XAxisTitle, m_XAxisTitleFont, new SolidBrush(m_XAxisColor), rf, stringFormat);
				}
				r = new Rectangle(r.Left, r.Top, r.Width, r.Height - num3 - 20);
			}
			int num4 = 0;
			if (m_blnXAxis & (Information.UBound(m_arrItemsLegend) > 0))
			{
				num4 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[0], m_XAxisValuesFont).Height);
				if (m_blnXAxisLabelsRotated90)
				{
					long num5 = (long)Math.Round(_g.MeasureString(m_XAxisMaxDateTime.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width);
					if (num5 > num4)
					{
						num4 = (int)num5;
					}
				}
				else if (m_blnXAxisLabelsRotated)
				{
					long num6 = (long)Math.Round((double)_g.MeasureString(m_XAxisMaxDateTime.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width / 1.4142135623731);
					if (num6 > num4)
					{
						num4 = (int)num6;
					}
				}
				num4 = Math.Min(m_intXAxisHeight, num4);
				r = new Rectangle(r.Left, r.Top, r.Width, r.Height - num4 - 20);
			}
			if (Operators.CompareString(m_YAxisTitle, "", TextCompare: false) != 0)
			{
				StringFormat stringFormat2 = new StringFormat();
				stringFormat2.FormatFlags = StringFormatFlags.DirectionVertical;
				int num7 = (int)Math.Round(_g.MeasureString(m_YAxisTitle, m_YAxisTitleFont).Width + 10f);
				RectangleF rf = new RectangleF(rectangle.Left, (float)((double)r.Top + (double)r.Height / 2.0 - (double)num7 / 2.0), num7, num2);
				_g.TranslateTransform(rf.Left, rf.Top);
				_g.RotateTransform(180f);
				_g.TranslateTransform(0f - rf.Height, 0f - rf.Width);
				rf = new RectangleF(0f, 0f, rf.Height, rf.Width);
				_g.DrawString(m_YAxisTitle, m_YAxisTitleFont, new SolidBrush(m_YAxisColor), rf, stringFormat2);
				_g.ResetTransform();
			}
			Pen pen;
			float num8;
			if (num > 0)
			{
				StringFormat stringFormat3 = new StringFormat();
				pen = new Pen(m_YAxisColor);
				pen.DashStyle = DashStyle.Dot;
				num8 = (float)((double)r.Width / (double)m_lngNumX);
				if (m_WallsBackStyle != 0)
				{
					if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_GRADIENT)
					{
						_g.FillRectangle(new LinearGradientBrush(r, m_WallsBackColorPrincipal, m_WallsBackColorSecondary, LinearGradientMode.Vertical), r);
					}
					else if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_GRADIENT_INVERTED)
					{
						_g.FillRectangle(new LinearGradientBrush(r, m_WallsBackColorSecondary, m_WallsBackColorPrincipal, LinearGradientMode.Vertical), r);
					}
					else
					{
						int num9 = num - 1;
						for (int i = 0; i <= num9; i++)
						{
							float num10 = (float)((double)r.Bottom - (double)(i * r.Height) / (double)num);
							if (i >= num)
							{
								continue;
							}
							Color color = ((unchecked(i % 2) != 0) ? m_WallsBackColorSecondary : m_WallsBackColorPrincipal);
							if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_BANDS)
							{
								Rectangle r2 = Rectangle.FromLTRB(r.Left, (int)Math.Round((double)r.Bottom - (double)((i + 1) * r.Height) / (double)num), r.Right, (int)Math.Round(num10));
								_g.FillRectangle(new SolidBrush(color), r2);
								continue;
							}
							int num11 = (int)(m_lngNumX - 1);
							for (int j = 0; j <= num11; j++)
							{
								float num12 = (float)r.Left + (float)j * num8;
								Rectangle r3 = Rectangle.FromLTRB((int)Math.Round(num12), (int)Math.Round((double)r.Bottom - (double)((i + 1) * r.Height) / (double)num), (int)Math.Round((float)r.Left + (float)(j + 1) * num8), (int)Math.Round(num10));
								_g.FillRectangle(new SolidBrush(color), r3);
								unchecked
								{
									color = ((checked(j + i) % 2 != 0) ? m_WallsBackColorPrincipal : m_WallsBackColorSecondary);
								}
							}
						}
					}
				}
				if (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT)
				{
					stringFormat3.Alignment = StringAlignment.Far;
				}
				else
				{
					stringFormat3.Alignment = StringAlignment.Near;
				}
				stringFormat3.FormatFlags = StringFormatFlags.NoWrap;
				int num13 = num;
				for (int i = 0; i <= num13; i++)
				{
					float num10 = (float)((double)r.Top + (double)(i * r.Height) / (double)num);
					RectangleF rf;
					if (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT)
					{
						if (unchecked(m_blnShowDividersY || i == 0 || i == num))
						{
							_g.DrawLine(pen, r.Left - m_YAxisTickLength, num10, r.Right, num10);
						}
						rf = new RectangleF(r.Left - m_YAxisCurrentWidth - m_YAxisTickLength, num10 - 10f, m_YAxisCurrentWidth, 20f);
					}
					else
					{
						if (unchecked(m_blnShowDividersY || i == 0 || i == num))
						{
							_g.DrawLine(pen, r.Left, num10, r.Right + m_YAxisTickLength, num10);
						}
						rf = new RectangleF(r.Right + 5, num10 - 10f, m_YAxisCurrentWidth - 10, 20f);
					}
					if (i < num)
					{
						rf.Offset(0f, (float)((double)r.Height / (double)(2 * num)));
						if (m_blnYAxisLabelsRotated)
						{
							_g.TranslateTransform(rf.Left, rf.Top + 35f);
							_g.RotateTransform(-45f);
							rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
						}
						_g.DrawString(m_arrItemsLegend[i], m_YAxisValuesFont, new SolidBrush(m_YAxisColor), rf, stringFormat3);
						_g.ResetTransform();
					}
				}
			}
			pen = new Pen(m_XAxisColor);
			int num14;
			if (m_lngNumDividersX != 0)
			{
				num14 = (int)m_lngNumDividersX;
				float num15 = (float)((double)m_lngNumX / (double)m_lngNumDividersX);
			}
			else
			{
				num14 = 10;
				float num15 = 1f;
			}
			num8 = (float)((double)r.Width / (double)num14);
			int num16 = num14 - 1;
			for (int i = 1; i <= num16; i++)
			{
				float num12 = (float)r.Left + (float)i * num8;
				_g.DrawLine(pen, num12, r.Bottom, num12, r.Bottom + 4);
			}
			if (m_blnShowDividersX)
			{
				pen.DashStyle = DashStyle.Dot;
				int num17 = num14 - 1;
				for (int i = 1; i <= num17; i++)
				{
					float num12 = (float)r.Left + (float)i * num8;
					_g.DrawLine(pen, num12, r.Top, num12, r.Bottom);
				}
			}
			if (m_XAxisTickLength > 0)
			{
				pen.DashStyle = DashStyle.Solid;
				int num18 = num14 - 1;
				for (int i = 1; i <= num18; i++)
				{
					float num12 = (float)r.Left + (float)i * num8;
					_g.DrawLine(pen, num12, r.Bottom + 1, num12, r.Bottom + m_XAxisTickLength);
				}
			}
			if (m_blnXAxis)
			{
				StringFormat stringFormat4 = new StringFormat();
				stringFormat4.FormatFlags = StringFormatFlags.NoClip;
				stringFormat4.Alignment = StringAlignment.Far;
				long ticks = m_XAxisMinDateTime.Ticks;
				long num19 = m_XAxisMaxDateTime.Ticks - ticks;
				int i = 0;
				float num22 = default(float);
				if (m_blnXAxisLabelsRotated90)
				{
					int num20 = num14;
					for (i = 0; i <= num20; i++)
					{
						DateTime dateTime = new DateTime((long)Math.Round((double)ticks + (double)(i * num19) / (double)num14));
						DateTime dateTime2 = dateTime;
						DateTime dateTime3 = Conversions.ToDate(dateTime2.ToString(XAxisNumericFormat));
						SizeF sizeF = _g.MeasureString(Conversions.ToString(dateTime3), m_XAxisValuesFont);
						int val = (int)Math.Round(sizeF.Width + 10f);
						int num21 = (int)Math.Round(sizeF.Height);
						val = Math.Min(m_intXAxisHeight, val);
						RectangleF rf = new RectangleF((float)r.Left + (float)i * num8 + num22 / 2f, r.Bottom + 10, val, num21);
						_g.RotateTransform(270f);
						_g.TranslateTransform((float)((double)rf.Left - (double)num21 / 2.0), rf.Top + (float)val, MatrixOrder.Append);
						rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
						_g.DrawString(Conversions.ToString(dateTime3), m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
						_g.ResetTransform();
					}
				}
				else if (m_blnXAxisLabelsRotated)
				{
					int num23 = num14;
					for (i = 0; i <= num23; i++)
					{
						DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks + (double)(i * num19) / (double)num14));
						DateTime dateTime = dateTime2;
						DateTime dateTime3 = Conversions.ToDate(dateTime.ToString(XAxisNumericFormat));
						SizeF sizeF = _g.MeasureString(Conversions.ToString(dateTime3), m_XAxisValuesFont);
						int num24 = (int)Math.Round(sizeF.Width + 10f);
						int num25 = (int)Math.Round(sizeF.Height + 100f);
						RectangleF rf = new RectangleF((float)((double)((float)r.Left + (float)i * num8 + num22 / 2f) - (double)num24 / 1.4142), (float)((double)(r.Bottom + 10) + (double)num24 / 1.4142), num24, num25);
						_g.RotateTransform(-45f);
						_g.TranslateTransform(rf.Left, rf.Top, MatrixOrder.Append);
						rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
						_g.DrawString(Conversions.ToString(dateTime3), m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
						_g.ResetTransform();
					}
				}
				else
				{
					stringFormat4.Alignment = StringAlignment.Center;
					i = 0;
					int num26 = num14;
					for (i = 0; i <= num26; i++)
					{
						DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks + (double)(i * num19) / (double)num14));
						DateTime dateTime = dateTime2;
						DateTime dateTime3 = Conversions.ToDate(dateTime.ToString(m_XAxisNumericFormat));
						float num27 = Math.Max(num22, _g.MeasureString(Conversions.ToString(dateTime3), m_XAxisValuesFont).Width);
						RectangleF rf = new RectangleF((float)r.Left + (float)i * num8 + num22 / 2f - num27 / 2f, r.Bottom + 10, num27, 250f);
						_g.DrawString(Conversions.ToString(dateTime3), m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
						i++;
					}
				}
			}
			m_rectChart = r;
			if (m_arrSeries != null)
			{
				if (m_GridBackgroundImage != null)
				{
					if (m_GridBackgroundImageTransparency > 0)
					{
						float[][] newColorMatrix = new float[5][]
						{
							new float[5] { 1f, 0f, 0f, 0f, 0f },
							new float[5] { 0f, 1f, 0f, 0f, 0f },
							new float[5] { 0f, 0f, 1f, 0f, 0f },
							new float[5]
							{
								0f,
								0f,
								0f,
								(float)((double)m_GridBackgroundImageTransparency / 100.0),
								0f
							},
							new float[5] { 0f, 0f, 0f, 0f, 1f }
						};
						ColorMatrix newColorMatrix2 = new ColorMatrix(newColorMatrix);
						ImageAttributes imageAttributes = new ImageAttributes();
						imageAttributes.SetColorMatrix(newColorMatrix2, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
						_g.g.DrawImage(m_GridBackgroundImage, r, 0, 0, m_GridBackgroundImage.Width, m_GridBackgroundImage.Height, GraphicsUnit.Pixel, imageAttributes);
					}
					else
					{
						_g.g.DrawImage(m_GridBackgroundImage, r);
					}
				}
				Pen pen2 = new Pen(m_YAxisColor);
				_g.DrawLine(pen2, r.Left, r.Top, r.Left, r.Bottom);
				_g.DrawLine(pen2, r.Right, r.Top, r.Right, r.Bottom);
				m_DrawGanttGraph(r);
			}
		}
		if (m_blnShowValues)
		{
			STYLECAPTIONLOCATION valuesLocationStyle = m_ValuesLocationStyle;
			if (m_lngStyle == STYLE2D3D.STYLE2D_PIE && valuesLocationStyle == STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE)
			{
				valuesLocationStyle = STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_SMART_PLACEMENT;
			}
			ValueCaptionRenderer vcc = m_vcc;
			bool blnShowDisplacementLine = (m_lngStyle != STYLE2D3D.STYLE2D_LINE) & (m_lngStyle != STYLE2D3D.STYLE2D_POINT) & (m_lngStyle != STYLE2D3D.STYLE2D_SPLINE) & (m_lngStyle != STYLE2D3D.STYLE3D_LINE) & (m_lngStyle != STYLE2D3D.STYLE3D_SPLINE);
			Rectangle rectChart = r;
			ArrayList itemsSelected = m_ItemsSelected;
			Super2d3dGraph chart = this;
			vcc.Render(blnShowDisplacementLine, rectChart, itemsSelected, ref chart);
		}
		m_vcc.HighlightSelection(this);
	}

	[Description("Gestiona todo el dibujado de cada una de las gráficas y compone el bitmap final")]
	private void m_RefreshComposite()
	{
		int count = m_Charts.Count;
		checked
		{
			for (int i = 2; i <= count; i++)
			{
				NewLateBinding.LateCall(m_Charts[i], null, "ValidateParameters", new object[0], null, null, null, IgnoreReturn: true);
			}
			int count2 = m_Charts.Count;
			int num = default(int);
			int num2 = default(int);
			for (int i = 1; i <= count2; i++)
			{
				int val = Conversions.ToInteger(NewLateBinding.LateGet(m_Charts[i], null, "YAxisCurrentWidth", new object[1] { STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT }, null, null, null));
				num = Math.Max(val, num);
				val = Conversions.ToInteger(NewLateBinding.LateGet(m_Charts[i], null, "YAxisCurrentWidth", new object[1] { STYLEYAXISLOCATION.STYLEYAXISLOCATION_RIGHT }, null, null, null));
				num2 = Math.Max(val, num2);
			}
			m_YAxisLeftWidth = num;
			m_YAxisRightWidth = num2;
			m_RefreshGraph(blnForce: true);
			int count3 = m_Charts.Count;
			for (int i = 2; i <= count3; i++)
			{
				Super2d3dGraph super2d3dGraph = (Super2d3dGraph)m_Charts[i];
				NewLateBinding.LateSetComplex(m_Charts[i], null, "Autorefresh", new object[1] { false }, null, null, OptimisticSet: false, RValueBase: true);
				NewLateBinding.LateSetComplex(m_Charts[i], null, "CompositeMode", new object[1] { true }, null, null, OptimisticSet: false, RValueBase: true);
				NewLateBinding.LateSetComplex(m_Charts[i], null, "ChartInnerRectangle", new object[1] { m_rectChart }, null, null, OptimisticSet: false, RValueBase: true);
				super2d3dGraph.m_ZoomEnabled = m_ZoomEnabled;
				super2d3dGraph.m_ZoomFactor = m_ZoomFactor;
				super2d3dGraph.m_ZoomOffsetX = m_ZoomOffsetX;
				super2d3dGraph.m_ZoomOffsetY = m_ZoomOffsetY;
				super2d3dGraph.m_ZoomOffsetZ = m_ZoomOffsetZ;
				object instance = m_Charts[i];
				object[] array = new object[1] { Image };
				bool[] array2 = new bool[1] { true };
				NewLateBinding.LateCall(instance, null, "RefreshChart", array, null, null, array2, IgnoreReturn: true);
				if (array2[0])
				{
					Image = (Bitmap)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array[0]), typeof(Bitmap));
				}
			}
			Invalidate();
		}
	}

	public void RefreshChart(Bitmap canvas)
	{
		m_RefreshGraph(ref canvas);
	}

	[Description("Refresco del gráfico; esta función llama a las demás")]
	private void m_RefreshGraph(bool blnForce = false)
	{
		if (!(m_blnAutoRefresh || blnForce))
		{
			return;
		}
		checked
		{
			try
			{
				int num = Math.Max(Width, m_intMarginLeft + m_intMarginRight + 60);
				int num2 = Math.Max(Height, m_intMarginTop + m_intMarginBottom + 60);
				m_surface = new Bitmap((int)Math.Round((double)(num * m_lngResolution) / 72.0), (int)Math.Round((double)(num2 * m_lngResolution) / 72.0), PixelFormat.Format32bppArgb);
				m_surface.SetResolution(m_lngResolution, m_lngResolution);
				m_RefreshGraph(ref m_surface);
			}
			catch (ApplicationException ex)
			{
				ProjectData.SetProjectError(ex);
				ApplicationException ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	[Description("Refresco del gráfico; esta función llama a las demás")]
	private void m_RefreshGraph(ref Bitmap m_surface)
	{
		checked
		{
			DateTime xAxisScaleMaximumDateTime = default(DateTime);
			DateTime xAxisScaleMinimumDateTime = default(DateTime);
			float xAxisScaleMaximumNumeric = default(float);
			float xAxisScaleMinimumNumeric = default(float);
			float yAxisScaleMaximum = default(float);
			float yAxisScaleMinimum = default(float);
			float zAxisScaleMaximumNumeric = default(float);
			float zAxisScaleMinimumNumeric = default(float);
			try
			{
				int num = (int)Math.Round((double)(m_surface.Width * 72) / (double)m_lngResolution);
				int num2 = (int)Math.Round((double)(m_surface.Height * 72) / (double)m_lngResolution);
				Graphics graphics = Graphics.FromImage(m_surface);
				graphics.PageUnit = GraphicsUnit.Point;
				graphics.SmoothingMode = m_Quality;
				switch (m_Quality)
				{
				case SmoothingMode.AntiAlias:
					graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
					break;
				case SmoothingMode.HighQuality:
					graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
					break;
				}
				_g.Prepare(graphics, num, num2);
				if (m_ZoomEnabled)
				{
					xAxisScaleMaximumDateTime = m_XAxisScaleMaximumDateTime;
					xAxisScaleMinimumDateTime = m_XAxisScaleMinimumDateTime;
					xAxisScaleMaximumNumeric = m_XAxisScaleMaximumNumeric;
					xAxisScaleMinimumNumeric = m_XAxisScaleMinimumNumeric;
					yAxisScaleMaximum = m_YAxisScaleMaximum;
					yAxisScaleMinimum = m_YAxisScaleMinimum;
					zAxisScaleMaximumNumeric = m_ZAxisScaleMaximumNumeric;
					zAxisScaleMinimumNumeric = m_ZAxisScaleMinimumNumeric;
					m_ZoomApply();
				}
				if (!m_blnCompositeMode)
				{
					ValidateParameters();
					m_DrawBackground();
				}
				BeginPaint?.Invoke(_g);
				Rectangle rectangle = new Rectangle(m_intMarginLeft, m_intMarginTop, num - m_intMarginLeft - m_intMarginRight, num2 - m_intMarginBottom - m_intMarginTop);
				int num3 = default(int);
				if (m_blnLegend)
				{
					m_intLegendHeight = (int)Math.Round(_g.MeasureString("A", m_LegendFont).Height);
					num3 = m_intLegendMaxHeight();
				}
				long num4 = (long)Math.Round(_g.MeasureString(m_strTitle, m_TitleFont).Height);
				RectangleF rf = new RectangleF(rectangle.Left, rectangle.Top, rectangle.Width, num4 + 5);
				StringFormat stringFormat = new StringFormat();
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Center;
				if (!m_LicenseActivated)
				{
					if (!m_blnCompositeMode)
					{
						_g.DrawString(m_strTitle + " (purchase at www.softwaresigloxxi.com)", m_TitleFont, new SolidBrush(m_TitleColor), rf, stringFormat);
					}
				}
				else if (Operators.CompareString(m_strTitle, "", TextCompare: false) != 0 && !m_blnCompositeMode)
				{
					_g.DrawString(m_strTitle, m_TitleFont, new SolidBrush(m_TitleColor), rf, stringFormat);
				}
				rectangle = Rectangle.FromLTRB(rectangle.Left, (int)Math.Round(rf.Bottom + 20f), rectangle.Right, rectangle.Bottom);
				if ((m_Charts.Count > 1) & !m_blnCompositing)
				{
					m_blnCompositing = true;
					m_RefreshComposite();
					m_blnCompositing = false;
				}
				else if (Information.IsArray(m_arrSeries))
				{
					int num5 = default(int);
					if (m_blnLegend)
					{
						num5 = m_intLegendMaxWidth() + 35;
						switch (m_LegendAlignment)
						{
						case STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_RIGHT:
							rectangle = new Rectangle(rectangle.Left, rectangle.Top, rectangle.Width - num5, rectangle.Height);
							break;
						case STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_LEFT:
							rectangle = new Rectangle(rectangle.Left + num5, rectangle.Top, rectangle.Width - num5, rectangle.Height);
							break;
						}
					}
					int num7 = default(int);
					if (m_blnDataTable)
					{
						if (m_lngStyle == STYLE2D3D.STYLE2D_GANTT)
						{
							if (m_arrItemsLegend.Length > 0)
							{
								int num6 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[0], m_DataTableFont).Height);
								num7 = (num6 + 5) * (m_arrItemsLegend.Length + 1);
							}
						}
						else
						{
							int num6 = (int)Math.Round(_g.MeasureString(m_arrSeriesLegend[0], m_DataTableFont).Height);
							num7 = (num6 + 5) * m_intNumSeries();
							if (Information.IsArray(m_arrItemsLegend) && (m_blnIsPie() | ((Information.UBound(m_arrItemsLegend) > 0) & m_blnItemsLegend)))
							{
								num7 = (num6 + 5) * (m_intNumSeries() + 1);
							}
						}
						num7 += 25;
						m_DataTableHeight = num7;
						rectangle = new Rectangle(rectangle.Left, rectangle.Top, rectangle.Width, Math.Max(rectangle.Height - num7, 30));
					}
					if (m_blnLegend)
					{
						switch (m_LegendAlignment)
						{
						case STYLEALIGNMENT.STYLEALIGNMENT_TOP_CENTER:
							rectangle = new Rectangle(rectangle.Left, rectangle.Top + m_intLegendHeight + 25, rectangle.Width, rectangle.Height - m_intLegendHeight);
							break;
						case STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_CENTER:
							rectangle = new Rectangle(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height - num3);
							break;
						case STYLEALIGNMENT.STYLEALIGNMENT_MIDDLE_RIGHT:
						case STYLEALIGNMENT.STYLEALIGNMENT_TOP_RIGHT:
							rectangle = new Rectangle(rectangle.Left, rectangle.Top, rectangle.Width - num5, rectangle.Height);
							break;
						case STYLEALIGNMENT.STYLEALIGNMENT_MIDDLE_LEFT:
						case STYLEALIGNMENT.STYLEALIGNMENT_TOP_LEFT:
							rectangle = new Rectangle(rectangle.Left + num5, rectangle.Top, rectangle.Width - num5, rectangle.Height);
							break;
						}
					}
					if ((rectangle.Height > 30) & (rectangle.Width > 80) & (m_lngNumX > 0))
					{
						switch (m_lngStyle)
						{
						case STYLE2D3D.STYLE2D_HORIZONTAL_BAR:
						case STYLE2D3D.STYLE2D_TORNADO:
							m_RefreshGraphHorizontal(ref rectangle);
							break;
						case STYLE2D3D.STYLE2D_GAUGE:
							m_RefreshGraphGauge(ref rectangle);
							break;
						case STYLE2D3D.STYLE2D_GANTT:
							m_RefreshGraphGantt(rectangle);
							break;
						case STYLE2D3D.STYLE2D_RADAR:
							m_RefreshGraphRadar(ref rectangle);
							break;
						case STYLE2D3D.STYLE3D_XYZ_SCATTER:
						case STYLE2D3D.STYLE3D_XYZ_LINE:
						case STYLE2D3D.STYLE3D_XYZ_MESH:
						case STYLE2D3D.STYLE3D_XYZ_SURFACE:
						case STYLE2D3D.STYLE3D_XYZ_SURFACE_TRIANGLE:
							m_RefreshGraphXYZ(ref rectangle);
							break;
						default:
							m_RefreshGraphVertical(rectangle);
							break;
						}
					}
					if (!m_blnCompositeMode)
					{
						if (m_blnLegend & (m_lngNumX > 0))
						{
							int num8 = (int)Math.Round(Math.Max((double)rectangle.Top + (double)rectangle.Height / 2.0 - (double)num3 / 2.0, 20.0));
							switch (m_LegendAlignment)
							{
							case STYLEALIGNMENT.STYLEALIGNMENT_MIDDLE_RIGHT:
							{
								Rectangle r = new Rectangle(rectangle.Right, num8, num5, num3);
								m_DrawLegendVertical(r);
								break;
							}
							case STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_RIGHT:
							{
								Rectangle r = new Rectangle(rectangle.Right, rectangle.Bottom, num5, num3);
								m_DrawLegendVertical(r);
								break;
							}
							case STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_LEFT:
							{
								Rectangle r = new Rectangle(rectangle.Left - num5, rectangle.Bottom, num5, num3);
								m_DrawLegendVertical(r);
								break;
							}
							case STYLEALIGNMENT.STYLEALIGNMENT_BOTTOM_CENTER:
							{
								Rectangle r = new Rectangle(0, rectangle.Bottom, num, num3);
								m_DrawLegendHorizontal(r);
								break;
							}
							case STYLEALIGNMENT.STYLEALIGNMENT_MIDDLE_LEFT:
							{
								Rectangle r = new Rectangle(rectangle.Left - num5, num8, num5, num3);
								m_DrawLegendVertical(r);
								break;
							}
							case STYLEALIGNMENT.STYLEALIGNMENT_TOP_LEFT:
							{
								Rectangle r = new Rectangle(rectangle.Left - num5, rectangle.Top, num5, num3);
								m_DrawLegendVertical(r);
								break;
							}
							case STYLEALIGNMENT.STYLEALIGNMENT_TOP_RIGHT:
							{
								Rectangle r = new Rectangle(rectangle.Right, rectangle.Top, num5, num3);
								m_DrawLegendVertical(r);
								break;
							}
							case STYLEALIGNMENT.STYLEALIGNMENT_TOP_CENTER:
							{
								Rectangle r = new Rectangle(0, 40, num, num3);
								m_DrawLegendHorizontal(r);
								break;
							}
							}
						}
						if (m_blnDataTable & (m_lngNumX > 0))
						{
							if (m_lngStyle == STYLE2D3D.STYLE2D_GANTT)
							{
								Rectangle r2 = new Rectangle(rectangle.Left, num2 - num7 - 10, rectangle.Width - 20, num7 - 10);
								m_DrawDataTableGantt(r2);
							}
							else
							{
								Rectangle r2 = new Rectangle(rectangle.Left, num2 - num7 - 10, rectangle.Width - 20, num7);
								m_DrawDataTable(r2);
							}
						}
					}
				}
				else
				{
					m_vcc = null;
				}
				if (!m_blnCompositing)
				{
					m_RefreshGraphShowToolTip(rectangle);
				}
				if (!m_blnCompositing)
				{
					CustomGraphics g = _g;
					Pen pen = new Pen(new SolidBrush(m_BorderColor), 5f);
					Rectangle r2 = new Rectangle(0, 0, num, num2);
					g.DrawRectangle(pen, r2);
					if (!m_LicenseActivated)
					{
						int num9 = (int)Math.Round(Conversion.Int((double)(VBMath.Rnd() * (float)rectangle.Width) * 0.75) + (double)rectangle.Left);
						int num10 = (int)Math.Round(Conversion.Int(VBMath.Rnd() * (float)rectangle.Height) + (float)rectangle.Top + 25f);
						CustomGraphics g2 = _g;
						SolidBrush brush = new SolidBrush(Color.White);
						RectangleF r3 = new RectangleF(num9 - 4, num10 - 4, 113f, 38f);
						g2.FillRectangle(brush, r3);
						CustomGraphics g3 = _g;
						SolidBrush brush2 = new SolidBrush(Color.Red);
						r3 = new RectangleF(num9, num10, 105f, 30f);
						g3.FillRectangle(brush2, r3);
						_g.DrawString("Trial Edition", new Font("Verdana", 12f, FontStyle.Bold, GraphicsUnit.Point), new SolidBrush(Color.White), num9 + 4, num10 + 4);
						_g.DrawString("www.softwaresigloxxi.com", new Font("Verdana", 8f, FontStyle.Regular, GraphicsUnit.Point), new SolidBrush(Color.Yellow), num9 + 4, num10 + 18);
					}
					AfterPaint?.Invoke(_g);
					if (!m_blnCompositeMode)
					{
						m_DrawFrontLayer();
					}
					Invalidate();
				}
			}
			catch (ApplicationException ex)
			{
				ProjectData.SetProjectError(ex);
				ApplicationException ex2 = ex;
				ProjectData.ClearProjectError();
			}
			if (m_ZoomEnabled)
			{
				m_XAxisScaleMaximumDateTime = xAxisScaleMaximumDateTime;
				m_XAxisScaleMinimumDateTime = xAxisScaleMinimumDateTime;
				m_XAxisScaleMaximumNumeric = xAxisScaleMaximumNumeric;
				m_XAxisScaleMinimumNumeric = xAxisScaleMinimumNumeric;
				m_YAxisScaleMaximum = yAxisScaleMaximum;
				m_YAxisScaleMinimum = yAxisScaleMinimum;
				m_ZAxisScaleMaximumNumeric = zAxisScaleMaximumNumeric;
				m_ZAxisScaleMinimumNumeric = zAxisScaleMinimumNumeric;
				m_DoCalc();
			}
		}
	}

	private void m_ZoomApply()
	{
		checked
		{
			if ((m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE))
			{
				if ((m_ZoomMode == ZOOM_MODE.BOTH_AXIS) | (m_ZoomMode == ZOOM_MODE.YAXIS_ONLY))
				{
					float num = (Math.Abs(m_YAxisScaleMaximum) + Math.Abs(m_YAxisScaleMinimum)) / 2f;
					m_YAxisScaleMinimum = m_YAxisScaleMinimum - m_ZoomOffsetY + num - num / m_ZoomFactor;
					m_YAxisScaleMaximum = m_YAxisScaleMaximum - m_ZoomOffsetY - num + num / m_ZoomFactor;
				}
				if ((m_ZoomMode == ZOOM_MODE.BOTH_AXIS) | (m_ZoomMode == ZOOM_MODE.XAXIS_ONLY))
				{
					float num2 = (m_XAxisScaleMaximumNumeric + m_XAxisScaleMinimumNumeric) / 2f;
					m_XAxisScaleMinimumNumeric = m_XAxisScaleMinimumNumeric - m_ZoomOffsetX + num2 - num2 / m_ZoomFactor;
					m_XAxisScaleMaximumNumeric = m_XAxisScaleMaximumNumeric - m_ZoomOffsetX - num2 + num2 / m_ZoomFactor;
				}
				m_DoCalc();
			}
			else if ((m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME))
			{
				if ((m_ZoomMode == ZOOM_MODE.BOTH_AXIS) | (m_ZoomMode == ZOOM_MODE.YAXIS_ONLY))
				{
					float num3 = (Math.Abs(m_YAxisScaleMaximum) + Math.Abs(m_YAxisScaleMinimum)) / 2f;
					m_YAxisScaleMinimum = m_YAxisScaleMinimum - m_ZoomOffsetY + num3 - num3 / m_ZoomFactor;
					m_YAxisScaleMaximum = m_YAxisScaleMaximum - m_ZoomOffsetY - num3 + num3 / m_ZoomFactor;
				}
				if ((m_ZoomMode == ZOOM_MODE.BOTH_AXIS) | (m_ZoomMode == ZOOM_MODE.XAXIS_ONLY))
				{
					long num4 = (long)Math.Round((double)(m_XAxisScaleMaximumDateTime.Ticks + m_XAxisScaleMinimumDateTime.Ticks) / 2.0);
					ref DateTime xAxisScaleMinimumDateTime = ref m_XAxisScaleMinimumDateTime;
					xAxisScaleMinimumDateTime = new DateTime((long)Math.Round((float)num4 - m_ZoomOffsetX * 1E+12f - (float)(num4 - m_XAxisScaleMinimumDateTime.Ticks) / m_ZoomFactor));
					ref DateTime xAxisScaleMaximumDateTime = ref m_XAxisScaleMaximumDateTime;
					xAxisScaleMaximumDateTime = new DateTime((long)Math.Round((float)num4 - m_ZoomOffsetX * 1E+12f + (float)(m_XAxisScaleMaximumDateTime.Ticks - num4) / m_ZoomFactor));
				}
				m_DoCalc();
			}
			else if ((m_lngStyle == STYLE2D3D.STYLE3D_XYZ_SURFACE) | (m_lngStyle == STYLE2D3D.STYLE3D_XYZ_SCATTER) | (m_lngStyle == STYLE2D3D.STYLE3D_XYZ_SURFACE_TRIANGLE) | (m_lngStyle == STYLE2D3D.STYLE3D_XYZ_LINE))
			{
				if ((m_ZoomMode == ZOOM_MODE.BOTH_AXIS) | (m_ZoomMode == ZOOM_MODE.YAXIS_ONLY))
				{
					float num5 = (Math.Abs(m_YAxisScaleMaximum) + Math.Abs(m_YAxisScaleMinimum)) / 2f;
					m_YAxisScaleMinimum = m_YAxisScaleMinimum - m_ZoomOffsetY + num5 - num5 / m_ZoomFactor;
					m_YAxisScaleMaximum = m_YAxisScaleMaximum - m_ZoomOffsetY - num5 + num5 / m_ZoomFactor;
				}
				if ((m_ZoomMode == ZOOM_MODE.BOTH_AXIS) | (m_ZoomMode == ZOOM_MODE.XAXIS_ONLY))
				{
					float num6 = (Math.Abs(m_XAxisScaleMaximumNumeric) + Math.Abs(m_XAxisScaleMinimumNumeric)) / 2f;
					m_XAxisScaleMinimumNumeric = m_XAxisScaleMinimumNumeric - m_ZoomOffsetX + num6 - num6 / m_ZoomFactor;
					m_XAxisScaleMaximumNumeric = m_XAxisScaleMaximumNumeric - m_ZoomOffsetX - num6 + num6 / m_ZoomFactor;
				}
				if ((m_ZoomMode == ZOOM_MODE.BOTH_AXIS) | (m_ZoomMode == ZOOM_MODE.ZAXIS_ONLY))
				{
					float num7 = (Math.Abs(m_ZAxisScaleMaximumNumeric) + Math.Abs(m_ZAxisScaleMinimumNumeric)) / 2f;
					m_ZAxisScaleMinimumNumeric = m_ZAxisScaleMinimumNumeric - m_ZoomOffsetZ + num7 - num7 / m_ZoomFactor;
					m_ZAxisScaleMaximumNumeric = m_ZAxisScaleMaximumNumeric - m_ZoomOffsetZ - num7 + num7 / m_ZoomFactor;
				}
				m_DoCalc();
			}
		}
	}

	private void m_RefreshGraphShowToolTip(Rectangle r)
	{
		if (m_caption == null)
		{
			return;
		}
		checked
		{
			try
			{
				if (m_HotSpotOutlineEnabled)
				{
					if (m_caption.RECT.Width != 0)
					{
						_g.DrawPath(m_HotSpotOutlineStyle, m_caption.PATH);
					}
					else if (m_blnIsDotty())
					{
						CustomGraphics g = _g;
						SolidBrush bs = new SolidBrush(m_HotSpotOutlineStyle.Color);
						Rectangle r2 = new Rectangle((int)Math.Round((double)m_caption.X_HotSpot - (double)m_PointSize / 2.0 - 1.0), (int)Math.Round((double)m_caption.Y_HotSpot - (double)m_PointSize / 2.0 - 1.0), m_PointSize + 2, m_PointSize + 2);
						g.FillEllipse(bs, r2);
						CustomGraphics g2 = _g;
						Pen pen = new Pen(Color.Black);
						r2 = new Rectangle((int)Math.Round((double)m_caption.X_HotSpot - (double)m_PointSize / 2.0 - 1.0), (int)Math.Round((double)m_caption.Y_HotSpot - (double)m_PointSize / 2.0 - 1.0), m_PointSize + 2, m_PointSize + 2);
						g2.DrawEllipse(pen, r2);
					}
				}
				string newValue = m_caption.get_Value(m_HotSpotNumericFormat);
				string text = Conversions.ToString(m_HotSpotToolTips[m_caption.seriesIndex][m_caption.itemIndex]);
				if (Operators.CompareString(text, "", TextCompare: false) != 0)
				{
					newValue = ((text.IndexOf("$$") < 0) ? text : text.Replace("$$", newValue));
				}
				Font font = new Font(m_ValuesFont, FontStyle.Bold | FontStyle.Italic);
				SizeF sizeF = _g.MeasureString(newValue, font);
				int num = (int)Math.Round(sizeF.Width);
				int num2 = (int)Math.Round(sizeF.Height);
				if (m_HotSpotCross & !m_blnIsPie())
				{
					_g.DrawLine(m_HotSpotCrossLineStyle, r.Left - m_YAxisTickLength, m_caption.Y_HotSpot - 1f, r.Right + m_YAxisTickLength, m_caption.Y_HotSpot - 1f);
					_g.DrawLine(m_HotSpotCrossLineStyle, m_caption.X_HotSpot, r.Top, m_caption.X_HotSpot, r.Bottom + 5);
				}
				GraphicsPath graphicsPath = new GraphicsPath();
				if ((m_caption.X_HotSpot + (float)num + 25f > (float)r.Right) & (m_caption.X_HotSpot - (float)num >= 0f))
				{
					PointF[] array = new PointF[7];
					ref PointF reference = ref array[0];
					PointF pointF = new PointF(m_caption.X_HotSpot - 15f, m_caption.Y_HotSpot - 11f);
					reference = pointF;
					ref PointF reference2 = ref array[1];
					PointF pointF2 = new PointF(m_caption.X_HotSpot - (float)num - 25f, m_caption.Y_HotSpot - 11f);
					reference2 = pointF2;
					ref PointF reference3 = ref array[2];
					PointF pointF3 = new PointF(m_caption.X_HotSpot - (float)num - 25f, m_caption.Y_HotSpot + (float)num2 - 5f);
					reference3 = pointF3;
					ref PointF reference4 = ref array[3];
					PointF pointF4 = new PointF(m_caption.X_HotSpot - 15f, m_caption.Y_HotSpot + (float)num2 - 5f);
					reference4 = pointF4;
					ref PointF reference5 = ref array[4];
					PointF pointF5 = new PointF(m_caption.X_HotSpot - 15f, m_caption.Y_HotSpot + 4f);
					reference5 = pointF5;
					ref PointF reference6 = ref array[5];
					PointF pointF6 = new PointF(m_caption.X_HotSpot, m_caption.Y_HotSpot - 1f);
					reference6 = pointF6;
					ref PointF reference7 = ref array[6];
					PointF pointF7 = new PointF(m_caption.X_HotSpot - 15f, m_caption.Y_HotSpot - 6f);
					reference7 = pointF7;
					PointF[] points = array;
					graphicsPath.AddPolygon(points);
					_g.TranslateTransform(3f, 3f);
					_g.FillPath(new SolidBrush(Color.FromArgb(64, 0, 0, 0)), graphicsPath);
					_g.ResetTransform();
					_g.FillPolygon(new SolidBrush(m_HotSpotBackColor), points);
					_g.DrawPolygon(new Pen(m_BorderColor), points);
					_g.DrawString(newValue, font, new SolidBrush(m_HotSpotColor), (int)Math.Round(m_caption.X_HotSpot - (float)num - 20f), (int)Math.Round(m_caption.Y_HotSpot - 8f));
				}
				else
				{
					PointF[] array = new PointF[7];
					ref PointF reference8 = ref array[0];
					PointF pointF7 = new PointF(m_caption.X_HotSpot + 20f, m_caption.Y_HotSpot - 11f);
					reference8 = pointF7;
					ref PointF reference9 = ref array[1];
					PointF pointF6 = new PointF(m_caption.X_HotSpot + (float)num + 30f, m_caption.Y_HotSpot - 11f);
					reference9 = pointF6;
					ref PointF reference10 = ref array[2];
					PointF pointF5 = new PointF(m_caption.X_HotSpot + (float)num + 30f, m_caption.Y_HotSpot + (float)num2 - 5f);
					reference10 = pointF5;
					ref PointF reference11 = ref array[3];
					PointF pointF4 = new PointF(m_caption.X_HotSpot + 20f, m_caption.Y_HotSpot + (float)num2 - 5f);
					reference11 = pointF4;
					ref PointF reference12 = ref array[4];
					PointF pointF3 = new PointF(m_caption.X_HotSpot + 20f, m_caption.Y_HotSpot + 4f);
					reference12 = pointF3;
					ref PointF reference13 = ref array[5];
					PointF pointF2 = new PointF(m_caption.X_HotSpot + 5f, m_caption.Y_HotSpot - 1f);
					reference13 = pointF2;
					ref PointF reference14 = ref array[6];
					PointF pointF = new PointF(m_caption.X_HotSpot + 20f, m_caption.Y_HotSpot - 6f);
					reference14 = pointF;
					PointF[] points = array;
					graphicsPath.AddPolygon(points);
					_g.TranslateTransform(3f, 3f);
					_g.FillPath(new SolidBrush(Color.FromArgb(64, 0, 0, 0)), graphicsPath);
					_g.ResetTransform();
					_g.FillPolygon(new SolidBrush(m_HotSpotBackColor), points);
					_g.DrawPolygon(new Pen(m_BorderColor), points);
					_g.DrawString(newValue, font, new SolidBrush(m_HotSpotColor), (int)Math.Round(m_caption.X_HotSpot + 25f), (int)Math.Round(m_caption.Y_HotSpot - 8f));
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	private int m_intNumSeries()
	{
		int num = 0;
		int count = m_Charts.Count;
		for (int i = 1; i <= count; i = checked(i + 1))
		{
			num = Conversions.ToInteger(Operators.AddObject(num, NewLateBinding.LateGet(NewLateBinding.LateGet(m_Charts[i], null, "Series", new object[0], null, null, null), null, "Length", new object[0], null, null, null)));
		}
		return num;
	}

	private void m_DrawLegendGetCaptions()
	{
		int num = -1;
		m_arrLegendCaptions = new string[1];
		m_arrLegendColors = new Brush[1];
		int count = m_Charts.Count;
		checked
		{
			for (int i = 1; i <= count; i++)
			{
				if (!Conversions.ToBoolean(NewLateBinding.LateGet(m_Charts[i], null, "ShowLegend", new object[0], null, null, null)))
				{
					continue;
				}
				if (Conversions.ToBoolean(Operators.AndObject(NewLateBinding.LateGet(m_Charts[i], null, "ShowItemsLegend", new object[0], null, null, null), NewLateBinding.LateGet(m_Charts[i], null, "IsPie", new object[0], null, null, null))))
				{
					int num2 = Conversions.ToInteger(NewLateBinding.LateGet(null, typeof(Math), "Min", new object[2]
					{
						Information.UBound((Array)NewLateBinding.LateGet(m_Charts[i], null, "ItemsLegend", new object[0], null, null, null)),
						Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateGet(m_Charts[i], null, "series", new object[1] { 0 }, null, null, null), null, "count", new object[0], null, null, null), 1)
					}, null, null, null));
					m_arrLegendCaptions = (string[])Utils.CopyArray(m_arrLegendCaptions, new string[num + num2 + 1 + 1]);
					m_arrLegendColors = (Brush[])Utils.CopyArray(m_arrLegendColors, new Brush[num + num2 + 1 + 1]);
					int num3 = num2;
					for (int j = 0; j <= num3; j++)
					{
						num++;
						string[] arrLegendCaptions = m_arrLegendCaptions;
						int num4 = num;
						object instance = m_Charts[i];
						object[] array = new object[1] { j };
						object[] arguments = array;
						bool[] array2 = new bool[1] { true };
						object obj = NewLateBinding.LateGet(instance, null, "ItemsLegend", arguments, null, null, array2);
						if (array2[0])
						{
							j = (int)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array[0]), typeof(int));
						}
						arrLegendCaptions[num4] = Conversions.ToString(obj);
						if (j <= Information.UBound((Array)NewLateBinding.LateGet(m_Charts[i], null, "seriescolor", new object[0], null, null, null)))
						{
							Brush[] arrLegendColors = m_arrLegendColors;
							int num5 = num;
							object instance2 = m_Charts[i];
							array = new object[1] { j };
							object[] arguments2 = array;
							array2 = new bool[1] { true };
							object obj2 = NewLateBinding.LateGet(instance2, null, "SeriesFillStyle", arguments2, null, null, array2);
							if (array2[0])
							{
								j = (int)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array[0]), typeof(int));
							}
							arrLegendColors[num5] = (Brush)obj2;
						}
					}
				}
				else
				{
					if (!((NewLateBinding.LateGet(m_Charts[i], null, "Series", new object[0], null, null, null) != null) & (NewLateBinding.LateGet(m_Charts[i], null, "SeriesLegend", new object[0], null, null, null) != null)))
					{
						continue;
					}
					int num2 = Conversions.ToInteger(NewLateBinding.LateGet(null, typeof(Math), "Min", new object[2]
					{
						Information.UBound((Array)NewLateBinding.LateGet(m_Charts[i], null, "SeriesLegend", new object[0], null, null, null)),
						Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateGet(m_Charts[i], null, "Series", new object[0], null, null, null), null, "length", new object[0], null, null, null), 1)
					}, null, null, null));
					m_arrLegendCaptions = (string[])Utils.CopyArray(m_arrLegendCaptions, new string[num + num2 + 1 + 1]);
					m_arrLegendColors = (Brush[])Utils.CopyArray(m_arrLegendColors, new Brush[num + num2 + 1 + 1]);
					int num6 = num2;
					for (int j = 0; j <= num6; j++)
					{
						num++;
						string[] arrLegendCaptions2 = m_arrLegendCaptions;
						int num7 = num;
						object instance3 = m_Charts[i];
						object[] array = new object[1] { j };
						object[] arguments3 = array;
						bool[] array2 = new bool[1] { true };
						object obj3 = NewLateBinding.LateGet(instance3, null, "SeriesLegend", arguments3, null, null, array2);
						if (array2[0])
						{
							j = (int)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array[0]), typeof(int));
						}
						arrLegendCaptions2[num7] = Conversions.ToString(obj3);
						Brush[] arrLegendColors2 = m_arrLegendColors;
						int num8 = num;
						object instance4 = m_Charts[i];
						array = new object[1] { j };
						object[] arguments4 = array;
						array2 = new bool[1] { true };
						object obj4 = NewLateBinding.LateGet(instance4, null, "SeriesFillStyle", arguments4, null, null, array2);
						if (array2[0])
						{
							j = (int)Conversions.ChangeType(RuntimeHelpers.GetObjectValue(array[0]), typeof(int));
						}
						arrLegendColors2[num8] = (Brush)obj4;
					}
				}
			}
		}
	}

	private int m_intLegendMaxHeight()
	{
		int num = 0;
		checked
		{
			if (Operators.CompareString(m_strLegendCaption, "", TextCompare: false) != 0)
			{
				num += 30;
			}
			m_DrawLegendGetCaptions();
			int num2 = m_arrLegendCaptions.Length;
			return (int)Math.Round((double)num + (double)m_intLegendHeight * 1.2 * (double)num2);
		}
	}

	private void m_DrawLegendVertical(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		StringFormat stringFormat = new StringFormat();
		stringFormat.Alignment = StringAlignment.Center;
		stringFormat.LineAlignment = StringAlignment.Center;
		stringFormat.FormatFlags = StringFormatFlags.NoWrap;
		Font font = new Font(m_LegendFont, FontStyle.Bold);
		SizeF sizeF = _g.MeasureString(m_strLegendCaption, font);
		sizeF.Width += 10f;
		sizeF.Height += 6f;
		checked
		{
			RectangleF rectangleF = new RectangleF(r.Left + 10, r.Top + 5, r.Width - 20, r.Height);
			int num;
			if (Operators.CompareString(m_strLegendCaption, "", TextCompare: false) != 0)
			{
				CustomGraphics g = _g;
				RectangleF rf = new RectangleF(rectangleF.Left + rectangleF.Width / 2f - sizeF.Width / 2f, rectangleF.Top - 3f, sizeF.Width, sizeF.Height);
				RoundedRectangle roundedRectangle = new RoundedRectangle(g, rf, 0.5f);
				roundedRectangle.Render(Color.Black, m_LegendBackColor);
				_g.DrawString(m_strLegendCaption, font, new SolidBrush(m_LegendColor), roundedRectangle.RECT, stringFormat);
				num = r.Top + 30;
			}
			else
			{
				num = r.Top;
			}
			Pen pen = new Pen(Color.Black);
			stringFormat.Alignment = StringAlignment.Near;
			stringFormat.LineAlignment = StringAlignment.Near;
			try
			{
				if ((m_lngStyle == STYLE2D3D.STYLE2D_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_ACUM_BAR) | (m_lngStyle == STYLE2D3D.STYLE3D_SPLINE_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_STACKED_BAR) | (m_lngStyle == STYLE2D3D.STYLE3D_STACKED_COLUMN))
				{
					for (int i = Information.UBound(m_arrLegendCaptions); i >= 0; i += -1)
					{
						Rectangle r2 = new Rectangle(r.Left + 5, num, m_intLegendHeight, m_intLegendHeight);
						_g.FillRectangle(m_arrLegendColors[i], r2);
						_g.DrawRectangle(pen, r2);
						rectangleF = new RectangleF(r.Left + m_intLegendHeight + 10, num, r.Width, m_intLegendHeight + 10);
						_g.DrawString(m_arrLegendCaptions[i], m_LegendFont, new SolidBrush(m_LegendColor), rectangleF, stringFormat);
						num = (int)Math.Round((double)(num + m_intLegendHeight) + (double)m_intLegendHeight / 5.0);
					}
					return;
				}
				int num2 = Information.UBound(m_arrLegendCaptions);
				for (int i = 0; i <= num2; i++)
				{
					Rectangle r2 = new Rectangle(r.Left + 5, num, m_intLegendHeight, m_intLegendHeight);
					_g.FillRectangle(m_arrLegendColors[i], r2);
					_g.DrawRectangle(pen, r2);
					rectangleF = new RectangleF(r.Left + m_intLegendHeight + 10, num, r.Width, m_intLegendHeight + 10);
					_g.DrawString(m_arrLegendCaptions[i], m_LegendFont, new SolidBrush(m_LegendColor), rectangleF, stringFormat);
					num = (int)Math.Round((double)(num + m_intLegendHeight) + (double)m_intLegendHeight / 5.0);
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	private void m_DrawLegendHorizontal(Rectangle r)
	{
		int num = m_intLegendMaxWidth();
		Font font = new Font(m_LegendFont, FontStyle.Bold);
		if (m_lngNumX == 0)
		{
			return;
		}
		checked
		{
			SizeF sizeF = default(SizeF);
			int num2;
			if (Operators.CompareString(m_strLegendCaption, "", TextCompare: false) != 0)
			{
				sizeF = _g.MeasureString(m_strLegendCaption, font);
				sizeF.Width += 10f;
				sizeF.Height += 6f;
				num2 = (int)Math.Round(sizeF.Width + 20f + (float)(m_arrLegendCaptions.Length * (num + 20 + m_intLegendHeight)));
			}
			else
			{
				num2 = m_arrLegendCaptions.Length * (num + 20 + m_intLegendHeight);
			}
			StringFormat stringFormat = new StringFormat();
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			RectangleF rf = new RectangleF((float)((double)r.Left + (double)r.Width / 2.0 - (double)num2 / 2.0), r.Top, num2, r.Height);
			int num3;
			if (Operators.CompareString(m_strLegendCaption, "", TextCompare: false) != 0)
			{
				CustomGraphics g = _g;
				RectangleF rf2 = new RectangleF(rf.Left, rf.Top + rf.Height / 2f - sizeF.Height / 2f, sizeF.Width, sizeF.Height);
				RoundedRectangle roundedRectangle = new RoundedRectangle(g, rf2, 0.5f);
				roundedRectangle.Render(Color.Black, m_LegendBackColor);
				CustomGraphics g2 = _g;
				string strLegendCaption = m_strLegendCaption;
				SolidBrush brush = new SolidBrush(m_LegendColor);
				rf2 = new RectangleF(rf.Left, rf.Top + rf.Height / 2f - sizeF.Height / 2f, sizeF.Width, sizeF.Height);
				g2.DrawString(strLegendCaption, font, brush, rf2, stringFormat);
				num3 = (int)Math.Round(rf.Left + sizeF.Width + 20f);
			}
			else
			{
				num3 = (int)Math.Round(rf.Left);
			}
			stringFormat.Alignment = StringAlignment.Near;
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoClip;
			try
			{
				int num4 = Information.UBound(m_arrLegendCaptions);
				for (int i = 0; i <= num4; i++)
				{
					Rectangle r2 = new Rectangle(num3, (int)Math.Round((double)(rf.Top + rf.Height / 2f) - (double)m_intLegendHeight / 2.0), m_intLegendHeight, m_intLegendHeight);
					_g.FillRectangle(m_arrLegendColors[i], r2);
					_g.DrawRectangle(new Pen(Color.Black), r2);
					rf = new RectangleF(num3 + m_intLegendHeight + 5, rf.Top, num, rf.Height);
					_g.DrawString(m_arrLegendCaptions[i], m_LegendFont, new SolidBrush(m_LegendColor), rf, stringFormat);
					num3 += num + 20 + m_intLegendHeight;
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	[Description("Calcula el ancho máximo de la leyenda para la gráfica indicada (composición)")]
	private int m_intLegendMaxWidthOneChart(Super2d3dGraph chart)
	{
		checked
		{
			long num5 = default(long);
			if (m_blnItemsLegend & IsPie)
			{
				long num = 0L;
				long num2 = Information.UBound(chart.ItemsLegend);
				for (long num3 = num; num3 <= num2; num3++)
				{
					long num4 = (long)Math.Round(_g.MeasureString(chart.m_arrItemsLegend[(int)num3], m_LegendFont).Width);
					if (num4 > num5)
					{
						num5 = num4;
					}
				}
			}
			else
			{
				long num6 = 0L;
				long num7 = Information.UBound(chart.SeriesLegend);
				for (long num3 = num6; num3 <= num7; num3++)
				{
					long num4 = (long)Math.Round(_g.MeasureString(chart.SeriesLegend[(int)num3], m_LegendFont).Width);
					if (num4 > num5)
					{
						num5 = num4;
					}
				}
			}
			return (int)(num5 + 1);
		}
	}

	private int m_intLegendMaxWidth()
	{
		int num2 = default(int);
		if (m_Charts.Count > 1)
		{
			int count = m_Charts.Count;
			for (int i = 1; i <= count; i = checked(i + 1))
			{
				int num = m_intLegendMaxWidthOneChart((Super2d3dGraph)m_Charts[i]);
				if (num > num2)
				{
					num2 = num;
				}
			}
		}
		else
		{
			num2 = m_intLegendMaxWidthOneChart(this);
		}
		return num2;
	}

	protected int m_intValuesMaxWidth()
	{
		return checked((int)Math.Round(_g.MeasureString(Conversions.ToString(m_dblSeriesMaxY), m_ValuesFont).Width));
	}

	[Description("Calcula el ancho máximo de los items en el datatable (composición)")]
	private int m_intDatatableItemsMaxWidthOneChart(Super2d3dGraph chart)
	{
		checked
		{
			long num5 = default(long);
			if (m_blnItemsLegend | m_blnIsPie() | (m_lngStyle == STYLE2D3D.STYLE2D_GANTT))
			{
				long num = 0L;
				long num2 = Information.UBound(chart.ItemsLegend);
				for (long num3 = num; num3 <= num2; num3++)
				{
					long num4 = (long)Math.Round(_g.MeasureString(chart.m_arrItemsLegend[(int)num3], m_DataTableFont).Width);
					if (num4 > num5)
					{
						num5 = num4;
					}
				}
			}
			num5 = (long)Math.Round(Math.Max(num5, _g.MeasureString(chart.SeriesMaxY.ToString(m_strValuesFormat), m_DataTableFont).Width));
			num5 = (long)Math.Round(Math.Max(num5, _g.MeasureString(chart.SeriesMinY.ToString(m_strValuesFormat), m_DataTableFont).Width));
			return (int)num5;
		}
	}

	private int m_intDataTableItemsMaxWidth()
	{
		checked
		{
			int num2 = default(int);
			if (m_Charts.Count > 1)
			{
				int count = m_Charts.Count;
				for (int i = 1; i <= count; i++)
				{
					int num = m_intDatatableItemsMaxWidthOneChart((Super2d3dGraph)m_Charts[i]);
					if (num > m_intLegendMaxWidth())
					{
						num2 = num;
					}
				}
			}
			else
			{
				num2 = m_intDatatableItemsMaxWidthOneChart(this);
			}
			if (m_DataTableAdditionalRowValues != null)
			{
				int num3 = m_DataTableAdditionalRowValues.Length;
				for (int j = 1; j <= num3; j++)
				{
					int num4 = (int)Math.Round(_g.MeasureString(m_DataTableAdditionalRowValues[j - 1], m_DataTableFont).Width);
					if (num4 > num2)
					{
						num2 = num4;
					}
				}
			}
			return num2;
		}
	}

	[Description("Calcula el ancho máximo de la leyenda para la gráfica indicada (composición)")]
	private int m_intDatatableLegendMaxWidthOneChart(Super2d3dGraph chart)
	{
		long num = 0L;
		long num2 = Information.UBound(chart.SeriesLegend);
		checked
		{
			long num5 = default(long);
			for (long num3 = num; num3 <= num2; num3++)
			{
				long num4 = (long)Math.Round(_g.MeasureString(chart.SeriesLegend[(int)num3], m_DataTableFont).Width);
				if (num4 > num5)
				{
					num5 = num4;
				}
			}
			return (int)num5;
		}
	}

	private int m_intDatatableLegendMaxWidth()
	{
		checked
		{
			int num2 = default(int);
			if (m_Charts.Count > 1)
			{
				int count = m_Charts.Count;
				for (int i = 1; i <= count; i++)
				{
					int num = m_intDatatableLegendMaxWidthOneChart((Super2d3dGraph)m_Charts[i]);
					if (num > m_intLegendMaxWidth())
					{
						num2 = num;
					}
				}
			}
			else
			{
				num2 = m_intDatatableLegendMaxWidthOneChart(this);
			}
			if (Operators.CompareString(m_DataTableAdditionalRowTitle, "", TextCompare: false) != 0)
			{
				int num3 = (int)Math.Round(_g.MeasureString(m_DataTableAdditionalRowTitle, m_DataTableFont).Width);
				if (num3 > num2)
				{
					num2 = num3;
				}
			}
			return num2;
		}
	}

	internal void m_RefreshGraphVertical(Rectangle r)
	{
		m_vcc = new ValueCaptionRenderer(_g, blnHorizontalChart: false, m_dblShowValuesMin, m_dblShowValuesMax);
		checked
		{
			int num = default(int);
			Rectangle rectangle = default(Rectangle);
			if (m_blnYAxis & (Operators.CompareString(m_YAxisTitle, "", TextCompare: false) != 0) & !m_blnIsPie())
			{
				num = (int)Math.Round(_g.MeasureString(m_YAxisTitle, m_YAxisTitleFont).Height);
				if ((m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT) | (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_BOTH))
				{
					rectangle = new Rectangle(r.Left, r.Top, r.Width, r.Height);
					r = new Rectangle(r.Left + num + 10, r.Top, r.Width - num - 10, r.Height);
				}
				if ((m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_RIGHT) | (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_BOTH))
				{
					rectangle = new Rectangle(r.Right - num, r.Top, num, r.Height);
					r = new Rectangle(r.Left, r.Top, r.Width - num - 10, r.Height);
				}
			}
			if (!m_blnIsPie())
			{
				int num2;
				if ((m_lngStyle == STYLE2D3D.STYLE2D_ACUM) | (m_lngStyle == STYLE2D3D.STYLE2D_ACUM_FIXED) | (m_lngStyle == STYLE2D3D.STYLE2D_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_ACUM_BAR))
				{
					num2 = (int)Math.Round(_g.MeasureString(m_dblSeriesMaxYAcum.ToString(m_YAxisNumericFormat), m_YAxisValuesFont).Width + 5f);
				}
				else
				{
					num2 = (int)Math.Round(_g.MeasureString(m_dblSeriesMaxY.ToString(m_YAxisNumericFormat), m_YAxisValuesFont).Width + 10f);
					int num3 = (int)Math.Round(_g.MeasureString(m_dblSeriesMinY.ToString(m_YAxisNumericFormat), m_YAxisValuesFont).Width + 10f);
					if (num3 > num2)
					{
						num2 = num3;
					}
				}
				if (m_blnCompositeMode)
				{
					r = m_rectChart;
				}
				else
				{
					if ((m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT) | (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_BOTH))
					{
						if (m_blnYAxis & (m_lngNumDividersY > 0))
						{
							if (m_YAxisLeftWidth == 0)
							{
								m_YAxisCurrentWidth = num2;
							}
							else
							{
								m_YAxisCurrentWidth = m_YAxisLeftWidth;
							}
						}
						else
						{
							m_YAxisCurrentWidth = 0;
						}
						r = new Rectangle(r.Left + m_YAxisCurrentWidth, r.Top, r.Width - m_YAxisCurrentWidth - m_YAxisRightWidth, r.Height);
					}
					if ((m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_RIGHT) | (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_BOTH))
					{
						if (m_blnYAxis)
						{
							num2 += rectangle.Width;
							if (m_YAxisRightWidth == 0)
							{
								m_YAxisCurrentWidth = num2;
							}
							else
							{
								m_YAxisCurrentWidth = m_YAxisRightWidth;
							}
						}
						r = new Rectangle(r.Left + m_YAxisLeftWidth, r.Top, r.Width - m_YAxisLeftWidth - m_YAxisCurrentWidth, r.Height);
					}
					if ((Operators.CompareString(m_XAxisTitle, "", TextCompare: false) != 0) & !m_blnIsPie())
					{
						StringFormat stringFormat = new StringFormat();
						stringFormat.Alignment = StringAlignment.Center;
						stringFormat.LineAlignment = StringAlignment.Near;
						int num4 = (int)Math.Round(_g.MeasureString(m_XAxisTitle, m_XAxisTitleFont).Height);
						if (!m_blnCompositeMode)
						{
							RectangleF rf = new RectangleF(r.Left, r.Bottom - num4 - 10, r.Width, num4);
							_g.DrawString(m_XAxisTitle, m_XAxisTitleFont, new SolidBrush(m_XAxisColor), rf, stringFormat);
						}
						r = new Rectangle(r.Left, r.Top, r.Width, r.Height - num4 - 20);
					}
					int num5 = 0;
					if (m_blnXAxis & (m_arrItemsLegend.Length > 0))
					{
						num5 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[0], m_XAxisValuesFont).Height);
						if (m_blnXAxisLabelsRotated90)
						{
							if ((m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME))
							{
								long num6 = (long)Math.Round(_g.MeasureString(m_XAxisMaxDateTime.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width);
								if (num6 > num5)
								{
									num5 = (int)num6;
								}
							}
							else if (m_XAxisScaleMode == SCALEMODE.SCALEMODE_FIXED_DATETIME)
							{
								long num6 = (long)Math.Round(_g.MeasureString(m_XAxisScaleMaximumDateTime.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width);
								if (num6 > num5)
								{
									num5 = (int)num6;
								}
							}
							else if ((m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_BUBBLE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE_DEV))
							{
								long num6 = (long)Math.Round(_g.MeasureString(m_dblSeriesMaxX.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width);
								if (num6 > num5)
								{
									num5 = (int)num6;
								}
							}
							else
							{
								int num7 = Information.UBound(m_arrItemsLegend);
								for (int i = 0; i <= num7; i++)
								{
									long num6 = (long)Math.Round(_g.MeasureString(m_arrItemsLegend[i], m_XAxisValuesFont).Width);
									if (num6 > num5)
									{
										num5 = (int)num6;
									}
								}
							}
						}
						else if (m_blnXAxisLabelsRotated)
						{
							if ((m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME))
							{
								long num8 = (long)Math.Round((double)_g.MeasureString(m_XAxisMaxDateTime.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width / 1.4142135623731);
								if (num8 > num5)
								{
									num5 = (int)num8;
								}
							}
							else if (m_XAxisScaleMode == SCALEMODE.SCALEMODE_FIXED_DATETIME)
							{
								long num8 = (long)Math.Round((double)_g.MeasureString(m_XAxisScaleMaximumDateTime.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width / 1.4142135623731);
								if (num8 > num5)
								{
									num5 = (int)num8;
								}
							}
							else if ((m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_BUBBLE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE_DEV))
							{
								long num8 = (long)Math.Round((double)_g.MeasureString(m_dblSeriesMaxX.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width / 1.4142135623731);
								if (num8 > num5)
								{
									num5 = (int)num8;
								}
							}
							else
							{
								int num9 = Information.UBound(m_arrItemsLegend);
								for (int j = 0; j <= num9; j++)
								{
									long num8 = (long)Math.Round((double)_g.MeasureString(m_arrItemsLegend[j], m_XAxisValuesFont).Width / 1.4142135623731);
									if (num8 > num5)
									{
										num5 = (int)num8;
									}
								}
							}
						}
						num5 = Math.Min(m_intXAxisHeight, num5);
						r = new Rectangle(r.Left, r.Top, r.Width, r.Height - num5 - 20);
					}
				}
				if (m_blnYAxis & (Operators.CompareString(m_YAxisTitle, "", TextCompare: false) != 0))
				{
					StringFormat stringFormat2 = new StringFormat();
					stringFormat2.FormatFlags = (StringFormatFlags)0;
					int num10 = (int)Math.Round(_g.MeasureString(m_YAxisTitle, m_YAxisTitleFont).Width + 10f);
					RectangleF rf = new RectangleF(rectangle.Left, (float)((double)r.Top + (double)r.Height / 2.0 + (double)num10 / 2.0), num10, num);
					_g.RotateTransform(270f);
					_g.TranslateTransform(rf.Left, rf.Top, MatrixOrder.Append);
					rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
					_g.DrawString(m_YAxisTitle, m_YAxisTitleFont, new SolidBrush(m_YAxisColor), rf, stringFormat2);
					_g.ResetTransform();
				}
				if (m_blnYAxis & (m_lngNumDividersY > 0) & (m_lngStyle < (STYLE2D3D)100))
				{
					StringFormat stringFormat3 = new StringFormat();
					Pen pen = new Pen(m_YAxisColor);
					pen.DashStyle = DashStyle.Dot;
					float num11 = (float)((double)r.Width / (double)m_lngNumX);
					if (!m_blnCompositeMode && m_WallsBackStyle != 0)
					{
						if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_SOLID)
						{
							_g.FillRectangle(new SolidBrush(m_WallsBackColorPrincipal), r);
						}
						else if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_GRADIENT)
						{
							_g.FillRectangle(new LinearGradientBrush(r, m_WallsBackColorPrincipal, m_WallsBackColorSecondary, LinearGradientMode.Vertical), r);
						}
						else if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_GRADIENT_INVERTED)
						{
							_g.FillRectangle(new LinearGradientBrush(r, m_WallsBackColorSecondary, m_WallsBackColorPrincipal, LinearGradientMode.Vertical), r);
						}
						else
						{
							int num12 = (int)m_lngNumDividersY;
							for (int num3 = 0; num3 <= num12; num3++)
							{
								float num13 = (float)((double)r.Bottom - (double)(num3 * r.Height) / (double)m_lngNumDividersY);
								if (num3 >= m_lngNumDividersY)
								{
									continue;
								}
								Color color = ((unchecked(num3 % 2) != 0) ? m_WallsBackColorSecondary : m_WallsBackColorPrincipal);
								if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_BANDS)
								{
									Rectangle r2 = Rectangle.FromLTRB(r.Left, (int)Math.Round((double)r.Bottom - (double)((num3 + 1) * r.Height) / (double)m_lngNumDividersY), r.Right, (int)Math.Round(num13));
									_g.FillRectangle(new SolidBrush(color), r2);
									continue;
								}
								int num14 = (int)(m_lngNumX - 1);
								for (int k = 0; k <= num14; k++)
								{
									float num15 = (float)r.Left + (float)k * num11;
									Rectangle r3 = Rectangle.FromLTRB((int)Math.Round(num15), (int)Math.Round((double)r.Bottom - (double)((num3 + 1) * r.Height) / (double)m_lngNumDividersY), (int)Math.Round((float)r.Left + (float)(k + 1) * num11), (int)Math.Round(num13));
									_g.FillRectangle(new SolidBrush(color), r3);
									unchecked
									{
										color = ((checked(k + num3) % 2 != 0) ? m_WallsBackColorPrincipal : m_WallsBackColorSecondary);
									}
								}
							}
						}
					}
					if ((m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT) | (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_BOTH))
					{
						stringFormat3.Alignment = StringAlignment.Far;
						stringFormat3.FormatFlags = StringFormatFlags.NoWrap;
						int num16 = (int)m_lngNumDividersY;
						for (int num3 = 0; num3 <= num16; num3++)
						{
							float num13 = (float)((double)r.Bottom - (double)(num3 * r.Height) / (double)m_lngNumDividersY);
							if (unchecked(m_blnShowDividersY || num3 == 0) | (num3 == m_lngNumDividersY))
							{
								_g.DrawLine(pen, r.Left - m_YAxisTickLength, num13, r.Left, num13);
								_g.DrawLine(m_GridLineStyle, r.Left + 1, num13, r.Right - 1, num13);
							}
							RectangleF rf = new RectangleF(r.Left - m_YAxisCurrentWidth - m_YAxisTickLength, num13 - 10f, m_YAxisCurrentWidth, 20f);
							float num17 = ((!((m_lngStyle == STYLE2D3D.STYLE2D_ACUM) | (m_lngStyle == STYLE2D3D.STYLE2D_ACUM_FIXED))) ? ((float)((double)num3 * m_dblSeriesRangeY / (double)m_lngNumDividersY + m_dblSeriesMinY)) : ((float)((double)num3 * m_dblSeriesRangeYAcum / (double)m_lngNumDividersY + m_dblSeriesMinYAcum)));
							if (m_blnYAxisLabelsRotated)
							{
								_g.TranslateTransform(rf.Left, rf.Top + 35f);
								_g.RotateTransform(-45f);
								rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
							}
							_g.DrawString(num17.ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(m_YAxisColor), rf, stringFormat3);
							_g.ResetTransform();
						}
					}
					if ((m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_RIGHT) | (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_BOTH))
					{
						stringFormat3.Alignment = StringAlignment.Near;
						stringFormat3.FormatFlags = StringFormatFlags.NoWrap;
						int num18 = (int)m_lngNumDividersY;
						for (int num3 = 0; num3 <= num18; num3++)
						{
							float num13 = (float)((double)r.Bottom - (double)(num3 * r.Height) / (double)m_lngNumDividersY);
							if (unchecked(m_blnShowDividersY || num3 == 0) | (num3 == m_lngNumDividersY))
							{
								if (m_blnCompositeMode)
								{
									_g.DrawLine(pen, r.Right, num13, r.Right + m_YAxisTickLength, num13);
								}
								else
								{
									_g.DrawLine(pen, r.Right, num13, r.Right + m_YAxisTickLength, num13);
									_g.DrawLine(m_GridLineStyle, r.Left + 1, num13, r.Right - 1, num13);
								}
							}
							RectangleF rf = new RectangleF(r.Right + 5, num13 - 10f, m_YAxisCurrentWidth, 20f);
							float num17 = ((!((m_lngStyle == STYLE2D3D.STYLE2D_ACUM) | (m_lngStyle == STYLE2D3D.STYLE2D_ACUM_FIXED))) ? ((float)((double)num3 * m_dblSeriesRangeY / (double)m_lngNumDividersY + m_dblSeriesMinY)) : ((float)((double)num3 * m_dblSeriesRangeYAcum / (double)m_lngNumDividersY + m_dblSeriesMinYAcum)));
							if (m_blnYAxisLabelsRotated)
							{
								_g.TranslateTransform(rf.Left, rf.Top + 35f);
								_g.RotateTransform(-45f);
								rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
							}
							_g.DrawString(num17.ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(m_YAxisColor), rf, stringFormat3);
							_g.ResetTransform();
						}
					}
				}
				if ((m_lngStyle < (STYLE2D3D)100) & !m_blnCompositeMode)
				{
					Pen pen2 = new Pen(m_XAxisColor);
					float num20;
					float num11;
					float num23 = default(float);
					int num19;
					if ((m_lngStyle == STYLE2D3D.STYLE2D_BUBBLE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE_DEV) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME))
					{
						if (m_lngNumDividersX != 0)
						{
							num19 = (int)m_lngNumDividersX;
							num20 = (float)((double)m_lngNumX / (double)m_lngNumDividersX);
						}
						else
						{
							num19 = (int)(m_lngNumX - 1);
							num20 = 1f;
						}
						num11 = (float)((double)r.Width / (double)num19);
						int num21 = num19 - 1;
						for (int num3 = 1; num3 <= num21; num3++)
						{
							float num22 = (float)r.Left + (float)num3 * num11;
							_g.DrawLine(pen2, num22, r.Bottom, num22, r.Bottom + 4);
						}
					}
					else
					{
						if (m_lngNumDividersX != 0)
						{
							num11 = (float)((double)r.Width / (double)m_lngNumDividersX);
							num23 = 0f;
							num20 = (float)((double)(m_lngNumX - 1) / (double)m_lngNumDividersX);
							num19 = (int)m_lngNumDividersX;
						}
						else
						{
							num23 = (float)((double)r.Width / (double)m_lngNumX);
							num11 = (float)((double)r.Width / (double)m_lngNumX);
							num20 = 1f;
							num19 = (int)(m_lngNumX - 1);
						}
						num19 = Math.Max(num19, 1);
					}
					if (m_blnShowDividersX)
					{
						int num24 = num19;
						for (int num3 = 1; num3 <= num24; num3++)
						{
							float num22 = (float)r.Left + (float)num3 * num11;
							_g.DrawLine(m_GridLineStyle, num22, r.Top + 1, num22, r.Bottom - 1);
						}
					}
					if (m_XAxisTickLength > 0)
					{
						int num25 = num19;
						for (int num3 = 1; num3 <= num25; num3++)
						{
							float num22 = (float)r.Left + (float)num3 * num11;
							_g.DrawLine(pen2, num22, r.Bottom + 1, num22, r.Bottom + m_XAxisTickLength);
						}
					}
					StringFormat stringFormat4 = new StringFormat();
					stringFormat4.FormatFlags = StringFormatFlags.NoClip;
					stringFormat4.Alignment = StringAlignment.Far;
					if ((m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME))
					{
						long ticks = m_XAxisMinDateTime.Ticks;
						long num26 = m_XAxisMaxDateTime.Ticks - ticks;
						if (m_blnXAxis)
						{
							int num3 = 0;
							if (m_blnXAxisLabelsRotated90)
							{
								int num27 = num19;
								for (num3 = 0; num3 <= num27; num3++)
								{
									DateTime dateTime = new DateTime((long)Math.Round((double)ticks + (double)(num3 * num26) / (double)num19));
									DateTime dateTime2 = dateTime;
									string text = dateTime2.ToString(m_XAxisNumericFormat);
									SizeF sizeF = _g.MeasureString(text, m_XAxisValuesFont);
									int val = (int)Math.Round(sizeF.Width + 10f);
									int num28 = (int)Math.Round(sizeF.Height);
									val = Math.Min(m_intXAxisHeight, val);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num23 / 2f, r.Bottom + 10, val, num28);
									_g.RotateTransform(270f);
									_g.TranslateTransform((float)((double)rf.Left - (double)num28 / 2.0), rf.Top + (float)val, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(text, m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									_g.ResetTransform();
								}
							}
							else if (m_blnXAxisLabelsRotated)
							{
								int num29 = num19;
								for (num3 = 0; num3 <= num29; num3++)
								{
									DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks + (double)(num3 * num26) / (double)num19));
									DateTime dateTime = dateTime2;
									string text = dateTime.ToString(m_XAxisNumericFormat);
									SizeF sizeF = _g.MeasureString(text, m_XAxisValuesFont);
									int num30 = (int)Math.Round(sizeF.Width + 10f);
									int num31 = (int)Math.Round(sizeF.Height + 100f);
									RectangleF rf = new RectangleF((float)((double)((float)r.Left + (float)num3 * num11 + num23 / 2f) - (double)num30 / 1.4142), (float)((double)(r.Bottom + 10) + (double)num30 / 1.4142), num30, num31);
									_g.RotateTransform(-45f);
									_g.TranslateTransform(rf.Left, rf.Top, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(text, m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									_g.ResetTransform();
								}
							}
							else
							{
								stringFormat4.Alignment = StringAlignment.Center;
								num3 = 0;
								int num32 = num19;
								for (num3 = 0; num3 <= num32; num3++)
								{
									DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks + (double)(num3 * num26) / (double)num19));
									DateTime dateTime = dateTime2;
									string text = dateTime.ToString(m_XAxisNumericFormat);
									float num33 = Math.Max(num23, _g.MeasureString(text, m_XAxisValuesFont).Width);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num23 / 2f - num33 / 2f, r.Bottom + 10, num33, 250f);
									_g.DrawString(text, m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									num3++;
								}
							}
						}
					}
					else if (XAxisScaleMode == SCALEMODE.SCALEMODE_FIXED_DATETIME)
					{
						long ticks2 = m_XAxisScaleMinimumDateTime.Ticks;
						long num34 = m_XAxisScaleMaximumDateTime.Ticks - ticks2;
						if (m_blnXAxis)
						{
							int num3 = 0;
							if (m_blnXAxisLabelsRotated90)
							{
								int num35 = num19;
								for (num3 = 0; num3 <= num35; num3++)
								{
									DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks2 + (double)(num3 * num34) / (double)num19));
									DateTime dateTime = dateTime2;
									string text2 = dateTime.ToString(m_XAxisNumericFormat);
									SizeF sizeF2 = _g.MeasureString(text2, m_XAxisValuesFont);
									int val2 = (int)Math.Round(sizeF2.Width + 10f);
									int num36 = (int)Math.Round(sizeF2.Height);
									val2 = Math.Min(m_intXAxisHeight, val2);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num23 / 2f, r.Bottom + 10, val2, num36);
									_g.RotateTransform(270f);
									_g.TranslateTransform((float)((double)rf.Left - (double)num36 / 2.0), rf.Top + (float)val2, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(text2, m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									_g.ResetTransform();
								}
							}
							else if (m_blnXAxisLabelsRotated)
							{
								int num37 = num19;
								for (num3 = 0; num3 <= num37; num3++)
								{
									DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks2 + (double)(num3 * num34) / (double)num19));
									DateTime dateTime = dateTime2;
									string text2 = dateTime.ToString(m_XAxisNumericFormat);
									SizeF sizeF2 = _g.MeasureString(text2, m_XAxisValuesFont);
									int num38 = (int)Math.Round(sizeF2.Width + 10f);
									int num39 = (int)Math.Round(sizeF2.Height + 100f);
									RectangleF rf = new RectangleF((float)((double)((float)r.Left + (float)num3 * num11 + num23 / 2f) - (double)num38 / 1.4142), (float)((double)(r.Bottom + 10) + (double)num38 / 1.4142), num38, num39);
									_g.RotateTransform(-45f);
									_g.TranslateTransform(rf.Left, rf.Top, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(text2, m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									_g.ResetTransform();
								}
							}
							else
							{
								stringFormat4.Alignment = StringAlignment.Center;
								num3 = 0;
								int num40 = num19;
								for (num3 = 0; num3 <= num40; num3++)
								{
									DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks2 + (double)(num3 * num34) / (double)num19));
									DateTime dateTime = dateTime2;
									string text2 = dateTime.ToString(m_XAxisNumericFormat);
									float num41 = Math.Max(num23, _g.MeasureString(text2, m_XAxisValuesFont).Width);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num23 / 2f - num41 / 2f, r.Bottom + 10, num41, 250f);
									_g.DrawString(text2, m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									num3++;
								}
							}
						}
					}
					else if ((m_lngStyle == STYLE2D3D.STYLE2D_BUBBLE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE_DEV))
					{
						if (m_blnXAxis)
						{
							if (m_blnXAxisLabelsRotated90)
							{
								int num42 = num19;
								for (int num3 = 0; num3 <= num42; num3++)
								{
									float num43 = Conversions.ToSingle((m_dblSeriesMinX + (double)num3 * m_dblSeriesRangeX / (double)num19).ToString(m_XAxisNumericFormat));
									SizeF sizeF3 = _g.MeasureString(Conversions.ToString(num43), m_XAxisValuesFont);
									int val3 = (int)Math.Round(sizeF3.Width + 10f);
									val3 = Math.Min(m_intXAxisHeight, val3);
									int num44 = (int)Math.Round(sizeF3.Height);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num23 / 2f, r.Bottom + 10, val3, num44);
									_g.RotateTransform(270f);
									_g.TranslateTransform((float)((double)rf.Left - (double)num44 / 2.0), rf.Top + (float)val3, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(Conversions.ToString(num43), m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									_g.ResetTransform();
								}
							}
							else if (m_blnXAxisLabelsRotated)
							{
								int num45 = num19;
								for (int num3 = 0; num3 <= num45; num3++)
								{
									float num43 = Conversions.ToSingle((m_dblSeriesMinX + (double)num3 * m_dblSeriesRangeX / (double)num19).ToString(m_XAxisNumericFormat));
									SizeF sizeF3 = _g.MeasureString(Conversions.ToString(num43), m_XAxisValuesFont);
									int val4 = (int)Math.Round(sizeF3.Width + 10f);
									val4 = Math.Min(m_intXAxisHeight, val4);
									int num46 = (int)Math.Round(sizeF3.Height + 100f);
									RectangleF rf = new RectangleF((float)((double)((float)r.Left + (float)num3 * num11) - (double)val4 / 1.4142), (float)((double)(r.Bottom + 10) + (double)val4 / 1.4142), val4, num46);
									_g.RotateTransform(-45f);
									_g.TranslateTransform(rf.Left, rf.Top, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(Conversions.ToString(num43), m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									_g.ResetTransform();
								}
							}
							else
							{
								stringFormat4.Alignment = StringAlignment.Center;
								int num47 = num19;
								for (int num3 = 0; num3 <= num47; num3++)
								{
									float num43 = Conversions.ToSingle((m_dblSeriesMinX + (double)num3 * m_dblSeriesRangeX / (double)num19).ToString(m_XAxisNumericFormat));
									RectangleF rf = new RectangleF((float)r.Left - num11 / 2f + (float)num3 * num11, r.Bottom + 10, num11, 250f);
									_g.DrawString(Conversions.ToString(num43), m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
								}
							}
						}
						if ((m_caption != null) & m_blnItemsLegendSet)
						{
							m_caption.Caption = m_arrItemsLegend[m_caption.itemIndex] + ": " + m_caption.get_Value(m_HotSpotNumericFormat);
						}
					}
					else
					{
						if (m_blnXAxis)
						{
							int num3 = 0;
							if (m_blnXAxisLabelsRotated90)
							{
								float limit = m_lngNumX - 1;
								float num48 = num20;
								for (float num22 = 0f; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num22, limit, num48); num22 += num48)
								{
									int val5 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)Math.Round(num22)], m_XAxisValuesFont).Width + 10f);
									val5 = Math.Min(m_intXAxisHeight, val5);
									int num49 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)Math.Round(num22)], m_XAxisValuesFont).Height);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num23 / 2f, r.Bottom + 10, val5, num49);
									_g.RotateTransform(270f);
									_g.TranslateTransform((float)((double)rf.Left - (double)num49 / 2.0), rf.Top + (float)val5, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(m_arrItemsLegend[(int)Math.Round(num22)], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									_g.ResetTransform();
									num3++;
								}
							}
							else if (m_blnXAxisLabelsRotated)
							{
								float limit2 = m_lngNumX - 1;
								float num50 = num20;
								for (float num22 = 0f; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num22, limit2, num50); num22 += num50)
								{
									int val6 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)Math.Round(num22)], m_XAxisValuesFont).Width + 10f);
									val6 = Math.Min(m_intXAxisHeight, val6);
									int num51 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)Math.Round(num22)], m_XAxisValuesFont).Height + 100f);
									RectangleF rf = new RectangleF((float)((double)((float)r.Left + (float)num3 * num11 + num23 / 2f) - (double)val6 / 1.4142), (float)((double)(r.Bottom + 10) + (double)val6 / 1.4142), val6, num51);
									_g.RotateTransform(-45f);
									_g.TranslateTransform(rf.Left, rf.Top, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(m_arrItemsLegend[(int)Math.Round(num22)], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									_g.ResetTransform();
									num3++;
								}
							}
							else
							{
								stringFormat4.Alignment = StringAlignment.Center;
								float num52 = num19;
								for (float num22 = 0f; num22 <= num52; num22 += 1f)
								{
									if ((float)m_arrItemsLegend.Length > Conversion.Int(num22 * num20))
									{
										float num53 = _g.MeasureString(m_arrItemsLegend[(int)Math.Round(Conversion.Int(num22 * num20))], m_XAxisValuesFont).Width;
										if (num53 > num23)
										{
											num53 = num23;
										}
										RectangleF rf = new RectangleF((float)r.Left + num22 * num11 + num23 / 2f - num53 / 2f, r.Bottom + 10, num53, 250f);
										_g.DrawString(m_arrItemsLegend[(int)Math.Round(Conversion.Int(num22 * num20))], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat4);
									}
								}
							}
						}
						if ((m_caption != null) & m_blnItemsLegendSet & (m_XAxisScaleMode == SCALEMODE.SCALEMODE_FIXED))
						{
							m_caption.Caption = m_arrItemsLegend[m_caption.itemIndex] + ": " + m_caption.get_Value(m_HotSpotNumericFormat);
						}
					}
				}
				else if ((m_lngStyle >= (STYLE2D3D)100) & !m_blnCompositeMode)
				{
					float num11;
					float num54;
					float num55;
					int val7;
					if (m_lngNumDividersX != 0)
					{
						num11 = ((float)r.Width - m_sngSlantX) / (float)(m_lngNumDividersX - 1);
						num54 = (float)((double)m_lngNumX / (double)m_lngNumDividersX);
						val7 = (int)(m_lngNumDividersX - 1);
						num55 = 0f;
					}
					else
					{
						num55 = ((float)r.Width - m_sngSlantX) / (float)m_lngNumX;
						num11 = ((float)r.Width - m_sngSlantX) / (float)m_lngNumX;
						num54 = 1f;
						val7 = (int)(m_lngNumX - 1);
					}
					val7 = Math.Max(val7, 1);
					if (m_blnXAxis)
					{
						StringFormat stringFormat5 = new StringFormat();
						stringFormat5.FormatFlags = StringFormatFlags.NoClip;
						stringFormat5.Alignment = StringAlignment.Far;
						if (XAxisScaleMode == SCALEMODE.SCALEMODE_FIXED_DATETIME)
						{
							long ticks3 = m_XAxisScaleMinimumDateTime.Ticks;
							long num56 = m_XAxisScaleMaximumDateTime.Ticks - ticks3;
							int num3 = 0;
							if (m_blnXAxisLabelsRotated90)
							{
								int num57 = val7;
								for (num3 = 0; num3 <= num57; num3++)
								{
									DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks3 + (double)(num3 * num56) / (double)val7));
									DateTime dateTime = dateTime2;
									string text3 = dateTime.ToString(XAxisNumericFormat);
									SizeF sizeF4 = _g.MeasureString(text3, m_XAxisValuesFont);
									int val8 = (int)Math.Round(sizeF4.Width + 10f);
									int num58 = (int)Math.Round(sizeF4.Height);
									val8 = Math.Min(m_intXAxisHeight, val8);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num55 / 2f, r.Bottom + 10, val8, num58);
									_g.RotateTransform(270f);
									_g.TranslateTransform((float)((double)rf.Left - (double)num58 / 2.0), rf.Top + (float)val8, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(text3, m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat5);
									_g.ResetTransform();
								}
							}
							else if (m_blnXAxisLabelsRotated)
							{
								int num59 = val7;
								for (num3 = 0; num3 <= num59; num3++)
								{
									DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks3 + (double)(num3 * num56) / (double)val7));
									DateTime dateTime = dateTime2;
									string text3 = dateTime.ToString(XAxisNumericFormat);
									SizeF sizeF4 = _g.MeasureString(text3, m_XAxisValuesFont);
									int num60 = (int)Math.Round(sizeF4.Width + 10f);
									int num61 = (int)Math.Round(sizeF4.Height + 100f);
									RectangleF rf = new RectangleF((float)((double)((float)r.Left + (float)num3 * num11 + num55 / 2f) - (double)num60 / 1.4142), (float)((double)(r.Bottom + 10) + (double)num60 / 1.4142), num60, num61);
									_g.RotateTransform(-45f);
									_g.TranslateTransform(rf.Left, rf.Top, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(text3, m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat5);
									_g.ResetTransform();
								}
							}
							else
							{
								stringFormat5.Alignment = StringAlignment.Center;
								num3 = 0;
								int num62 = val7;
								for (num3 = 0; num3 <= num62; num3++)
								{
									DateTime dateTime2 = new DateTime((long)Math.Round((double)ticks3 + (double)(num3 * num56) / (double)val7));
									DateTime dateTime = dateTime2;
									string text3 = dateTime.ToString(XAxisNumericFormat);
									float num63 = Math.Max(num55, _g.MeasureString(text3, m_XAxisValuesFont).Width);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num55 / 2f - num63 / 2f, r.Bottom + 10, num63, 250f);
									_g.DrawString(text3, m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat5);
									num3++;
								}
							}
						}
						else
						{
							int num3 = 0;
							if (m_blnXAxisLabelsRotated90)
							{
								float limit3 = m_lngNumX - 1;
								float num64 = num54;
								for (float num65 = 0f; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num65, limit3, num64); num65 += num64)
								{
									int val9 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)Math.Round(num65)], m_XAxisValuesFont).Width + 10f);
									val9 = Math.Min(m_intXAxisHeight, val9);
									int num66 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)Math.Round(num65)], m_XAxisValuesFont).Height);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num55 / 2f, r.Bottom + 10, val9, num66);
									_g.RotateTransform(270f);
									_g.TranslateTransform((float)((double)rf.Left - (double)num66 / 2.0), rf.Top + (float)val9, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(m_arrItemsLegend[(int)Math.Round(num65)], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat5);
									_g.ResetTransform();
									num3++;
								}
							}
							else if (m_blnXAxisLabelsRotated)
							{
								float limit4 = m_lngNumX - 1;
								float num67 = num54;
								for (float num65 = 0f; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num65, limit4, num67); num65 += num67)
								{
									int val10 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)Math.Round(num65)], m_XAxisValuesFont).Width + 10f);
									val10 = Math.Min(m_intXAxisHeight, val10);
									int num68 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)Math.Round(num65)], m_XAxisValuesFont).Height + 100f);
									RectangleF rf = new RectangleF((float)((double)((float)r.Left + (float)num3 * num11 + num55 / 2f) - (double)val10 / 1.4142), (float)((double)(r.Bottom + 10) + (double)val10 / 1.4142), val10, num68);
									_g.RotateTransform(-45f);
									_g.TranslateTransform(rf.Left, rf.Top, MatrixOrder.Append);
									rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
									_g.DrawString(m_arrItemsLegend[(int)Math.Round(num65)], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat5);
									_g.ResetTransform();
									num3++;
								}
							}
							else
							{
								stringFormat5.Alignment = StringAlignment.Center;
								num3 = 0;
								float limit5 = m_lngNumX - 1;
								float num69 = num54;
								for (float num65 = 0f; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num65, limit5, num69); num65 += num69)
								{
									float num70 = Math.Max(num55, _g.MeasureString(m_arrItemsLegend[(int)Math.Round(num65)], m_XAxisValuesFont).Width);
									RectangleF rf = new RectangleF((float)r.Left + (float)num3 * num11 + num55 / 2f - num70 / 2f, r.Bottom + 10, num70, 250f);
									_g.DrawString(m_arrItemsLegend[(int)Math.Round(num65)], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat5);
									num3++;
								}
							}
						}
					}
				}
			}
			m_rectChart = r;
			if (m_arrSeries != null)
			{
				if (m_GridBackgroundImage != null)
				{
					if (m_GridBackgroundImageTransparency > 0)
					{
						float[][] newColorMatrix = new float[5][]
						{
							new float[5] { 1f, 0f, 0f, 0f, 0f },
							new float[5] { 0f, 1f, 0f, 0f, 0f },
							new float[5] { 0f, 0f, 1f, 0f, 0f },
							new float[5]
							{
								0f,
								0f,
								0f,
								(float)((double)m_GridBackgroundImageTransparency / 100.0),
								0f
							},
							new float[5] { 0f, 0f, 0f, 0f, 1f }
						};
						ColorMatrix newColorMatrix2 = new ColorMatrix(newColorMatrix);
						ImageAttributes imageAttributes = new ImageAttributes();
						imageAttributes.SetColorMatrix(newColorMatrix2, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
						_g.g.DrawImage(m_GridBackgroundImage, r, 0, 0, m_GridBackgroundImage.Width, m_GridBackgroundImage.Height, GraphicsUnit.Pixel, imageAttributes);
					}
					else
					{
						_g.g.DrawImage(m_GridBackgroundImage, r);
					}
				}
				if ((m_lngStyle < STYLE2D3D.STYLE3D_ACUM_BAR) & !m_blnIsPie() & (m_lngNumDividersY > 0))
				{
					Pen pen3 = new Pen(m_YAxisColor);
					_g.DrawLine(pen3, r.Left, r.Top, r.Left, r.Bottom);
					_g.DrawLine(pen3, r.Right, r.Top, r.Right, r.Bottom);
					pen3 = new Pen(m_XAxisColor);
					_g.DrawLine(pen3, r.Left, r.Top, r.Right, r.Top);
					_g.DrawLine(pen3, r.Left, r.Bottom, r.Right, r.Bottom);
				}
				if (m_lngStyle < (STYLE2D3D)100)
				{
					_g.g.SetClip(r);
				}
				int seriesDimensions = SeriesDimensions;
				if (seriesDimensions == 1)
				{
					switch (m_lngStyle)
					{
					case STYLE2D3D.STYLE2D_BAR:
						m_DrawBarGraph(r);
						break;
					case STYLE2D3D.STYLE2D_ACUM:
						m_DrawAcumGraph(r);
						break;
					case STYLE2D3D.STYLE2D_ACUM_FIXED:
						m_DrawAcumFixedGraph(r);
						break;
					case STYLE2D3D.STYLE2D_LINE:
						m_DrawLineGraph(r);
						break;
					case STYLE2D3D.STYLE2D_SPLINE:
						m_DrawSplineGraph(r);
						break;
					case STYLE2D3D.STYLE2D_POINT:
						m_DrawPointGraph(r);
						break;
					case STYLE2D3D.STYLE2D_STACKED_AREA:
						m_DrawAreaGraph(r);
						break;
					case STYLE2D3D.STYLE2D_SPLINE_AREA:
						m_DrawSplineAreaGraph(r);
						break;
					case STYLE2D3D.STYLE2D_PIE:
						m_DrawPieGraph(r);
						break;
					case STYLE2D3D.STYLE3D_ACUM_BAR:
						m_DrawBarGraph3D(r);
						break;
					case STYLE2D3D.STYLE3D_STACKED_BAR:
						m_DrawStackedBarGraph3D(r);
						break;
					case STYLE2D3D.STYLE3D_STACKED_COLUMN:
						m_DrawStackedColumnGraph3D(r);
						break;
					case STYLE2D3D.STYLE3D_LINE:
						m_DrawLineGraph3d(r);
						break;
					case STYLE2D3D.STYLE3D_STACKED_AREA:
						m_DrawStackedAreaGraph3d(r);
						break;
					case STYLE2D3D.STYLE3D_COLUMN:
						m_DrawColumnGraph3D(r);
						break;
					case STYLE2D3D.STYLE3D_PIE:
						m_DrawPieGraph3d(r);
						break;
					case STYLE2D3D.STYLE2D_PYRAMID:
						m_DrawPyramidGraph(r);
						break;
					case STYLE2D3D.STYLE2D_PICTURES:
						m_DrawPictureGraph(r);
						break;
					case STYLE2D3D.STYLE2D_DOUGHNUT:
						m_DrawDoughnutGraph(r);
						break;
					case STYLE2D3D.STYLE3D_DOUGHNUT:
						m_DrawDoughnutGraph3d(r);
						break;
					case STYLE2D3D.STYLE2D_CYLINDER:
						m_DrawCylinderGraph(r);
						break;
					case STYLE2D3D.STYLE3D_CYLINDER:
						m_DrawCylinderGraph3D(r);
						break;
					case STYLE2D3D.STYLE3D_SPLINE:
						m_DrawSplineGraph3D(r);
						break;
					case STYLE2D3D.STYLE3D_SPLINE_AREA:
						m_DrawSplineArea3D(r);
						break;
					case STYLE2D3D.STYLE2D_ROUNDED_BAR:
						m_DrawRoundedBarGraph(r);
						break;
					case STYLE2D3D.STYLE3D_SPLINE_STACKED_AREA:
						m_DrawSplineStackedArea3D(r);
						break;
					case STYLE2D3D.STYLE2D_RADAR:
						m_DrawRadarGraph(r);
						break;
					}
				}
				else
				{
					switch (m_lngStyle)
					{
					case STYLE2D3D.STYLE2D_HIGHLOW:
						if (seriesDimensions >= 2)
						{
							m_DrawHighLow(r);
						}
						break;
					case STYLE2D3D.STYLE2D_XY:
						if (seriesDimensions >= 2)
						{
							m_DrawScatterGraph(r);
						}
						break;
					case STYLE2D3D.STYLE2D_XY_LINE:
						if (seriesDimensions >= 2)
						{
							m_DrawScatterLines(r);
						}
						break;
					case STYLE2D3D.STYLE2D_XY_DATETIME:
						if (seriesDimensions >= 2)
						{
							m_DrawScatterDateTimeGraph(r);
						}
						break;
					case STYLE2D3D.STYLE2D_XY_SPLINE:
						if (seriesDimensions >= 2)
						{
							m_DrawScatterSplineGraph(r);
						}
						break;
					case STYLE2D3D.STYLE2D_XY_SPLINE_DEV:
						if (seriesDimensions >= 2)
						{
							m_DrawScatterSplineDevGraph(r);
						}
						break;
					case STYLE2D3D.STYLE2D_XY_LINE_DATETIME:
						if (seriesDimensions >= 2)
						{
							m_DrawLineDateTimeGraph(r);
						}
						break;
					case STYLE2D3D.STYLE2D_HIGHLOWCLOSE:
						if (seriesDimensions >= 3)
						{
							m_DrawHighLowClose(r);
						}
						break;
					case STYLE2D3D.STYLE2D_BUBBLE:
						if (seriesDimensions >= 3)
						{
							m_DrawBubbleGraph(r);
						}
						break;
					case STYLE2D3D.STYLE2D_CANDLESTICK:
						if (seriesDimensions >= 4)
						{
							m_DrawCandleStick(r);
						}
						break;
					}
				}
				_g.g.ResetClip();
			}
			if (Information.IsArray(m_YAxisIndicators))
			{
				StringFormat stringFormat6 = new StringFormat();
				stringFormat6.Alignment = StringAlignment.Center;
				stringFormat6.LineAlignment = StringAlignment.Center;
				int num71 = (int)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
				int num72 = Information.UBound(m_YAxisIndicators);
				for (int num3 = 0; num3 <= num72; num3++)
				{
					int num73 = (int)Math.Round(((double)m_YAxisIndicators[num3].Value - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Height - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
					_g.DrawLine(m_YAxisIndicators[num3].LineStyle, r.Left, num71 - num73, r.Right, num71 - num73);
					if (Operators.CompareString(m_YAxisIndicators[num3].Caption, "", TextCompare: false) != 0)
					{
						RectangleF rf = ((m_YAxisLocation != 0) ? new RectangleF(r.Right + 5, num71 - num73 - 10, m_YAxisCurrentWidth - 10, 20f) : new RectangleF(r.Left - m_YAxisCurrentWidth - 5, num71 - num73 - 10, m_YAxisCurrentWidth, 20f));
						if (m_YAxisIndicators[num3].CaptionStyle == STYLECAPTION.STYLECAPTION_ROUNDED_SQUARE)
						{
							RoundedRectangle roundedRectangle = new RoundedRectangle(_g, rf, 0.7f);
							roundedRectangle.Render(m_YAxisIndicators[num3].CaptionColor, m_YAxisIndicators[num3].CaptionBackColor);
						}
						_g.DrawString(m_YAxisIndicators[num3].Caption, m_YAxisIndicators[num3].CaptionFont, new SolidBrush(m_YAxisIndicators[num3].CaptionColor), rf, stringFormat6);
					}
				}
			}
			if (!m_blnIsPie() & (m_lngStyle < (STYLE2D3D)100) & m_blnSurface & (m_dblSeriesMinY < 0.0) & (m_dblSeriesMaxY > 0.0))
			{
				int num74 = (int)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
				int num75 = (int)Math.Round((double)num74 - ((0.0 - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Height - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
				RectangleF r4 = new RectangleF(r.Left, num75, r.Width, r.Bottom - num75);
				_g.FillRectangle(m_SurfaceBrushStyle, r4);
				_g.DrawLine(new Pen(Color.Black), r.Left, num75, r.Right, num75);
			}
			if ((m_CalculationStyle != CALCULATION.CALCULATION_NONE) & ((m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE_DEV) | (m_lngStyle == STYLE2D3D.STYLE2D_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_POINT) | (m_lngStyle == STYLE2D3D.STYLE2D_PICTURES) | (m_lngStyle == STYLE2D3D.STYLE2D_PYRAMID) | (m_lngStyle == STYLE2D3D.STYLE2D_CYLINDER) | (m_lngStyle == STYLE2D3D.STYLE2D_ROUNDED_BAR)))
			{
				m_DrawCalculationVertical(r);
			}
			if (m_blnShowValues)
			{
				ValueCaptionRenderer vcc = m_vcc;
				bool blnShowDisplacementLine = (m_lngStyle != STYLE2D3D.STYLE2D_LINE) & (m_lngStyle != STYLE2D3D.STYLE2D_POINT) & (m_lngStyle != STYLE2D3D.STYLE2D_SPLINE) & (m_lngStyle != STYLE2D3D.STYLE3D_LINE) & (m_lngStyle != STYLE2D3D.STYLE3D_SPLINE) & (m_lngStyle != STYLE2D3D.STYLE3D_SPLINE_AREA) & (m_lngStyle != STYLE2D3D.STYLE3D_SPLINE_STACKED_AREA);
				Rectangle rectChart = r;
				ArrayList itemsSelected = m_ItemsSelected;
				Super2d3dGraph chart = this;
				vcc.Render(blnShowDisplacementLine, rectChart, itemsSelected, ref chart);
			}
			m_vcc.HighlightSelection(this);
		}
	}

	private void m_DrawBarGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		float num = m_sngSeriesGap / 2f;
		if (m_lngNumX == 0)
		{
			return;
		}
		long num2 = Information.UBound(m_arrSeries);
		float num3 = (float)((double)r.Width / (double)m_lngNumX);
		checked
		{
			long num4 = (long)Math.Round(num3 * ((1f - m_sngSeriesGap) / (float)(num2 + 1)));
			if (num4 < 1)
			{
				num4 = 1L;
			}
			long num5 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			if (m_blnShadow)
			{
				long num6 = 0L;
				long num7 = num2;
				for (long num8 = num6; num8 <= num7; num8++)
				{
					long num9 = 0L;
					IEnumerator enumerator = m_arrSeries[(int)num8].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							if (enumerator.Current != null)
							{
								int serieIndex = (int)num8;
								int itemIndex = (int)num9;
								bool blnSombraTransparente = true;
								float percentage = 0.2f;
								m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
								num9 = itemIndex;
								num8 = serieIndex;
								float num10 = (float)(r.Left + num4 * num8) + num3 * num + (float)num9 * num3;
								long num11 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
								if (num11 < 0)
								{
									Rectangle rectangle = new Rectangle((int)Math.Round(num10), (int)num5, (int)num4, (int)(-num11));
									m_DrawRectShadow(rectangle, c2a, c1a);
								}
								else
								{
									if (num11 == 0)
									{
										num11 = 1L;
									}
									Rectangle rectangle = new Rectangle((int)Math.Round(num10), (int)(num5 - num11), (int)num4, (int)num11);
									m_DrawRectShadow(rectangle, c1a, c2a);
								}
							}
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
						num9++;
					}
				}
			}
			long num12 = 0L;
			long num13 = num2;
			for (long num8 = num12; num8 <= num13; num8++)
			{
				long num9 = 0L;
				IEnumerator enumerator = m_arrSeries[(int)num8].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							int itemIndex = (int)num8;
							int serieIndex = (int)num9;
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref itemIndex, ref serieIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							num9 = serieIndex;
							num8 = itemIndex;
							float num10 = (float)(r.Left + num4 * num8) + num3 * num + (float)num9 * num3;
							long num11 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							Rectangle rectangle;
							if (num11 < 0)
							{
								rectangle = new Rectangle((int)Math.Round(num10), (int)num5, (int)num4, (int)(-num11));
								_g.FillRectangle(new LinearGradientBrush(rectangle, c2, c, LinearGradientMode.Vertical), rectangle);
							}
							else
							{
								if (num11 == 0)
								{
									num11 = 1L;
								}
								rectangle = new Rectangle((int)Math.Round(num10), (int)(num5 - num11), (int)num4, (int)num11);
								if (m_blnSeriesFillStyleSet)
								{
									if (Information.IsArray(m_arrSeriesFillStyle) && Information.UBound(m_arrSeriesFillStyle) >= num8)
									{
										_g.FillRectangle(m_arrSeriesFillStyle[(int)num8], rectangle);
									}
								}
								else
								{
									_g.FillRectangle(new LinearGradientBrush(rectangle, c, c2, LinearGradientMode.Vertical), rectangle);
								}
							}
							_g.DrawRectangle(m_arrSeriesBorderStyle[(int)num8], rectangle);
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaption valueCaption2;
								if (num11 < 0)
								{
									itemIndex = (int)num8;
									serieIndex = (int)num9;
									percentage = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngPosY = rectangle.Top - num11 + 10;
									string value = Conversions.ToString(enumerator.Current);
									float sngHotSpotX = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotY = rectangle.Top - num11;
									ValueCaption valueCaption = new ValueCaption(ref itemIndex, ref serieIndex, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
									num9 = serieIndex;
									num8 = itemIndex;
									valueCaption2 = valueCaption;
								}
								else
								{
									itemIndex = (int)num8;
									serieIndex = (int)num9;
									float sngHotSpotY = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotX = rectangle.Top - 10;
									string value2 = Conversions.ToString(enumerator.Current);
									float sngPosY = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									percentage = rectangle.Top;
									ValueCaption valueCaption3 = new ValueCaption(ref itemIndex, ref serieIndex, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage);
									num9 = serieIndex;
									num8 = itemIndex;
									valueCaption2 = valueCaption3;
								}
								valueCaption2.AddZoneRectangle(ref rectangle);
								m_vcc.AddCaption(valueCaption2);
							}
						}
						num9++;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawCandleStick(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		float num2 = (float)((double)r.Width / (double)m_lngNumX);
		checked
		{
			float num3 = (float)Math.Max((double)num2 * (0.75 / (double)(num + 1)), 1.0);
			long num4 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			if (m_blnShadow)
			{
				int num5 = num;
				for (int i = 0; i <= num5; i++)
				{
					float num6 = (float)((double)((float)r.Left + num3 * (float)i) + (double)num2 * 0.125);
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
							{
								return;
							}
							if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 3 }, null), NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), TextCompare: false))
							{
								m_CalculateColorRampFromColor(ControlPaint.Light(m_arrSeriesColor[i], 0.2f), ref c, ref c2, ref c1a, ref c2a, blnSombraTransparente: true);
							}
							else
							{
								m_CalculateColorRampFromColor(ControlPaint.Dark(m_arrSeriesColor[i], 0.2f), ref c, ref c2, ref c1a, ref c2a, blnSombraTransparente: true);
							}
							long num7 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							long num8 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							long num9 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							long num10 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 3 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							Rectangle rectangle;
							if (num9 > num10)
							{
								rectangle = new Rectangle((int)Math.Round(num6), (int)(num4 - num9), (int)Math.Round(num3), (int)(num9 - num10));
							}
							else
							{
								if (num9 == num10)
								{
									num10++;
								}
								rectangle = new Rectangle((int)Math.Round(num6), (int)(num4 - num10), (int)Math.Round(num3), (int)(num10 - num9));
							}
							m_DrawRectShadow(rectangle, c, c2);
							num6 += num2;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							MessageBox.Show(ex2.ToString());
							ProjectData.ClearProjectError();
						}
					}
				}
			}
			int num11 = num;
			for (int i = 0; i <= num11; i++)
			{
				float num6 = (float)((double)((float)r.Left + num3 * (float)i) + (double)num2 * 0.125);
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 3 }, null), NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), TextCompare: false))
						{
							m_CalculateColorRampFromColor(ControlPaint.Light(m_arrSeriesColor[i], 0.2f), ref c, ref c2, ref c1a, ref c2a, blnSombraTransparente: true);
						}
						else
						{
							m_CalculateColorRampFromColor(ControlPaint.Dark(m_arrSeriesColor[i], 0.2f), ref c, ref c2, ref c1a, ref c2a, blnSombraTransparente: true);
						}
						long num7 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						long num8 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						long num9 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						long num10 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 3 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						Rectangle rectangle;
						if (num9 > num10)
						{
							rectangle = new Rectangle((int)Math.Round(num6), (int)(num4 - num9), (int)Math.Round(num3), (int)(num9 - num10));
						}
						else
						{
							if (num9 == num10)
							{
								num10++;
							}
							rectangle = new Rectangle((int)Math.Round(num6), (int)(num4 - num10), (int)Math.Round(num3), (int)(num10 - num9));
						}
						_g.DrawLine(new Pen(Color.Black, 2f), (float)((double)rectangle.Left + (double)rectangle.Width / 2.0), num4 - num7, (float)((double)rectangle.Left + (double)rectangle.Width / 2.0), num4 - num8);
						_g.FillRectangle(new LinearGradientBrush(rectangle, c2, c, LinearGradientMode.Vertical), rectangle);
						_g.DrawRectangle(m_arrSeriesBorderStyle[i], rectangle);
						if (m_blnShowValues | m_blnHotSpots)
						{
							ValueCaption valueCaption;
							if (m_ValuesLocationStyle == STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE)
							{
								float sngPosX = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
								float sngPosY = (float)((double)rectangle.Top + (double)rectangle.Height / 2.0);
								valueCaption = new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref sngPosY, Conversions.ToSingle(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 3 }, null), NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null))));
							}
							else if (Operators.ConditionalCompareObjectLess(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 3 }, null), NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), TextCompare: false))
							{
								float sngPosY = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
								float sngPosX = num4 - num7 + 10;
								string value = Conversions.ToString(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 3 }, null), NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)));
								float sngHotSpotX = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
								float sngHotSpotY = num4 - num10;
								valueCaption = new ValueCaption(ref i, ref itemIndex, ref sngPosY, ref sngPosX, value, ref sngHotSpotX, ref sngHotSpotY);
							}
							else
							{
								float sngHotSpotY = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
								float sngHotSpotX = num4 - num8 - 10;
								string value2 = Conversions.ToString(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 3 }, null), NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)));
								float sngPosY = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
								float sngPosX = num4 - num10;
								valueCaption = new ValueCaption(ref i, ref itemIndex, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref sngPosX);
							}
							valueCaption.AddZoneRectangle(ref rectangle);
							m_vcc.AddCaption(valueCaption);
						}
						itemIndex++;
						num6 += num2;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						MessageBox.Show(ex4.ToString());
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawHighLowClose(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		float num2 = (float)((double)r.Width / (double)m_lngNumX);
		checked
		{
			float num3 = (float)((double)num2 * (0.75 / (double)(num + 1)));
			long num4 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			long num5 = 0L;
			long num6 = num;
			for (long num7 = num5; num7 <= num6; num7++)
			{
				float num8 = (float)((double)((float)r.Left + num3 * (float)num7) + (double)num2 * 0.125);
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						long num9 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						long num10 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						long num11 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						_g.DrawLine(new Pen(m_arrSeriesColor[(int)num7], 2f), num8 + num3 / 2f, num4 - num9, num8 + num3 / 2f, num4 - num10);
						_g.DrawLine(new Pen(m_arrSeriesColor[(int)num7], 2f), num8 + num3 / 2f, num4 - num11, (float)((double)num8 + (double)num3 / 1.5), num4 - num11);
						if (m_blnShowValues | m_blnHotSpots)
						{
							ValueCaptionRenderer vcc = m_vcc;
							int seriesIndex = (int)num7;
							float sngPosX = num8 + num3 / 2f;
							float sngPosY = num4 - num9 + 10;
							string value = Conversions.ToString(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null));
							float sngHotSpotX = num8 + num3 / 2f;
							float sngHotSpotY = num4 - num11;
							ValueCaption vc = new ValueCaption(ref seriesIndex, ref itemIndex, ref sngPosX, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
							num7 = seriesIndex;
							vcc.AddCaption(vc);
						}
						itemIndex++;
						num8 += num2;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						MessageBox.Show(ex2.ToString());
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawHighLow(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		float num2 = (float)((double)r.Width / (double)m_lngNumX);
		checked
		{
			float num3 = (float)((double)num2 * (0.75 / (double)(num + 1)));
			float num4 = (float)((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			Pen pen = new Pen(Color.Black, 2f);
			long num5 = 0L;
			long num6 = num;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (long num7 = num5; num7 <= num6; num7++)
			{
				float num8 = (float)((double)((float)r.Left + num3 * (float)num7) + (double)num2 * 0.125);
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						int serieIndex = (int)num7;
						bool blnSombraTransparente = true;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						num7 = serieIndex;
						float num9 = Conversions.ToSingle(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						float num10 = Conversions.ToSingle(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						float num11;
						if (num9 < num10)
						{
							num11 = num10 - num9;
						}
						else
						{
							num11 = num9 - num10;
							num10 = num9;
						}
						if (num11 < 1f)
						{
							num11 = 1f;
						}
						Rectangle rectangle = new Rectangle((int)Math.Round(num8 + num3 / 2f - get_m_sngCalcThickness(num3) / 2f), (int)Math.Round(num4 - num10), (int)Math.Round(get_m_sngCalcThickness(num3)), (int)Math.Round(num11));
						_g.FillRectangle(new LinearGradientBrush(rectangle, c, c2, LinearGradientMode.Vertical), rectangle);
						m_DrawRectShadow(rectangle, c1a, c2a);
						num8 += num2;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			stringFormat.Alignment = StringAlignment.Center;
			long num12 = 0L;
			long num13 = num;
			for (long num7 = num12; num7 <= num13; num7++)
			{
				float num8 = (float)((double)((float)r.Left + num3 * (float)num7) + (double)num2 * 0.125);
				int itemIndex2 = 0;
				IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						int serieIndex = (int)num7;
						bool blnSombraTransparente = true;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex2, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						num7 = serieIndex;
						float num9 = Conversions.ToSingle(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						float num10 = Conversions.ToSingle(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						float num11;
						if (num9 < num10)
						{
							num11 = num10 - num9;
						}
						else
						{
							num11 = num9 - num10;
							num10 = num9;
						}
						if (num11 < 1f)
						{
							num11 = 1f;
						}
						Rectangle rectangle = new Rectangle((int)Math.Round(num8 + num3 / 2f - get_m_sngCalcThickness(num3) / 2f), (int)Math.Round(num4 - num10), (int)Math.Round(get_m_sngCalcThickness(num3)), (int)Math.Round(num11));
						_g.FillRectangle(new LinearGradientBrush(rectangle, c, c2, LinearGradientMode.Vertical), rectangle);
						_g.DrawRectangle(m_arrSeriesBorderStyle[(int)num7], rectangle);
						if (m_blnShowValues | m_blnHotSpots)
						{
							int seriesIndex = (int)num7;
							int itemIndex3 = itemIndex2;
							float sngPosX = num8 + num3 / 2f;
							float sngPosY = num4 - num10 - 10f;
							string value = Conversion.Val(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null))).ToString(m_strValuesFormat) + " / " + Conversion.Val(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null))).ToString(m_strValuesFormat);
							float sngHotSpotX = num8 + num3 / 2f;
							float sngHotSpotY = num4 - num10;
							percentage = 0f;
							float sngYDisplacementDirection = 0f;
							ValueCaption valueCaption = new ValueCaption(seriesIndex, itemIndex3, sngPosX, sngPosY, value, 0.0, sngHotSpotX, sngHotSpotY, ref percentage, ref sngYDisplacementDirection);
							valueCaption.AddZoneRectangle(ref rectangle);
							m_vcc.AddCaption(valueCaption);
						}
						itemIndex2++;
						num8 += num2;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawScatterGraph(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round((double)r.Left + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width);
			long num3 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			int num4 = num;
			for (int i = 0; i <= num4; i++)
			{
				int num5 = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						float num6 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), num2));
						float num7 = Conversions.ToSingle(Operators.SubtractObject(num3, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
						m_DrawPoint(num6, num7, i);
						if (m_blnShowValues | m_blnHotSpots)
						{
							ValueCaptionRenderer vcc = m_vcc;
							int seriesIndex = i;
							int itemIndex = num5;
							float sngPosY = num7 - 15f;
							string value = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_strValuesFormat);
							float sngXDisplacementDirection = 0f;
							float sngYDisplacementDirection = 0f;
							vcc.AddCaption(new ValueCaption(seriesIndex, itemIndex, num6, sngPosY, value, 0.0, num6, num7, ref sngXDisplacementDirection, ref sngYDisplacementDirection));
						}
						num5++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawScatterSplineGraph(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round((double)r.Left + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width);
			long num3 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			int num4 = num;
			for (int i = 0; i <= num4; i++)
			{
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				int num5 = 0;
				int num6 = m_arrSeries[i].Count - 1;
				Point[] array = new Point[num6 + 1];
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						float num7 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), num2));
						float num8 = Conversions.ToSingle(Operators.SubtractObject(num3, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
						if (m_blnShowPoints)
						{
							m_DrawPoint(num7, num8, i);
						}
						ref Point reference = ref array[num5];
						reference = new Point((int)Math.Round(num7), (int)Math.Round(num8));
						if (m_blnShowValues | m_blnHotSpots)
						{
							ValueCaptionRenderer vcc = m_vcc;
							int seriesIndex = i;
							int itemIndex = num5;
							float sngPosY = num8 - 15f;
							string value = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_strValuesFormat);
							double numericValue = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null));
							float sngXDisplacementDirection = 0f;
							float sngYDisplacementDirection = 0f;
							vcc.AddCaption(new ValueCaption(seriesIndex, itemIndex, num7, sngPosY, value, numericValue, num7, num8, ref sngXDisplacementDirection, ref sngYDisplacementDirection));
						}
						num5++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				if (num6 > 0)
				{
					_g.DrawCurve(m_arrSeriesLineStyle[i], array);
				}
			}
		}
	}

	private void m_DrawScatterLines(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round((double)r.Left + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width);
			long num3 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			int num4 = num;
			for (int i = 0; i <= num4; i++)
			{
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				int num5 = 0;
				int num6 = m_arrSeries[i].Count - 1;
				Point[] array = new Point[num6 + 1];
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						float num7 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), num2));
						float num8 = Conversions.ToSingle(Operators.SubtractObject(num3, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
						if (m_blnShowPoints)
						{
							m_DrawPoint(num7, num8, i);
						}
						ref Point reference = ref array[num5];
						reference = new Point((int)Math.Round(num7), (int)Math.Round(num8));
						if (m_blnShowValues | m_blnHotSpots)
						{
							ValueCaptionRenderer vcc = m_vcc;
							int seriesIndex = i;
							int itemIndex = num5;
							float sngPosY = num8 - 15f;
							string value = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_strValuesFormat);
							float sngXDisplacementDirection = 0f;
							float sngYDisplacementDirection = 0f;
							vcc.AddCaption(new ValueCaption(seriesIndex, itemIndex, num7, sngPosY, value, 0.0, num7, num8, ref sngXDisplacementDirection, ref sngYDisplacementDirection));
						}
						num5++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				if (num6 > 0)
				{
					GraphicsPath graphicsPath = new GraphicsPath();
					graphicsPath.AddLines(array);
					_g.DrawPath(m_arrSeriesLineStyle[i], graphicsPath);
				}
			}
		}
	}

	private void m_DrawScatterSplineDevGraph(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		checked
		{
			Point[] array = new Point[(int)(m_lngNumX - 1) + 1];
			int num = Information.UBound(m_arrSeries);
			long num2 = (long)Math.Round((double)r.Left + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width);
			long num3 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			int num4 = num;
			for (int i = 0; i <= num4; i++)
			{
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				int num5 = 0;
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						float num6 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), num2));
						float num7 = Conversions.ToSingle(Operators.SubtractObject(num3, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
						float num8 = Conversions.ToSingle(Operators.MultiplyObject(Operators.DivideObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesRangeY), r.Height));
						_g.DrawLine(new Pen(m_arrSeriesColor[i]), num6, num7 + num8, num6, num7 - num8);
						_g.DrawLine(new Pen(m_arrSeriesColor[i]), num6 - (float)m_PointSize - 1f, num7 + num8, num6 + (float)m_PointSize + 1f, num7 + num8);
						_g.DrawLine(new Pen(m_arrSeriesColor[i]), num6 - (float)m_PointSize - 1f, num7 - num8, num6 + (float)m_PointSize + 1f, num7 - num8);
						ref Point reference = ref array[num5];
						reference = new Point((int)Math.Round(num6), (int)Math.Round(num7));
						if (m_blnShowValues | m_blnHotSpots)
						{
							ValueCaptionRenderer vcc = m_vcc;
							int seriesIndex = i;
							int itemIndex = num5;
							float sngPosX = num6;
							float sngPosY = num7 - 15f;
							string value = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_HotSpotNumericFormat) + ": " + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_HotSpotNumericFormat) + " +/- " + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)).ToString(m_HotSpotNumericFormat);
							float sngHotSpotX = num6;
							float sngHotSpotY = num7;
							float sngXDisplacementDirection = 0f;
							float sngYDisplacementDirection = 0f;
							vcc.AddCaption(new ValueCaption(seriesIndex, itemIndex, sngPosX, sngPosY, value, 0.0, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref sngYDisplacementDirection));
						}
						num5++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				_g.DrawCurve(m_arrSeriesLineStyle[i], array);
				if (m_blnShowPoints)
				{
					int num9 = num5 - 1;
					for (int j = 0; j <= num9; j++)
					{
						float num6 = array[j].X;
						float num7 = array[j].Y;
						m_DrawPoint(num6, num7, i);
					}
				}
			}
		}
	}

	private void m_DrawScatterDateTimeGraph(Rectangle r)
	{
		checked
		{
			long num = m_XAxisMaxDateTime.Ticks - m_XAxisMinDateTime.Ticks;
			if (m_lngNumX == 0)
			{
				return;
			}
			int num2 = Information.UBound(m_arrSeries);
			long num3 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			int num4 = num2;
			for (int i = 0; i <= num4; i++)
			{
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				int itemIndex = 0;
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						if (NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null) != null)
						{
							float sngPosX = Conversions.ToSingle(Operators.AddObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), null, "Ticks", new object[0], null, null, null), m_XAxisMinDateTime.Ticks), num), r.Width), r.Left));
							float sngHotSpotY = Conversions.ToSingle(Operators.SubtractObject(num3, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
							m_DrawPoint(sngPosX, sngHotSpotY, i);
							if (m_blnShowValues | m_blnHotSpots)
							{
								float sngPosY = sngHotSpotY - 15f;
								ValueCaption valueCaption = new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref sngPosY, Conversions.ToString(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)), ref sngPosX, ref sngHotSpotY);
								valueCaption.Caption = Conversions.ToDate(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_HotSpotDateTimeFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_HotSpotNumericFormat);
								m_vcc.AddCaption(valueCaption);
							}
						}
						itemIndex++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawLineDateTimeGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		checked
		{
			long num = m_XAxisMaxDateTime.Ticks - m_XAxisMinDateTime.Ticks;
			if (m_lngNumX == 0)
			{
				return;
			}
			long num2 = Information.UBound(m_arrSeries);
			int num3 = (int)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			long num4 = 0L;
			long num5 = num2;
			float x = default(float);
			for (long num6 = num4; num6 <= num5; num6++)
			{
				float num7 = -1f;
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[(int)num6].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							if (NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null) != null)
							{
								float sngPosX = Conversions.ToSingle(Operators.AddObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), null, "Ticks", new object[0], null, null, null), m_XAxisMinDateTime.Ticks), num), r.Width), r.Left));
								float sngHotSpotY = Conversions.ToSingle(Operators.SubtractObject(num3, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
								if (num7 == -1f)
								{
									num7 = sngHotSpotY;
									x = sngPosX;
								}
								Pen pen = new Pen(m_arrSeriesColor[(int)num6]);
								pen.DashStyle = m_arrSeriesLineStyle[(int)num6].DashStyle;
								pen.Width = m_arrSeriesLineStyle[(int)num6].Width;
								_g.DrawLine(pen, x, num7, sngPosX, sngHotSpotY);
								x = sngPosX;
								num7 = sngHotSpotY;
								if (m_blnShowValues | m_blnHotSpots)
								{
									ValueCaption valueCaption2;
									if (num7 < sngHotSpotY)
									{
										int seriesIndex = (int)num6;
										float sngPosY = sngHotSpotY - 10f;
										ValueCaption valueCaption = new ValueCaption(ref seriesIndex, ref itemIndex, ref sngPosX, ref sngPosY, Conversions.ToString(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)), ref sngPosX, ref sngHotSpotY);
										num6 = seriesIndex;
										valueCaption2 = valueCaption;
									}
									else
									{
										int seriesIndex = (int)num6;
										float sngPosY = sngHotSpotY + 15f;
										ValueCaption valueCaption3 = new ValueCaption(ref seriesIndex, ref itemIndex, ref sngPosX, ref sngPosY, Conversions.ToString(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)), ref sngPosX, ref sngHotSpotY);
										num6 = seriesIndex;
										valueCaption2 = valueCaption3;
									}
									valueCaption2.Caption = Conversions.ToDate(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_HotSpotDateTimeFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_HotSpotNumericFormat);
									m_vcc.AddCaption(valueCaption2);
								}
							}
							else
							{
								num7 = -1f;
							}
						}
						itemIndex++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			if (!m_blnShowPoints)
			{
				return;
			}
			long num8 = 0L;
			long num9 = num2;
			for (long num6 = num8; num6 <= num9; num6++)
			{
				IEnumerator enumerator = m_arrSeries[(int)num6].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						float sngPosX = Conversions.ToSingle(Operators.AddObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), null, "Ticks", new object[0], null, null, null), m_XAxisMinDateTime.Ticks), num), r.Width), r.Left));
						float sngHotSpotY = Conversions.ToSingle(Operators.SubtractObject(num3, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
						m_DrawPoint(sngPosX, sngHotSpotY, (int)num6);
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawBubbleGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		float num = _g.MeasureString(m_dblSeriesMaxZ.ToString("N"), m_ValuesFont).Width;
		int num2 = Information.UBound(m_arrSeries);
		float num3 = (float)((double)r.Width / (double)m_lngNumX);
		checked
		{
			float num4 = (float)((double)num3 * (0.75 / (double)(num2 + 1)));
			long num5 = (long)Math.Round((double)r.Left + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width);
			long num6 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			stringFormat.Alignment = StringAlignment.Far;
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			int num7 = num2;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (int i = 0; i <= num7; i++)
			{
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						bool blnSombraTransparente = true;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						float sngPosX = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), num5));
						float sngHotSpotY = Conversions.ToSingle(Operators.SubtractObject(num6, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
						object left = m_BubbleMaxRadius;
						Type typeFromHandle = typeof(Math);
						object[] array = new object[1];
						object current = enumerator.Current;
						object[] array2 = new object[1];
						object[] array3 = array2;
						int num8 = 2;
						array3[0] = num8;
						array[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(current, array2, null));
						object[] array4 = array;
						bool[] array5 = new bool[1] { true };
						object right = NewLateBinding.LateGet(null, typeFromHandle, "Abs", array4, null, null, array5);
						if (array5[0])
						{
							NewLateBinding.LateIndexSetComplex(current, new object[2]
							{
								num8,
								RuntimeHelpers.GetObjectValue(array4[0])
							}, null, OptimisticSet: true, RValueBase: true);
						}
						float num9 = Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(left, right), m_dblSeriesRangeZ));
						if (num9 < 1f)
						{
							num9 = 3f;
						}
						Rectangle r2 = new Rectangle((int)Math.Round(sngPosX - num9 / 2f), (int)Math.Round(sngHotSpotY - num9 / 2f), (int)Math.Round(num9), (int)Math.Round(num9));
						if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), 0, TextCompare: false))
						{
							if (m_blnShadow)
							{
								GraphicsPath graphicsPath = new GraphicsPath();
								Rectangle rectangle = Rectangle.FromLTRB(r2.X, r2.Y, r2.Right, r2.Bottom);
								rectangle.Offset(5, 5);
								graphicsPath.AddEllipse(rectangle);
								PathGradientBrush pathGradientBrush = new PathGradientBrush(graphicsPath);
								pathGradientBrush.SurroundColors = new Color[1] { c1a };
								pathGradientBrush.CenterColor = c2a;
								_g.FillBubble(pathGradientBrush, rectangle);
							}
							GraphicsPath graphicsPath2 = new GraphicsPath();
							graphicsPath2.AddEllipse(r2);
							PathGradientBrush pathGradientBrush2 = new PathGradientBrush(graphicsPath2);
							PointF centerPoint = new PointF(sngPosX - num9 / 4f, sngHotSpotY - num9 / 4f);
							pathGradientBrush2.CenterPoint = centerPoint;
							pathGradientBrush2.SurroundColors = new Color[1] { c };
							pathGradientBrush2.CenterColor = c2;
							_g.FillBubble(pathGradientBrush2, r2);
						}
						else
						{
							_g.FillBubble(new SolidBrush(Color.White), r2);
						}
						_g.DrawEllipse(new Pen(Color.FromArgb(32, 0, 0, 0)), r2);
						if (m_blnShowValues | m_blnHotSpots)
						{
							ValueCaption valueCaption;
							if (num9 > num)
							{
								valueCaption = new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref sngHotSpotY, Conversions.ToSingle(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)));
							}
							else
							{
								percentage = sngHotSpotY - 15f - num9 / 2f;
								valueCaption = new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref percentage, Conversions.ToString(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)), ref sngPosX, ref sngHotSpotY);
							}
							valueCaption.AddZoneCircle(ref r2);
							m_vcc.AddCaption(valueCaption);
						}
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
					itemIndex++;
				}
			}
		}
	}

	private void m_DrawAcumGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		float num2 = (float)((double)r.Width / (double)m_lngNumX);
		float num3 = get_m_sngCalcThickness(num2);
		stringFormat.Alignment = StringAlignment.Center;
		stringFormat.LineAlignment = StringAlignment.Center;
		checked
		{
			double[] array = new double[(int)m_lngNumX + 1];
			int num4 = num;
			for (int i = 0; i <= num4; i++)
			{
				int num5 = -1;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						num5++;
						double num6;
						if (m_arrSeriesSum[num5] != 0.0)
						{
							num6 = Conversions.ToDouble(Operators.MultiplyObject(Operators.DivideObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), m_arrSeriesSum[num5]), r.Height));
							if (num6 <= 0.0)
							{
								num6 = 0.0;
							}
						}
						else
						{
							num6 = 0.0;
						}
						double[] array2 = array;
						double[] array3 = array2;
						int num7 = num5;
						array3[num7] = array2[num7] + num6;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			if (m_blnShadow)
			{
				double[] array4 = (double[])array.Clone();
				int num8 = num;
				for (int i = 0; i <= num8; i++)
				{
					float num9 = (float)r.Left + num2 / 2f - num3 / 2f;
					int num5 = -1;
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							num5++;
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref i, ref num5, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							double num6;
							if (m_arrSeriesSum[num5] != 0.0)
							{
								num6 = Conversions.ToDouble(Operators.MultiplyObject(Operators.DivideObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), m_arrSeriesSum[num5]), r.Height));
								if (num6 <= 0.0)
								{
									num6 = 0.0;
								}
							}
							else
							{
								num6 = 0.0;
							}
							if ((int)Math.Round(num6) > 0)
							{
								Rectangle rectangle = new Rectangle((int)Math.Round(num9), (int)Math.Round((double)r.Bottom - array4[num5]), (int)Math.Round(num3), (int)Math.Round(num6));
								m_DrawRectShadow(rectangle, c, c2);
							}
							double[] array2 = array4;
							double[] array5 = array2;
							int num7 = num5;
							array5[num7] = array2[num7] - num6;
							num9 += num2;
						}
						catch (Exception ex3)
						{
							ProjectData.SetProjectError(ex3);
							Exception ex4 = ex3;
							ProjectData.ClearProjectError();
						}
					}
				}
			}
			int num10 = num;
			for (int i = 0; i <= num10; i++)
			{
				float num9 = (float)r.Left + num2 / 2f - num3 / 2f;
				int num5 = -1;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						num5++;
						bool blnSombraTransparente = true;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref i, ref num5, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						double num6;
						if (m_arrSeriesSum[num5] != 0.0)
						{
							num6 = Conversions.ToDouble(Operators.MultiplyObject(Operators.DivideObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), m_arrSeriesSum[num5]), r.Height));
							if (num6 <= 0.0)
							{
								num6 = 0.0;
							}
						}
						else
						{
							num6 = 0.0;
						}
						if ((int)Math.Round(num6) > 0)
						{
							Rectangle rectangle = new Rectangle((int)Math.Round(num9), (int)Math.Round((double)r.Bottom - array[num5]), (int)Math.Round(num3), (int)Math.Round(num6));
							_g.FillRectangle(new LinearGradientBrush(rectangle, c, c2, LinearGradientMode.Vertical), rectangle);
							_g.DrawRectangle(m_arrSeriesBorderStyle[i], rectangle);
							if (m_blnShowValues | m_blnHotSpots)
							{
								percentage = num9 + num3 / 2f;
								float sngPosY = (float)((double)r.Bottom - array[num5] + num6 / 2.0);
								ValueCaption valueCaption = new ValueCaption(ref i, ref num5, ref percentage, ref sngPosY, Math.Abs(Conversions.ToSingle(enumerator.Current)));
								valueCaption.AddZoneRectangle(ref rectangle);
								m_vcc.AddCaption(valueCaption);
							}
						}
						double[] array2 = array;
						double[] array6 = array2;
						int num7 = num5;
						array6[num7] = array2[num7] - num6;
						num9 += num2;
					}
					catch (Exception ex5)
					{
						ProjectData.SetProjectError(ex5);
						Exception ex6 = ex5;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawAcumFixedGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		float num2 = (float)((double)r.Width / (double)m_lngNumX);
		float num3 = get_m_sngCalcThickness(num2);
		stringFormat.Alignment = StringAlignment.Center;
		stringFormat.LineAlignment = StringAlignment.Center;
		checked
		{
			double[] array = new double[(int)m_lngNumX + 1];
			int num4 = num;
			for (int i = 0; i <= num4; i++)
			{
				int num5 = -1;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						num5++;
						if (m_dblSeriesMaxYAcum != 0.0)
						{
							double num6 = Conversions.ToDouble(Operators.MultiplyObject(Operators.DivideObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), m_dblSeriesMaxYAcum), r.Height));
							if (num6 > 0.0)
							{
								double[] array2 = array;
								double[] array3 = array2;
								int num7 = num5;
								array3[num7] = array2[num7] + num6;
							}
						}
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			if (m_blnShadow)
			{
				double[] array4 = (double[])array.Clone();
				int num8 = num;
				for (int i = 0; i <= num8; i++)
				{
					float num9 = (float)r.Left + num2 / 2f - num3 / 2f;
					int num5 = -1;
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							num5++;
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref i, ref num5, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							if (m_dblSeriesMaxYAcum != 0.0)
							{
								double num6 = Conversions.ToDouble(Operators.MultiplyObject(Operators.DivideObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), m_dblSeriesMaxYAcum), r.Height));
								if (num6 > 0.0)
								{
									Rectangle rectangle = new Rectangle((int)Math.Round(num9), (int)Math.Round((double)r.Bottom - array4[num5]), (int)Math.Round(num3), (int)Math.Round(num6));
									m_DrawRectShadow(rectangle, c, c2);
									double[] array2 = array4;
									double[] array5 = array2;
									int num7 = num5;
									array5[num7] = array2[num7] - num6;
								}
							}
							num9 += num2;
						}
						catch (Exception ex3)
						{
							ProjectData.SetProjectError(ex3);
							Exception ex4 = ex3;
							ProjectData.ClearProjectError();
						}
					}
				}
			}
			int num10 = num;
			for (int i = 0; i <= num10; i++)
			{
				float num9 = (float)r.Left + num2 / 2f - num3 / 2f;
				int num5 = -1;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						num5++;
						bool blnSombraTransparente = true;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref i, ref num5, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						if (m_dblSeriesMaxYAcum != 0.0)
						{
							double num6 = Conversions.ToDouble(Operators.MultiplyObject(Operators.DivideObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), m_dblSeriesMaxYAcum), r.Height));
							if ((int)Math.Round(num6) > 0)
							{
								Rectangle rectangle = new Rectangle((int)Math.Round(num9), (int)Math.Round((double)r.Bottom - array[num5]), (int)Math.Round(num3), (int)Math.Round(num6));
								_g.FillRectangle(new LinearGradientBrush(rectangle, c, c2, LinearGradientMode.Vertical), rectangle);
								_g.DrawRectangle(m_arrSeriesBorderStyle[i], rectangle);
								if (m_blnShowValues | m_blnHotSpots)
								{
									percentage = num9 + num3 / 2f;
									float sngPosY = (float)((double)r.Bottom - array[num5] + num6 / 2.0);
									ValueCaption valueCaption = new ValueCaption(ref i, ref num5, ref percentage, ref sngPosY, Math.Abs(Conversions.ToSingle(enumerator.Current)));
									valueCaption.AddZoneRectangle(ref rectangle);
									m_vcc.AddCaption(valueCaption);
								}
								double[] array2 = array;
								double[] array6 = array2;
								int num7 = num5;
								array6[num7] = array2[num7] - num6;
							}
						}
						num9 += num2;
					}
					catch (Exception ex5)
					{
						ProjectData.SetProjectError(ex5);
						Exception ex6 = ex5;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawLineGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		checked
		{
			int num2 = (int)Math.Round(_g.MeasureString("0", m_ValuesFont).Height);
			float num3 = default(float);
			if (m_lngNumX > 1)
			{
				num3 = (float)((double)r.Width / (double)m_lngNumX);
			}
			long num4 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			long num5 = 0L;
			long num6 = num;
			for (long num7 = num5; num7 <= num6; num7++)
			{
				float num8 = (float)r.Left + num3 / 2f;
				float x = num8;
				long num9 = long.MinValue;
				long num10 = 0L;
				IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							num8 = (float)((double)((float)r.Left + num3 / 2f) + (double)num10 * ((double)r.Width / (double)m_lngNumX));
							long num11 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							if (num9 != long.MinValue)
							{
								_g.DrawLine(m_arrSeriesLineStyle[(int)num7], x, num4 - num9, num8, num4 - num11);
							}
							x = num8;
							if (m_blnShowValues | m_blnHotSpots)
							{
								if (num9 < num11)
								{
									ValueCaptionRenderer vcc = m_vcc;
									int seriesIndex = (int)num7;
									int itemIndex = (int)num10;
									float sngPosY = (float)((double)(num4 - num11 - m_PointSize) - (double)num2 / 2.0 - 5.0);
									string value = Conversions.ToString(enumerator.Current);
									float sngHotSpotY = num4 - num11;
									ValueCaption vc = new ValueCaption(ref seriesIndex, ref itemIndex, ref num8, ref sngPosY, value, ref num8, ref sngHotSpotY);
									num10 = itemIndex;
									num7 = seriesIndex;
									vcc.AddCaption(vc);
								}
								else
								{
									ValueCaptionRenderer vcc2 = m_vcc;
									int itemIndex = (int)num7;
									int seriesIndex = (int)num10;
									float sngHotSpotY = (float)((double)(num4 - num11 + m_PointSize) + (double)num2 / 2.0 + 5.0);
									string value2 = Conversions.ToString(enumerator.Current);
									float sngPosY = num4 - num11;
									ValueCaption vc2 = new ValueCaption(ref itemIndex, ref seriesIndex, ref num8, ref sngHotSpotY, value2, ref num8, ref sngPosY);
									num10 = seriesIndex;
									num7 = itemIndex;
									vcc2.AddCaption(vc2);
								}
							}
							num9 = num11;
						}
						num10++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			if (!m_blnShowPoints)
			{
				return;
			}
			long num12 = 0L;
			long num13 = num;
			for (long num7 = num12; num7 <= num13; num7++)
			{
				float num8 = (float)r.Left + num3 / 2f;
				IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							long num11 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							m_DrawPoint(num8, num4 - num11, (int)num7);
						}
						num8 += num3;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawSplineGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		float num2 = default(float);
		if (m_lngNumX > 1)
		{
			num2 = (float)((double)r.Width / (double)m_lngNumX);
		}
		checked
		{
			long num3 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			Point[] array = new Point[(int)(m_lngNumX - 1) + 1];
			int num4 = num;
			for (int i = 0; i <= num4; i++)
			{
				long num5 = -1L;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				int itemIndex = 0;
				while (enumerator.MoveNext())
				{
					try
					{
						float sngPosX = (float)r.Left + num2 / 2f + num2 * (float)itemIndex;
						long num6 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						ref Point reference = ref array[itemIndex];
						reference = new Point((int)Math.Round(sngPosX), (int)(num3 - num6));
						if (m_blnShowValues | m_blnHotSpots)
						{
							if (num5 < num6)
							{
								ValueCaptionRenderer vcc = m_vcc;
								float sngPosY = num3 - num6 - 10;
								string value = Conversions.ToString(enumerator.Current);
								float sngHotSpotY = num3 - num6;
								vcc.AddCaption(new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref sngPosY, value, ref sngPosX, ref sngHotSpotY));
							}
							else
							{
								ValueCaptionRenderer vcc2 = m_vcc;
								float sngHotSpotY = num3 - num6 + 15;
								string value2 = Conversions.ToString(enumerator.Current);
								float sngPosY = num3 - num6;
								vcc2.AddCaption(new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref sngHotSpotY, value2, ref sngPosX, ref sngPosY));
							}
						}
						itemIndex++;
						num5 = num6;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				_g.DrawCurve(m_arrSeriesLineStyle[i], array);
			}
			if (!m_blnShowPoints)
			{
				return;
			}
			int num7 = num;
			for (int i = 0; i <= num7; i++)
			{
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						float sngPosX = (float)r.Left + num2 / 2f + num2 * (float)itemIndex;
						long num6 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						m_DrawPoint(sngPosX, num3 - num6, i);
						itemIndex++;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawSplineAreaGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		float num2 = default(float);
		if (m_lngNumX > 1)
		{
			num2 = (float)((double)r.Width / (double)m_lngNumX);
		}
		checked
		{
			long num3 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			Point[] array = new Point[(int)(m_lngNumX - 1) + 1];
			for (int i = num; i >= 0; i += -1)
			{
				long num4 = -1L;
				IEnumerator enumerator = m_arrSeriesAcum[i].GetEnumerator();
				int itemIndex = -1;
				while (enumerator.MoveNext())
				{
					try
					{
						itemIndex++;
						float sngPosX = (float)r.Left + num2 / 2f + num2 * (float)itemIndex;
						long num5 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinYAcum), m_dblSeriesRangeYAcum), r.Height), m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)r.Height));
						ref Point reference = ref array[itemIndex];
						reference = new Point((int)Math.Round(sngPosX), (int)(num3 - num5));
						if (m_blnShowValues | m_blnHotSpots)
						{
							if (num4 < num5)
							{
								ValueCaptionRenderer vcc = m_vcc;
								float sngPosY = num3 - num5 - 10;
								string value = Conversions.ToString(enumerator.Current);
								float sngHotSpotY = num3 - num5;
								vcc.AddCaption(new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref sngPosY, value, ref sngPosX, ref sngHotSpotY));
							}
							else
							{
								ValueCaptionRenderer vcc2 = m_vcc;
								float sngHotSpotY = num3 - num5 + 15;
								string value2 = Conversions.ToString(enumerator.Current);
								float sngPosY = num3 - num5;
								vcc2.AddCaption(new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref sngHotSpotY, value2, ref sngPosX, ref sngPosY));
							}
						}
						num4 = num5;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				GraphicsPath graphicsPath = new GraphicsPath();
				graphicsPath.AddCurve(array);
				PointF pt = array[itemIndex];
				PointF pt2 = new PointF(array[itemIndex].X, r.Bottom);
				graphicsPath.AddLine(pt, pt2);
				pt2 = new PointF(array[itemIndex].X, r.Bottom);
				PointF pt3 = pt2;
				PointF pt4 = new PointF(array[0].X, r.Bottom);
				graphicsPath.AddLine(pt3, pt4);
				graphicsPath.CloseFigure();
				_g.FillPath(m_arrSeriesFillStyle[i], graphicsPath);
				_g.DrawCurve(m_arrSeriesLineStyle[i], array);
			}
			if (!m_blnShowPoints)
			{
				return;
			}
			int num6 = num;
			for (int i = 0; i <= num6; i++)
			{
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeriesAcum[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						float sngPosX = (float)r.Left + num2 / 2f + num2 * (float)itemIndex;
						long num5 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinYAcum), m_dblSeriesRangeYAcum), r.Height), m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)r.Height));
						m_DrawPoint(sngPosX, num3 - num5, i);
						itemIndex++;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawSplineGraph3D(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = default(long);
			if (m_lngNumX > 1)
			{
				num2 = (long)Math.Round(((float)r.Width - m_sngSlantX) / (float)(m_lngNumX - 1));
			}
			float num3 = m_sngSlantX / (float)(num + 1);
			float num4 = m_sngSlantY / (float)(num + 1);
			m_DrawGrid3d_Start(r, num2, blnAcum: true);
			Point[] array = new Point[(int)(m_lngNumX - 1) + 1];
			Point[] array2 = new Point[(int)(m_lngNumX - 1) + 1];
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (long num5 = num; num5 >= 0; num5 += -1)
			{
				long num6 = (long)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY));
				num6 = (long)Math.Round((float)num6 + (float)(num - num5 + 1) * m_sngSlantY / (float)(num + 1));
				long num7 = (long)Math.Round((float)r.Left + m_sngSlantX);
				num7 = (long)Math.Round((float)num7 - (float)(num - num5 + 1) * m_sngSlantX / (float)(num + 1));
				long num8 = -1L;
				IEnumerator enumerator = m_arrSeries[(int)num5].GetEnumerator();
				long num9 = 0L;
				while (enumerator.MoveNext())
				{
					try
					{
						int serieIndex = (int)num5;
						int itemIndex = (int)num9;
						bool blnSombraTransparente = false;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						num9 = itemIndex;
						num5 = serieIndex;
						long num10 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), (float)r.Height - m_sngSlantY), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY)));
						ref Point reference = ref array[(int)num9];
						reference = new Point((int)num7, (int)(num6 - num10));
						if (m_blnShowValues | m_blnHotSpots)
						{
							if (num8 < num10)
							{
								ValueCaptionRenderer vcc = m_vcc;
								itemIndex = (int)num5;
								serieIndex = (int)num9;
								percentage = num7;
								float sngPosY = num6 - num10 - 10;
								string value = Conversions.ToString(enumerator.Current);
								float sngHotSpotX = num7;
								float sngHotSpotY = num6 - num10;
								ValueCaption vc = new ValueCaption(ref itemIndex, ref serieIndex, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
								num7 = (long)Math.Round(sngHotSpotX);
								num7 = (long)Math.Round(percentage);
								num9 = serieIndex;
								num5 = itemIndex;
								vcc.AddCaption(vc);
							}
							else
							{
								ValueCaptionRenderer vcc2 = m_vcc;
								itemIndex = (int)num5;
								serieIndex = (int)num9;
								float sngHotSpotY = num7;
								float sngHotSpotX = num6 - num10 + 15;
								string value2 = Conversions.ToString(enumerator.Current);
								float sngPosY = num7;
								percentage = num6 - num10;
								ValueCaption vc2 = new ValueCaption(ref itemIndex, ref serieIndex, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage);
								num7 = (long)Math.Round(sngPosY);
								num7 = (long)Math.Round(sngHotSpotY);
								num9 = serieIndex;
								num5 = itemIndex;
								vcc2.AddCaption(vc2);
							}
						}
						num8 = num10;
						num9++;
						num7 += num2;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				GraphicsPath graphicsPath = new GraphicsPath();
				graphicsPath.AddCurve(array);
				long num11 = 0L;
				long num12 = Information.UBound(array);
				for (num9 = num11; num9 <= num12; num9++)
				{
					ref Point reference2 = ref array2[(int)num9];
					reference2 = array[(int)(Information.UBound(array) - num9)];
					array2[(int)num9].Offset((int)Math.Round(num3), (int)Math.Round(0f - num4));
				}
				graphicsPath.AddLine(array[(int)(m_lngNumX - 1)], array2[0]);
				graphicsPath.AddCurve(array2);
				graphicsPath.AddLine(array2[(int)(m_lngNumX - 1)], array[0]);
				_g.FillPath(new LinearGradientBrush(r, c, c2, LinearGradientMode.Vertical), graphicsPath);
				_g.DrawPath(new Pen(Color.FromArgb(128, 0, 0, 0)), graphicsPath);
			}
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawSplineArea3D(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		checked
		{
			float num2 = default(float);
			if (m_lngNumX > 1)
			{
				num2 = ((float)r.Width - m_sngSlantX) / (float)(m_lngNumX - 1);
			}
			float num3 = m_sngSlantX / (float)(num + 1);
			float num4 = m_sngSlantY / (float)(num + 1);
			m_DrawGrid3d_Start(r, num2, blnAcum: true);
			Point[] array = new Point[(int)(m_lngNumX - 1) + 1];
			Point[] array2 = new Point[(int)(m_lngNumX - 1) + 1];
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (long num5 = num; num5 >= 0; num5 += -1)
			{
				long num6 = (long)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY));
				num6 = (long)Math.Round((float)num6 + (float)(num - num5 + 1) * m_sngSlantY / (float)(num + 1));
				float num7 = (float)r.Left + m_sngSlantX;
				num7 -= (float)(num - num5 + 1) * m_sngSlantX / (float)(num + 1);
				long num8 = -1L;
				IEnumerator enumerator = m_arrSeries[(int)num5].GetEnumerator();
				long num9 = 0L;
				while (enumerator.MoveNext())
				{
					try
					{
						int serieIndex = (int)num5;
						int itemIndex = (int)num9;
						bool blnSombraTransparente = false;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						num9 = itemIndex;
						num5 = serieIndex;
						long num10 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), (float)r.Height - m_sngSlantY), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY)));
						ref Point reference = ref array[(int)num9];
						reference = new Point((int)Math.Round(num7), (int)(num6 - num10));
						if (m_blnShowValues | m_blnHotSpots)
						{
							ValueCaptionRenderer vcc = m_vcc;
							itemIndex = (int)num5;
							serieIndex = (int)num9;
							percentage = num6 - num10 - 10;
							string value = Conversions.ToDouble(enumerator.Current).ToString(m_strValuesFormat);
							float sngHotSpotY = num6 - num10;
							ValueCaption vc = new ValueCaption(ref itemIndex, ref serieIndex, ref num7, ref percentage, value, ref num7, ref sngHotSpotY);
							num9 = serieIndex;
							num5 = itemIndex;
							vcc.AddCaption(vc);
						}
						num8 = num10;
						num9++;
						num7 += num2;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				int num11 = (int)Math.Round((float)r.Bottom - (float)num5 * m_sngSlantY / (float)(num + 1));
				GraphicsPath graphicsPath = new GraphicsPath();
				long num12 = 0L;
				long num13 = Information.UBound(array);
				for (num9 = num12; num9 <= num13; num9++)
				{
					ref Point reference2 = ref array2[(int)num9];
					reference2 = array[(int)(Information.UBound(array) - num9)];
					array2[(int)num9].Offset((int)Math.Round(num3), (int)Math.Round(0f - num4));
				}
				graphicsPath.AddCurve(array);
				graphicsPath.AddLine(array[(int)(m_lngNumX - 1)], array2[0]);
				graphicsPath.AddCurve(array2);
				graphicsPath.AddLine(array2[(int)(m_lngNumX - 1)], array[0]);
				_g.FillPath(new LinearGradientBrush(r, c1a, c2a, LinearGradientMode.Vertical), graphicsPath);
				_g.DrawPath(new Pen(Color.FromArgb(128, 0, 0, 0)), graphicsPath);
				int num14 = array[0].X;
				graphicsPath.Reset();
				graphicsPath.AddCurve(array);
				Point pt = array[(int)(m_lngNumX - 1)];
				Point pt2 = new Point(array[(int)(m_lngNumX - 1)].X, num11);
				graphicsPath.AddLine(pt, pt2);
				pt2 = new Point(array[(int)(m_lngNumX - 1)].X, num11);
				Point pt3 = pt2;
				Point pt4 = new Point(num14, num11);
				graphicsPath.AddLine(pt3, pt4);
				graphicsPath.CloseFigure();
				_g.FillPath(new LinearGradientBrush(r, c, c2, LinearGradientMode.Vertical), graphicsPath);
				_g.DrawPath(new Pen(Color.FromArgb(128, 0, 0, 0)), graphicsPath);
				int num15 = array2[0].X;
				graphicsPath.Reset();
				graphicsPath.AddLine(array[(int)(m_lngNumX - 1)], array2[0]);
				Point pt5 = array2[0];
				pt4 = new Point(num15, (int)Math.Round((float)num11 - m_sngSlantY / (float)(num + 1)));
				graphicsPath.AddLine(pt5, pt4);
				pt4 = new Point(num15, (int)Math.Round((float)num11 - m_sngSlantY / (float)(num + 1)));
				Point pt6 = pt4;
				pt2 = new Point(array[(int)(m_lngNumX - 1)].X, num11);
				graphicsPath.AddLine(pt6, pt2);
				graphicsPath.CloseFigure();
				_g.FillPath(new LinearGradientBrush(r, c1a, c2a, LinearGradientMode.Vertical), graphicsPath);
				_g.DrawPath(new Pen(Color.FromArgb(128, 0, 0, 0)), graphicsPath);
			}
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawSplineStackedArea3D(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		checked
		{
			float num2 = default(float);
			if (m_lngNumX > 1)
			{
				num2 = ((float)r.Width - m_sngSlantX) / (float)(m_lngNumX - 1);
			}
			float num3 = m_sngSlantX / (float)(num + 1);
			float num4 = m_sngSlantY / (float)(num + 1);
			m_DrawGrid3d_Start(r, num2, blnAcum: true);
			Point[] array = new Point[(int)(m_lngNumX - 1) + 1];
			Point[] array2 = new Point[(int)(m_lngNumX - 1) + 1];
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (long num5 = num; num5 >= 0; num5 += -1)
			{
				long num6 = (long)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)((float)r.Height - m_sngSlantY));
				num6 = (long)Math.Round((float)num6 + (float)(num - num5 + 1) * m_sngSlantY / (float)(num + 1));
				float num7 = (float)r.Left + m_sngSlantX;
				num7 -= (float)(num - num5 + 1) * m_sngSlantX / (float)(num + 1);
				long num8 = -1L;
				IEnumerator enumerator = m_arrSeriesAcum[(int)num5].GetEnumerator();
				long num9 = 0L;
				while (enumerator.MoveNext())
				{
					try
					{
						int serieIndex = (int)num5;
						int itemIndex = (int)num9;
						bool blnSombraTransparente = false;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						num9 = itemIndex;
						num5 = serieIndex;
						long num10 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinYAcum), m_dblSeriesRangeYAcum), (float)r.Height - m_sngSlantY), m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)((float)r.Height - m_sngSlantY)));
						ref Point reference = ref array[(int)num9];
						reference = new Point((int)Math.Round(num7), (int)(num6 - num10));
						num9++;
						if (m_blnShowValues | m_blnHotSpots)
						{
							if (num8 < num10)
							{
								ValueCaptionRenderer vcc = m_vcc;
								itemIndex = (int)num5;
								serieIndex = (int)num9;
								percentage = num6 - num10 - 10;
								string value = Conversions.ToString(enumerator.Current);
								float sngHotSpotY = num6 - num10;
								ValueCaption vc = new ValueCaption(ref itemIndex, ref serieIndex, ref num7, ref percentage, value, ref num7, ref sngHotSpotY);
								num9 = serieIndex;
								num5 = itemIndex;
								vcc.AddCaption(vc);
							}
							else
							{
								ValueCaptionRenderer vcc2 = m_vcc;
								itemIndex = (int)num5;
								serieIndex = (int)num9;
								float sngHotSpotY = num6 - num10 + 15;
								string value2 = Conversions.ToString(enumerator.Current);
								percentage = num6 - num10;
								ValueCaption vc2 = new ValueCaption(ref itemIndex, ref serieIndex, ref num7, ref sngHotSpotY, value2, ref num7, ref percentage);
								num9 = serieIndex;
								num5 = itemIndex;
								vcc2.AddCaption(vc2);
							}
						}
						num8 = num10;
						num7 += num2;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				int num11 = (int)Math.Round((float)r.Bottom - (float)num5 * m_sngSlantY / (float)(num + 1));
				GraphicsPath graphicsPath = new GraphicsPath();
				long num12 = 0L;
				long num13 = Information.UBound(array);
				for (num9 = num12; num9 <= num13; num9++)
				{
					ref Point reference2 = ref array2[(int)num9];
					reference2 = array[(int)(Information.UBound(array) - num9)];
					array2[(int)num9].Offset((int)Math.Round(num3), (int)Math.Round(0f - num4));
				}
				graphicsPath.AddCurve(array);
				graphicsPath.AddLine(array[(int)(m_lngNumX - 1)], array2[0]);
				graphicsPath.AddCurve(array2);
				graphicsPath.AddLine(array2[(int)(m_lngNumX - 1)], array[0]);
				_g.FillPath(new LinearGradientBrush(r, c1a, c2a, LinearGradientMode.Vertical), graphicsPath);
				_g.DrawPath(new Pen(Color.FromArgb(128, 0, 0, 0)), graphicsPath);
				int num14 = array[0].X;
				graphicsPath.Reset();
				graphicsPath.AddCurve(array);
				Point pt = array[(int)(m_lngNumX - 1)];
				Point pt2 = new Point(array[(int)(m_lngNumX - 1)].X, num11);
				graphicsPath.AddLine(pt, pt2);
				pt2 = new Point(array[(int)(m_lngNumX - 1)].X, num11);
				Point pt3 = pt2;
				Point pt4 = new Point(num14, num11);
				graphicsPath.AddLine(pt3, pt4);
				graphicsPath.CloseFigure();
				_g.FillPath(new LinearGradientBrush(r, c, c2, LinearGradientMode.Vertical), graphicsPath);
				_g.DrawPath(new Pen(Color.FromArgb(128, 0, 0, 0)), graphicsPath);
				int num15 = array2[0].X;
				graphicsPath.Reset();
				graphicsPath.AddLine(array[(int)(m_lngNumX - 1)], array2[0]);
				Point pt5 = array2[0];
				pt4 = new Point(num15, (int)Math.Round((float)num11 - m_sngSlantY / (float)(num + 1)));
				graphicsPath.AddLine(pt5, pt4);
				pt4 = new Point(num15, (int)Math.Round((float)num11 - m_sngSlantY / (float)(num + 1)));
				Point pt6 = pt4;
				pt2 = new Point(array[(int)(m_lngNumX - 1)].X, num11);
				graphicsPath.AddLine(pt6, pt2);
				graphicsPath.CloseFigure();
				_g.FillPath(new LinearGradientBrush(r, c1a, c2a, LinearGradientMode.Vertical), graphicsPath);
				_g.DrawPath(new Pen(Color.FromArgb(128, 0, 0, 0)), graphicsPath);
			}
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawPoint(PointF p, int serie)
	{
		m_DrawPoint(p.X, p.Y, serie);
	}

	private void m_DrawPoint(float posx, float posy, int serie)
	{
		STYLEPOINT sTYLEPOINT = m_PointStyle;
		if (m_SeriesPointStyle != null && Information.UBound(m_SeriesPointStyle) >= serie)
		{
			sTYLEPOINT = m_SeriesPointStyle[serie];
		}
		float num;
		Color color = default(Color);
		if (sTYLEPOINT == STYLEPOINT.STYLEPOINT_DOT)
		{
			num = 1f;
		}
		else
		{
			num = m_PointSize;
			if (m_SeriesPointSize != null && Information.UBound(m_SeriesPointSize) >= serie)
			{
				num = m_SeriesPointSize[serie];
			}
			if (Information.UBound(m_arrSeriesColor) >= serie)
			{
				color = m_arrSeriesColor[serie];
			}
		}
		Rectangle r = checked(new Rectangle((int)Math.Round(posx - num / 2f), (int)Math.Round(posy - num / 2f), (int)Math.Round(num), (int)Math.Round(num)));
		switch (sTYLEPOINT)
		{
		case STYLEPOINT.STYLEPOINT_RECTANGLE:
			_g.FillRectangle(new SolidBrush(color), r);
			_g.DrawRectangle(new Pen(color), r);
			break;
		case STYLEPOINT.STYLEPOINT_CIRCLE:
			_g.FillEllipse(new SolidBrush(color), r);
			_g.DrawEllipse(new Pen(color), r);
			break;
		case STYLEPOINT.STYLEPOINT_TRIANGLE:
		{
			PointF[] array = new PointF[3];
			ref PointF reference = ref array[0];
			PointF pointF = new PointF(posx, posy - num / 2f);
			reference = pointF;
			ref PointF reference2 = ref array[1];
			PointF pointF2 = new PointF(posx + num / 2f, posy + num / 2f);
			reference2 = pointF2;
			ref PointF reference3 = ref array[2];
			PointF pointF3 = new PointF(posx - num / 2f, posy + num / 2f);
			reference3 = pointF3;
			PointF[] points = array;
			_g.FillPolygon(new SolidBrush(color), points);
			_g.DrawPolygon(new Pen(color), points);
			break;
		}
		case STYLEPOINT.STYLEPOINT_DOT:
			_g.DrawRectangle(new Pen(color), r);
			break;
		}
	}

	private void m_DrawPointGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		float num2 = default(float);
		if (m_lngNumX > 1)
		{
			num2 = (float)((double)r.Width / (double)m_lngNumX);
		}
		checked
		{
			long num3 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			int num4 = num;
			for (int i = 0; i <= num4; i++)
			{
				float sngPosX = (float)r.Left + num2 / 2f;
				Color color = ControlPaint.Dark(m_arrSeriesColor[i], 0.2f);
				Color color2 = ControlPaint.Light(m_arrSeriesColor[i], 0.2f);
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						long num5 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						m_DrawPoint(sngPosX, num3 - num5, i);
						if (m_blnShowValues | m_blnHotSpots)
						{
							ValueCaptionRenderer vcc = m_vcc;
							float sngPosY = num3 - num5 - 15;
							string value = Conversions.ToString(enumerator.Current);
							float sngHotSpotY = num3 - num5;
							vcc.AddCaption(new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref sngPosY, value, ref sngPosX, ref sngHotSpotY));
						}
						itemIndex++;
						sngPosX += num2;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawAreaGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		PointF[] array = new PointF[4];
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)r.Height);
			float num3 = default(float);
			if (m_lngNumX > 1)
			{
				num3 = (float)((double)r.Width / (double)m_lngNumX);
			}
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			long num7 = default(long);
			float sngPosX = default(float);
			for (int i = num; i >= 0; i += -1)
			{
				GraphicsPath graphicsPath = new GraphicsPath();
				long num4 = -1L;
				long num5 = -1L;
				IEnumerator enumerator = m_arrSeriesAcum[i].GetEnumerator();
				PointF[] array2;
				PointF pointF2;
				PointF pointF;
				while (enumerator.MoveNext())
				{
					try
					{
						num5++;
						int itemIndex = (int)num5;
						bool blnSombraTransparente = true;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						num5 = itemIndex;
						sngPosX = (float)num5 * num3 + (float)r.Left + num3 / 2f;
						long num6 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinYAcum), m_dblSeriesRangeYAcum), r.Height), m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)r.Height));
						if (num4 != -1)
						{
							ref PointF reference = ref array[0];
							reference = new PointF(sngPosX - num3 - 1f, num2);
							ref PointF reference2 = ref array[1];
							reference2 = new PointF(sngPosX - num3 - 1f, num2 - num4);
							ref PointF reference3 = ref array[2];
							reference3 = new PointF(sngPosX, num2 - num6);
							ref PointF reference4 = ref array[3];
							reference4 = new PointF(sngPosX, num2);
							array2 = new PointF[1];
							ref PointF reference5 = ref array2[0];
							pointF = new PointF(sngPosX, num2 - num6);
							reference5 = pointF;
							graphicsPath.AddPath(new GraphicsPath(array2, new byte[1] { 1 }), connect: true);
						}
						else
						{
							array2 = new PointF[2];
							ref PointF reference6 = ref array2[0];
							pointF = new PointF(sngPosX, num2);
							reference6 = pointF;
							ref PointF reference7 = ref array2[1];
							pointF2 = new PointF(sngPosX, num2 - num6);
							reference7 = pointF2;
							graphicsPath.AddPath(new GraphicsPath(array2, new byte[2] { 0, 1 }), connect: true);
						}
						if (m_blnShowValues | m_blnHotSpots)
						{
							if (num7 < 0)
							{
								ValueCaptionRenderer vcc = m_vcc;
								itemIndex = (int)num5;
								percentage = num2 - num6 + 15;
								string value = Conversions.ToString(enumerator.Current);
								float sngHotSpotY = num2 - num6;
								ValueCaption vc = new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref percentage, value, ref sngPosX, ref sngHotSpotY);
								num5 = itemIndex;
								vcc.AddCaption(vc);
							}
							else
							{
								ValueCaptionRenderer vcc2 = m_vcc;
								itemIndex = (int)num5;
								float sngHotSpotY = num2 - num6 - 10;
								string value2 = Conversions.ToString(enumerator.Current);
								percentage = num2 - num6;
								ValueCaption vc2 = new ValueCaption(ref i, ref itemIndex, ref sngPosX, ref sngHotSpotY, value2, ref sngPosX, ref percentage);
								num5 = itemIndex;
								vcc2.AddCaption(vc2);
							}
						}
						num4 = num6;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				array2 = new PointF[1];
				ref PointF reference8 = ref array2[0];
				pointF2 = new PointF(sngPosX, num2);
				reference8 = pointF2;
				graphicsPath.AddPath(new GraphicsPath(array2, new byte[1] { 1 }), connect: true);
				CustomGraphics g = _g;
				pointF2 = new PointF(0f, r.Top);
				PointF point = pointF2;
				pointF = new PointF(0f, r.Bottom);
				g.FillPath(new LinearGradientBrush(point, pointF, c, c2), graphicsPath);
				_g.DrawPath(m_arrSeriesLineStyle[i], graphicsPath);
			}
			if (!m_blnShowPoints)
			{
				return;
			}
			for (int i = num; i >= 0; i += -1)
			{
				long num5 = -1L;
				IEnumerator enumerator = m_arrSeriesAcum[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						num5++;
						sngPosX = (float)num5 * num3 + (float)r.Left + num3 / 2f;
						long num6 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinYAcum), m_dblSeriesRangeYAcum), r.Height), m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)r.Height));
						m_DrawPoint(sngPosX, num2 - num6, i);
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawPieGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		stringFormat.Alignment = StringAlignment.Center;
		stringFormat.LineAlignment = StringAlignment.Center;
		checked
		{
			Rectangle rectangle = ((r.Width <= r.Height) ? new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0), (int)Math.Round((double)r.Height / 2.0 - (double)r.Width / 2.0), r.Width, r.Width) : new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0 - (double)r.Height / 2.0), r.Top, r.Height, r.Height));
			long num = 0L;
			long num2 = Information.UBound(m_arrItemsHighlight);
			long num3;
			for (num3 = num; num3 <= num2 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) == 0; num3++)
			{
			}
			if (num3 <= Information.UBound(m_arrItemsHighlight))
			{
				num3 = (long)Math.Round((double)rectangle.Width * 0.1);
				rectangle = new Rectangle((int)Math.Round((double)rectangle.Left + (double)num3 / 2.0), (int)Math.Round((double)rectangle.Top + (double)num3 / 2.0), (int)(rectangle.Width - num3), (int)(rectangle.Height - num3));
			}
			Rectangle rectangle2 = new Rectangle(rectangle.Left + 5, rectangle.Top - 5, rectangle.Width, rectangle.Height);
			float num4 = 0f;
			long num5 = 0L;
			long num6 = Information.UBound(m_arrItemsLegend);
			for (num3 = num5; num3 <= num6; num3++)
			{
				string text = m_arrItemsLegend[(int)num3];
				text = ((Operators.CompareString(text, "", TextCompare: false) == 0) ? "99%" : (text + " (99%)"));
				float num7 = _g.MeasureString(text, m_ValuesFont).Width;
				if (num7 > num4)
				{
					num4 = num7;
				}
			}
			if (num4 == 0f)
			{
				num4 = _g.MeasureString("Item 9 100%", m_ValuesFont).Width;
			}
			float num8 = -90f;
			Color color = default(Color);
			Color color2 = default(Color);
			Color color3 = default(Color);
			IEnumerator enumerator;
			if (m_blnShadow)
			{
				num3 = 0L;
				enumerator = m_arrSeries[0].GetEnumerator();
				Color color4 = default(Color);
				while (enumerator.MoveNext())
				{
					try
					{
						if (num3 <= Information.UBound(m_arrSeriesColor))
						{
							if (m_blnSolidColor)
							{
								color = m_arrSeriesColor[(int)num3];
								color2 = color;
							}
							else
							{
								color = ControlPaint.Dark(m_arrSeriesColor[(int)num3], 0.2f);
								color2 = ControlPaint.Light(m_arrSeriesColor[(int)num3], 0.2f);
							}
							color3 = Color.FromArgb(100, color.R, color.G, color.B);
							color4 = Color.FromArgb(100, color2.R, color2.G, color2.B);
						}
						float num9 = Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), 360f), m_dblSeriesRangeSumY[0]));
						Rectangle rect = rectangle2;
						if (Information.UBound(m_arrItemsHighlight) >= num3 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
						{
							float num10 = (float)((double)(num8 + num9 / 2f) * Math.PI / 180.0);
							rect.Offset((int)Math.Round(Math.Cos(num10) * (double)rect.Width * 0.1), (int)Math.Round(Math.Sin(num10) * (double)rect.Height * 0.1));
						}
						_g.FillPie(new LinearGradientBrush(rect, color3, color4, LinearGradientMode.Vertical), rect, num8, num9);
						num8 += num9;
						num3++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			num3 = 0L;
			enumerator = m_arrSeries[0].GetEnumerator();
			num8 = -90f;
			while (enumerator.MoveNext())
			{
				try
				{
					Rectangle rect = rectangle;
					float num9 = Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), 360f), m_dblSeriesRangeSumY[0]));
					if (Information.UBound(m_arrItemsHighlight) >= num3 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
					{
						float num11 = (float)((double)(num8 + num9 / 2f) * Math.PI / 180.0);
						rect.Offset((int)Math.Round(Math.Cos(num11) * (double)rectangle.Width * 0.1), (int)Math.Round(Math.Sin(num11) * (double)rect.Height * 0.1));
					}
					if (m_blnSeriesFillStyleSet)
					{
						if (Information.IsArray(m_arrSeriesFillStyle) && Information.UBound(m_arrSeriesFillStyle) >= num3)
						{
							_g.FillPie(m_arrSeriesFillStyle[(int)num3], rect, num8, num9);
						}
					}
					else
					{
						if (num3 <= Information.UBound(m_arrSeriesColor))
						{
							if (m_blnSolidColor)
							{
								color = m_arrSeriesColor[(int)num3];
								color2 = color;
							}
							else
							{
								color = ControlPaint.Dark(m_arrSeriesColor[(int)num3], 0.2f);
								color2 = ControlPaint.Light(m_arrSeriesColor[(int)num3], 0.2f);
							}
							color3 = Color.FromArgb(100, color.R, color.G, color.B);
							Color color4 = Color.FromArgb(100, color2.R, color2.G, color2.B);
						}
						_g.FillPie(new LinearGradientBrush(rect, color, color2, LinearGradientMode.Vertical), rect, num8, num9);
					}
					Pen pen = ((!(m_PieBorderStyle.Color != Color.Transparent)) ? new Pen(color3) : m_PieBorderStyle);
					pen.LineJoin = LineJoin.Bevel;
					_g.DrawPie(pen, rect, num8, num9);
					if (m_blnShowValues | m_blnHotSpots)
					{
						string text2 = ((Information.UBound(m_arrItemsLegend) < num3) ? ("Item " + Conversions.ToString(num3 + 1)) : m_arrItemsLegend[(int)num3]);
						int num12 = Conversions.ToInteger(Operators.DivideObject(Operators.MultiplyObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), 100), m_dblSeriesRangeSumY[0]));
						text2 = ((Operators.CompareString(text2, "", TextCompare: false) == 0) ? (num12.ToString("0") + " %") : (text2 + " (" + num12.ToString("0") + " %)"));
						float val = (float)(Math.Cos((double)num8 * Math.PI / 180.0) * ((double)rectangle.Width / 2.0));
						float num7 = (float)(Math.Cos((double)(num8 + num9) * Math.PI / 180.0) * ((double)rectangle.Width / 2.0));
						num7 = Math.Abs(Math.Max(num7, val) - Math.Min(num7, val));
						val = (float)(Math.Cos((double)(num8 + num9 / 2f) * Math.PI / 180.0) * ((double)rect.Width / 2.0));
						float num13 = (float)(Math.Sin((double)(num8 + num9 / 2f) * Math.PI / 180.0) * ((double)rect.Height / 2.0));
						ValueCaption valueCaption = null;
						switch (m_ValuesLocationStyle)
						{
						case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE:
							if (num7 > num4)
							{
								int itemIndex4 = (int)num3;
								float sngPosX3 = (float)((double)val * 0.7 + (double)rect.Left + (double)rect.Width / 2.0);
								float sngPosY3 = (float)((double)num13 * 0.7 + (double)rect.Top + (double)rect.Height / 2.0);
								string value3 = text2;
								double numericValue3 = num9;
								float sngHotSpotX3 = (float)((double)val * 0.7 + (double)rect.Left + (double)rect.Width / 2.0);
								float sngHotSpotY3 = (float)((double)num13 * 0.7 + (double)rect.Top + (double)rect.Height / 2.0);
								float sngYDisplacementDirection = 0f;
								float sngXDisplacementDirection = 0f;
								valueCaption = new ValueCaption(0, itemIndex4, sngPosX3, sngPosY3, value3, numericValue3, sngHotSpotX3, sngHotSpotY3, ref sngYDisplacementDirection, ref sngXDisplacementDirection);
							}
							else
							{
								int itemIndex5 = (int)num3;
								float sngPosX4 = (float)((double)(val + (float)rect.Left) + (double)rect.Width / 2.0);
								float sngPosY4 = (float)((double)(num13 + (float)rect.Top) + (double)rect.Height / 2.0);
								string value4 = text2;
								double numericValue4 = num9;
								float sngHotSpotX4 = (float)((double)val * 0.9 + (double)rect.Left + (double)rect.Width / 2.0);
								float sngHotSpotY4 = (float)((double)num13 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
								float sngXDisplacementDirection = 0f;
								float sngYDisplacementDirection = 0f;
								valueCaption = new ValueCaption(0, itemIndex5, sngPosX4, sngPosY4, value4, numericValue4, sngHotSpotX4, sngHotSpotY4, ref sngXDisplacementDirection, ref sngYDisplacementDirection);
							}
							break;
						case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_DEFAULT:
						{
							int seriesIndex = 0;
							int itemIndex3 = (int)num3;
							float sngXDisplacementDirection = (float)((double)(val + (float)rect.Left) + (double)rect.Width / 2.0);
							float sngYDisplacementDirection = (float)((double)(num13 + (float)rect.Top) + (double)rect.Height / 2.0);
							ValueCaption valueCaption2 = new ValueCaption(ref seriesIndex, ref itemIndex3, ref sngXDisplacementDirection, ref sngYDisplacementDirection, text2, ref num9);
							num3 = itemIndex3;
							valueCaption = valueCaption2;
							break;
						}
						case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_SMART_PLACEMENT:
							if (val > 0f)
							{
								int itemIndex = (int)num3;
								float sngPosX = (float)(rect.Right + 5) + num4 / 2f;
								float sngPosY = (float)((double)num13 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
								string value = text2;
								double numericValue = num9;
								float sngHotSpotX = (float)((double)val * 0.9 + (double)rect.Left + (double)rect.Width / 2.0);
								float sngHotSpotY = (float)((double)num13 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
								float sngXDisplacementDirection = 0f;
								float sngYDisplacementDirection = 1f;
								valueCaption = new ValueCaption(0, itemIndex, sngPosX, sngPosY, value, numericValue, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref sngYDisplacementDirection);
							}
							else
							{
								int itemIndex2 = (int)num3;
								float sngPosX2 = (float)(rect.Left - 5) - num4 / 2f;
								float sngPosY2 = (float)((double)num13 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
								string value2 = text2;
								double numericValue2 = num9;
								float sngHotSpotX2 = (float)((double)val * 0.9 + (double)rect.Left + (double)rect.Width / 2.0);
								float sngHotSpotY2 = (float)((double)num13 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
								float sngXDisplacementDirection = 0f;
								float sngYDisplacementDirection = -1f;
								valueCaption = new ValueCaption(0, itemIndex2, sngPosX2, sngPosY2, value2, numericValue2, sngHotSpotX2, sngHotSpotY2, ref sngXDisplacementDirection, ref sngYDisplacementDirection);
							}
							break;
						}
						valueCaption.AddZonePie(ref rect, num8, num9);
						m_vcc.AddCaption(valueCaption);
					}
					num8 += num9;
					num3++;
				}
				catch (Exception ex3)
				{
					ProjectData.SetProjectError(ex3);
					Exception ex4 = ex3;
					ProjectData.ClearProjectError();
				}
			}
		}
	}

	private void m_RefreshGraphRadar(ref Rectangle r)
	{
		if (m_GridBackgroundImage != null)
		{
			if (m_GridBackgroundImageTransparency > 0)
			{
				float[][] newColorMatrix = new float[5][]
				{
					new float[5] { 1f, 0f, 0f, 0f, 0f },
					new float[5] { 0f, 1f, 0f, 0f, 0f },
					new float[5] { 0f, 0f, 1f, 0f, 0f },
					new float[5]
					{
						0f,
						0f,
						0f,
						(float)((double)m_GridBackgroundImageTransparency / 100.0),
						0f
					},
					new float[5] { 0f, 0f, 0f, 0f, 1f }
				};
				ColorMatrix newColorMatrix2 = new ColorMatrix(newColorMatrix);
				ImageAttributes imageAttributes = new ImageAttributes();
				imageAttributes.SetColorMatrix(newColorMatrix2, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
				_g.g.DrawImage(m_GridBackgroundImage, r, 0, 0, m_GridBackgroundImage.Width, m_GridBackgroundImage.Height, GraphicsUnit.Pixel, imageAttributes);
			}
			else
			{
				_g.g.DrawImage(m_GridBackgroundImage, r);
			}
		}
		m_DrawRadarGraph(r);
	}

	private void m_DrawRadarGraph(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		checked
		{
			Rectangle rectangle = ((r.Width <= r.Height) ? new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0), (int)Math.Round((double)r.Height / 2.0 - (double)r.Width / 2.0), r.Width, r.Width) : new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0 - (double)r.Height / 2.0), r.Top, r.Height, r.Height));
			float num = (float)((double)rectangle.Width / 2.0);
			float num2 = (float)rectangle.Left + num;
			float num3 = (float)rectangle.Top + num;
			float num4 = ((m_lngNumDividersY == 0) ? num : (num / (float)m_lngNumDividersY));
			PointF[] array = new PointF[(int)m_lngNumX + 1];
			PointF[] array2 = new PointF[(int)m_lngNumX + 1];
			int num5 = (int)m_lngNumX;
			for (int i = 0; i <= num5; i++)
			{
				float num6 = (float)((double)(i * 2) * Math.PI / (double)m_lngNumX - Math.PI / 2.0);
				float num7 = (float)((double)num2 + (double)num * Math.Cos(num6));
				float num8 = (float)((double)num3 + (double)num * Math.Sin(num6));
				ref PointF reference = ref array[i];
				reference = new PointF(num7, num8);
				ref PointF reference2 = ref array2[i];
				reference2 = new PointF(num7 + (float)m_intShadowOffset, num8 + (float)m_intShadowOffset);
			}
			if (m_blnShadow)
			{
				Color c = default(Color);
				Color c1a = default(Color);
				Color c2a = default(Color);
				m_CalculateColorRampFromColor(m_WallsBackColorPrincipal, ref c, ref c, ref c1a, ref c2a, blnSombraTransparente: true);
				_g.FillPolygon(new SolidBrush(c1a), array2);
			}
			int num9 = 0;
			float limit = num4;
			float num10 = 0f - num4;
			for (float num11 = num; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num11, limit, num10); num11 += num10)
			{
				int num12 = (int)m_lngNumX;
				for (int i = 0; i <= num12; i++)
				{
					float num6 = (float)((double)(i * 2) * Math.PI / (double)m_lngNumX - Math.PI / 2.0);
					float num7 = (float)((double)num2 + (double)num11 * Math.Cos(num6));
					float num8 = (float)((double)num3 + (double)num11 * Math.Sin(num6));
					ref PointF reference3 = ref array[i];
					reference3 = new PointF(num7, num8);
				}
				num9++;
				if (unchecked(num9 % 2) == 0)
				{
					_g.FillPolygon(new SolidBrush(m_WallsBackColorPrincipal), array);
				}
				else
				{
					_g.FillPolygon(new SolidBrush(m_WallsBackColorSecondary), array);
				}
			}
			float limit2 = num;
			float num13 = num4;
			float x = default(float);
			float y = default(float);
			for (float num14 = num4; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num14, limit2, num13); num14 += num13)
			{
				int num15 = (int)m_lngNumX;
				for (int i = 0; i <= num15; i++)
				{
					float num6 = (float)((double)(i * 2) * Math.PI / (double)m_lngNumX - Math.PI / 2.0);
					float num7 = (float)((double)num2 + (double)num14 * Math.Cos(num6));
					float num8 = (float)((double)num3 + (double)num14 * Math.Sin(num6));
					if (i > 0)
					{
						_g.DrawLine(m_GridLineStyle, x, y, num7, num8);
					}
					x = num7;
					y = num8;
					if (num14 == num)
					{
						_g.DrawLine(m_GridLineStyle, num2, num3, num7, num8);
					}
				}
			}
			StringFormat stringFormat = new StringFormat();
			int num16 = (int)unchecked(checked((long)Math.Round(_g.MeasureString("A", m_XAxisValuesFont).Height)) / 2);
			int num17 = (int)m_lngNumX;
			for (int i = 0; i <= num17; i++)
			{
				if (i < m_arrItemsLegend.Length)
				{
					float num6 = (float)((double)(i * 2) * Math.PI / (double)m_lngNumX - Math.PI / 2.0);
					float num7 = (float)((double)num2 + (double)num * 1.05 * Math.Cos(num6));
					float num8 = (float)((double)num3 + (double)num * 1.05 * Math.Sin(num6) - (double)num16);
					if (unchecked(num7 == num2 && num8 > num3))
					{
						stringFormat.Alignment = StringAlignment.Center;
					}
					else if (num7 < num2)
					{
						stringFormat.Alignment = StringAlignment.Far;
					}
					else
					{
						stringFormat.Alignment = StringAlignment.Near;
					}
					_g.DrawString(m_arrItemsLegend[i], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), (int)Math.Round(num7), (int)Math.Round(num8), stringFormat);
				}
			}
			int num18 = m_arrSeries.Length - 1;
			for (int j = 0; j <= num18; j++)
			{
				IEnumerator enumerator = m_arrSeries[j].GetEnumerator();
				PointF[] array3 = new PointF[m_arrSeries[j].Count - 1 + 1];
				int i = -1;
				while (enumerator.MoveNext())
				{
					double num19 = Conversions.ToDouble(enumerator.Current);
					double num20 = (num19 - m_dblSeriesMinY) * (double)num / m_dblSeriesRangeY;
					i++;
					float num6 = (float)((double)(i * 2) * Math.PI / (double)m_lngNumX - Math.PI / 2.0);
					float num7 = (float)((double)num2 + num20 * Math.Cos(num6));
					float num8 = (float)((double)num3 + num20 * Math.Sin(num6));
					ref PointF reference4 = ref array3[i];
					reference4 = new PointF(num7, num8);
				}
				_g.FillPolygon(m_arrSeriesFillStyle[j], array3);
				_g.DrawPolygon(m_arrSeriesLineStyle[j], array3);
			}
			int num21 = (int)Math.Round(_g.MeasureString("0", m_YAxisValuesFont).Height / 2f);
			float limit3 = num;
			float num22 = num4;
			for (float num23 = 0f; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num23, limit3, num22); num23 += num22)
			{
				float num6 = -(float)Math.PI / 2f;
				float num8 = (float)((double)num3 + (double)num23 * Math.Sin(num6));
				double num24 = (double)(num23 / num) * m_dblSeriesRangeY;
				if (m_YAxisLocation == STYLEYAXISLOCATION.STYLEYAXISLOCATION_LEFT)
				{
					stringFormat.Alignment = StringAlignment.Far;
					_g.DrawString(num24.ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(m_YAxisColor), (int)Math.Round(num2 - 5f), (int)Math.Round(num8 - (float)num21), stringFormat);
				}
				else
				{
					_g.DrawString(num24.ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(m_YAxisColor), (int)Math.Round(num2 + 5f), (int)Math.Round(num8 - (float)num21));
				}
			}
			if (!m_blnShowPoints)
			{
				return;
			}
			int num25 = m_arrSeries.Length - 1;
			for (int k = 0; k <= num25; k++)
			{
				IEnumerator enumerator2 = m_arrSeries[k].GetEnumerator();
				int i = -1;
				while (enumerator2.MoveNext())
				{
					double num26 = Conversions.ToDouble(enumerator2.Current);
					double num27 = (num26 - m_dblSeriesMinY) * (double)num / m_dblSeriesRangeY;
					i++;
					float num6 = (float)((double)(i * 2) * Math.PI / (double)m_lngNumX - Math.PI / 2.0);
					float num7 = (float)((double)num2 + num27 * Math.Cos(num6));
					float num8 = (float)((double)num3 + num27 * Math.Sin(num6));
					m_DrawPoint(num7, num8, k);
					if (m_blnShowValues | m_blnHotSpots)
					{
						ValueCaption vc = new ValueCaption(ref k, ref i, ref num7, ref num8, num26);
						m_vcc.AddCaption(vc);
					}
				}
			}
		}
	}

	private void m_DrawDoughnutGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		stringFormat.Alignment = StringAlignment.Center;
		stringFormat.LineAlignment = StringAlignment.Center;
		checked
		{
			Rectangle rectangle = ((r.Width <= r.Height) ? new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0), (int)Math.Round((double)r.Height / 2.0 - (double)r.Width / 2.0), r.Width, r.Width) : new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0 - (double)r.Height / 2.0), r.Top, r.Height, r.Height));
			long num = 0L;
			long num2 = Information.UBound(m_arrItemsHighlight);
			long num3;
			for (num3 = num; num3 <= num2 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) == 0; num3++)
			{
			}
			if (num3 <= Information.UBound(m_arrItemsHighlight))
			{
				num3 = (long)Math.Round((double)rectangle.Width * 0.1);
				rectangle = new Rectangle((int)Math.Round((double)rectangle.Left + (double)num3 / 2.0), (int)Math.Round((double)rectangle.Top + (double)num3 / 2.0), (int)(rectangle.Width - num3), (int)(rectangle.Height - num3));
			}
			Rectangle rectangle2 = new Rectangle(rectangle.Left + 5, rectangle.Top - 5, rectangle.Width, rectangle.Height);
			float num4 = _g.MeasureString(m_dblSeriesMaxY.ToString(m_strValuesFormat) + " (100%)", m_ValuesFont).Width;
			Color color = default(Color);
			Color color2 = default(Color);
			Color color3 = default(Color);
			IEnumerator enumerator;
			float num6 = default(float);
			if (m_blnShadow)
			{
				num3 = 0L;
				enumerator = m_arrSeries[0].GetEnumerator();
				Color color4 = default(Color);
				while (enumerator.MoveNext())
				{
					try
					{
						if (num3 <= Information.UBound(m_arrSeriesColor))
						{
							if (m_blnSolidColor)
							{
								color = m_arrSeriesColor[(int)num3];
								color2 = color;
							}
							else
							{
								color = ControlPaint.Dark(m_arrSeriesColor[(int)num3], 0.2f);
								color2 = ControlPaint.Light(m_arrSeriesColor[(int)num3], 0.2f);
							}
							color3 = Color.FromArgb(100, color.R, color.G, color.B);
							color4 = Color.FromArgb(100, color2.R, color2.G, color2.B);
						}
						float num5 = Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), 360f), m_dblSeriesRangeSumY[0]));
						Rectangle rectangle3 = rectangle2;
						if (Information.UBound(m_arrItemsHighlight) >= num3 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
						{
							float num7 = (float)((double)(num6 + num5 / 2f) * Math.PI / 180.0);
							rectangle2.Offset((int)Math.Round(Math.Cos(num7) * (double)rectangle2.Width * 0.1), (int)Math.Round(Math.Sin(num7) * (double)rectangle2.Height * 0.1));
						}
						GraphicsPath graphicsPath = new GraphicsPath();
						graphicsPath.AddArc(rectangle2, num6, num5);
						Rectangle rect = new Rectangle((int)Math.Round((double)rectangle2.Left + (double)rectangle2.Width / 2.0 - (double)m_intHoleSize), (int)Math.Round((double)rectangle2.Top + (double)rectangle2.Height / 2.0 - (double)m_intHoleSize), m_intHoleSize * 2, m_intHoleSize * 2);
						graphicsPath.AddArc(rect, num6 + num5, 0f - num5);
						graphicsPath.CloseFigure();
						_g.g.FillPath(new LinearGradientBrush(rectangle2, color3, color4, LinearGradientMode.Vertical), graphicsPath);
						rectangle2 = rectangle3;
						num6 += num5;
						num3++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						MessageBox.Show(ex2.ToString());
						ProjectData.ClearProjectError();
					}
				}
			}
			num3 = 0L;
			enumerator = m_arrSeries[0].GetEnumerator();
			num6 = 0f;
			while (enumerator.MoveNext())
			{
				try
				{
					if (num3 <= Information.UBound(m_arrSeriesColor))
					{
						if (m_blnSolidColor)
						{
							color = m_arrSeriesColor[(int)num3];
							color2 = color;
						}
						else
						{
							color = ControlPaint.Dark(m_arrSeriesColor[(int)num3], 0.2f);
							color2 = ControlPaint.Light(m_arrSeriesColor[(int)num3], 0.2f);
						}
						color3 = Color.FromArgb(100, color.R, color.G, color.B);
						Color color4 = Color.FromArgb(100, color2.R, color2.G, color2.B);
					}
					Rectangle rectangle3 = rectangle;
					float num5 = Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), 360f), m_dblSeriesRangeSumY[0]));
					if (num5 >= 1f)
					{
						if (Information.UBound(m_arrItemsHighlight) >= num3 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
						{
							float num8 = (float)((double)(num6 + num5 / 2f) * Math.PI / 180.0);
							rectangle.Offset((int)Math.Round(Math.Cos(num8) * (double)rectangle.Width * 0.1), (int)Math.Round(Math.Sin(num8) * (double)rectangle.Height * 0.1));
						}
						GraphicsPath path = new GraphicsPath();
						path.AddArc(rectangle, num6, num5);
						Rectangle rect2 = new Rectangle((int)Math.Round((double)rectangle.Left + (double)rectangle.Width / 2.0 - (double)m_intHoleSize), (int)Math.Round((double)rectangle.Top + (double)rectangle.Height / 2.0 - (double)m_intHoleSize), m_intHoleSize * 2, m_intHoleSize * 2);
						path.AddArc(rect2, num6 + num5, 0f - num5);
						path.CloseFigure();
						_g.g.FillPath(new LinearGradientBrush(rectangle, color, color2, LinearGradientMode.Vertical), path);
						Pen pen = new Pen(color3);
						_g.g.DrawPath(pen, path);
						rectangle = rectangle3;
						if (m_blnShowValues | m_blnHotSpots)
						{
							string text = ((Information.UBound(m_arrItemsLegend) < num3) ? ("Item " + Conversions.ToString(num3 + 1)) : m_arrItemsLegend[(int)num3]);
							text = text + " (" + num5.ToString(m_strValuesFormat) + "%)";
							float val = (float)(Math.Cos((double)num6 * Math.PI / 180.0) * ((double)rectangle.Width / 2.0));
							int num9 = (int)Math.Round(Math.Cos((double)(num6 + num5) * Math.PI / 180.0) * ((double)rectangle.Width / 2.0));
							num9 = (int)Math.Round(Math.Abs(Math.Max(num9, val) - Math.Min(num9, val)));
							val = (float)(Math.Cos((double)(num6 + num5 / 2f) * Math.PI / 180.0) * ((double)rectangle.Width / 2.0));
							float num10 = (float)(Math.Sin((double)(num6 + num5 / 2f) * Math.PI / 180.0) * ((double)rectangle.Height / 2.0));
							ValueCaption valueCaption = null;
							switch (m_ValuesLocationStyle)
							{
							case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE:
								if ((float)num9 > num4)
								{
									int itemIndex4 = (int)num3;
									float sngPosX3 = (float)((double)val * 0.7 + (double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngPosY3 = (float)((double)num10 * 0.7 + (double)rectangle.Top + (double)rectangle.Height / 2.0);
									string value3 = text;
									double numericValue3 = num5;
									float sngHotSpotX3 = (float)((double)val * 0.7 + (double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotY3 = (float)((double)num10 * 0.7 + (double)rectangle.Top + (double)rectangle.Height / 2.0);
									float sngYDisplacementDirection = 0f;
									float sngXDisplacementDirection = 0f;
									valueCaption = new ValueCaption(0, itemIndex4, sngPosX3, sngPosY3, value3, numericValue3, sngHotSpotX3, sngHotSpotY3, ref sngYDisplacementDirection, ref sngXDisplacementDirection);
								}
								else
								{
									int itemIndex5 = (int)num3;
									float sngPosX4 = (float)((double)(val + (float)rectangle.Left) + (double)rectangle.Width / 2.0);
									float sngPosY4 = (float)((double)(num10 + (float)rectangle.Top) + (double)rectangle.Height / 2.0);
									string value4 = text;
									double numericValue4 = num5;
									float sngHotSpotX4 = (float)((double)val * 0.9 + (double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotY4 = (float)((double)num10 * 0.9 + (double)rectangle.Top + (double)rectangle.Height / 2.0);
									float sngXDisplacementDirection = 0f;
									float sngYDisplacementDirection = 0f;
									valueCaption = new ValueCaption(0, itemIndex5, sngPosX4, sngPosY4, value4, numericValue4, sngHotSpotX4, sngHotSpotY4, ref sngXDisplacementDirection, ref sngYDisplacementDirection);
								}
								break;
							case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_DEFAULT:
							{
								int seriesIndex = 0;
								int itemIndex3 = (int)num3;
								float sngXDisplacementDirection = (float)((double)(val + (float)rectangle.Left) + (double)rectangle.Width / 2.0);
								float sngYDisplacementDirection = (float)((double)(num10 + (float)rectangle.Top) + (double)rectangle.Height / 2.0);
								ValueCaption valueCaption2 = new ValueCaption(ref seriesIndex, ref itemIndex3, ref sngXDisplacementDirection, ref sngYDisplacementDirection, text, ref num5);
								num3 = itemIndex3;
								valueCaption = valueCaption2;
								break;
							}
							case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_SMART_PLACEMENT:
								if (val > 0f)
								{
									int itemIndex = (int)num3;
									float sngPosX = (float)(rectangle.Left + rectangle.Width) + num4;
									float sngPosY = (float)((double)num10 * 0.9 + (double)rectangle.Top + (double)rectangle.Height / 2.0);
									string value = text;
									double numericValue = num5;
									float sngHotSpotX = (float)((double)val * 0.9 + (double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotY = (float)((double)num10 * 0.9 + (double)rectangle.Top + (double)rectangle.Height / 2.0);
									float sngXDisplacementDirection = 0f;
									float sngYDisplacementDirection = 1f;
									valueCaption = new ValueCaption(0, itemIndex, sngPosX, sngPosY, value, numericValue, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref sngYDisplacementDirection);
								}
								else
								{
									int itemIndex2 = (int)num3;
									float sngPosX2 = (float)rectangle.Left - num4;
									float sngPosY2 = (float)((double)num10 * 0.9 + (double)rectangle.Top + (double)rectangle.Height / 2.0);
									string value2 = text;
									double numericValue2 = num5;
									float sngHotSpotX2 = (float)((double)val * 0.9 + (double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotY2 = (float)((double)num10 * 0.9 + (double)rectangle.Top + (double)rectangle.Height / 2.0);
									float sngXDisplacementDirection = 0f;
									float sngYDisplacementDirection = -1f;
									valueCaption = new ValueCaption(0, itemIndex2, sngPosX2, sngPosY2, value2, numericValue2, sngHotSpotX2, sngHotSpotY2, ref sngXDisplacementDirection, ref sngYDisplacementDirection);
								}
								break;
							}
							valueCaption.AddZonePath(ref path);
							m_vcc.AddCaption(valueCaption);
						}
					}
					num6 += num5;
					num3++;
				}
				catch (Exception ex3)
				{
					ProjectData.SetProjectError(ex3);
					Exception ex4 = ex3;
					Application.DoEvents();
					ProjectData.ClearProjectError();
				}
			}
		}
	}

	private void m_DrawPieGraph3d(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		GraphicsPath graphicsPath = new GraphicsPath();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = 0L;
		long num2 = Information.UBound(m_arrItemsHighlight);
		checked
		{
			bool flag = default(bool);
			for (long num3 = num; num3 <= num2; num3++)
			{
				if (Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
				{
					flag = true;
					break;
				}
			}
			r = new Rectangle(r.Left, r.Top, r.Width, r.Height - m_intDepth * m_arrSeries.Length);
			if (flag)
			{
				long num3 = (long)Math.Round((double)Math.Min(r.Width, r.Height) * 0.1);
				r = new Rectangle((int)Math.Round((double)r.Left + (double)num3 / 2.0), (int)Math.Round((double)r.Top + (double)num3 / 2.0), (int)(r.Width - num3), (int)(r.Height - num3));
			}
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			float num4 = _g.MeasureString(m_dblSeriesMaxY.ToString(m_strValuesFormat) + " (100%)", m_ValuesFont).Width;
			int num5 = m_arrSeries.Length - 1;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (int i = 0; i <= num5; i++)
			{
				Rectangle rectangle = new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0 - (double)r.Height / 2.0 + (double)(m_sngSlantX * (float)i / 2f)), (int)Math.Round((float)r.Top + m_sngSlantY / 2f - m_sngSlantY * (float)i / 2f + m_sngSlantX * (float)i / 2f), (int)Math.Round((float)r.Height - m_sngSlantX * (float)i), (int)Math.Round((float)r.Height - m_sngSlantY - (float)(m_intDepth * i)));
				for (int j = m_intDepth; j >= 0; j += -1)
				{
					long num3 = 0L;
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					float num6 = 90f;
					while (enumerator.MoveNext())
					{
						try
						{
							if (num3 <= Information.UBound(m_arrSeriesColor))
							{
								if ((double)j < (double)m_sngSlantY * 0.25)
								{
									int itemIndex = (int)num3;
									bool blnSombraTransparente = false;
									float percentage = (float)(0.2 - 0.2 * ((double)m_sngSlantY * 0.25 - (double)j) / ((double)m_sngSlantY * 0.25));
									m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
									num3 = itemIndex;
								}
								else
								{
									int itemIndex = (int)num3;
									bool blnSombraTransparente = false;
									float percentage = 0.2f;
									m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
									num3 = itemIndex;
								}
							}
							float num7 = Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), 360f), m_dblSeriesRangeSumY[i]));
							float startAngle = num6;
							graphicsPath.Reset();
							graphicsPath.StartFigure();
							Rectangle rect = new Rectangle(rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height);
							if (Information.UBound(m_arrItemsHighlight) >= num3 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
							{
								float num8 = (float)((double)(num6 - num7 / 2f) * Math.PI / 180.0);
								rect.Offset((int)Math.Round(Math.Cos(num8) * (double)rect.Width * 0.1), (int)Math.Round(Math.Sin(num8) * (double)rect.Height * 0.1));
							}
							graphicsPath.AddArc(rect, startAngle, 0f - num7);
							rect = new Rectangle(rectangle.Left, rectangle.Top + j, rectangle.Width, rectangle.Height);
							if (Information.UBound(m_arrItemsHighlight) >= num3 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
							{
								float num9 = (float)((double)(num6 - num7 / 2f) * Math.PI / 180.0);
								rect.Offset((int)Math.Round(Math.Cos(num9) * (double)rect.Width * 0.1), (int)Math.Round(Math.Sin(num9) * (double)rect.Height * 0.1));
							}
							if (j > 0)
							{
								_g.g.FillPie(new LinearGradientBrush(rect, c1a, c2a, LinearGradientMode.Vertical), rect, startAngle, 0f - num7);
							}
							else
							{
								_g.g.FillPie(new LinearGradientBrush(rect, c, c2, LinearGradientMode.Vertical), rect, startAngle, 0f - num7);
							}
							if (j != m_intDepth && j == 0 && (m_blnShowValues | m_blnHotSpots))
							{
								if (m_PieBorderStyle.Color != Color.Transparent)
								{
									_g.g.DrawPie(m_PieBorderStyle, rect, startAngle, 0f - num7);
								}
								float val = (float)(Math.Cos((double)num6 * Math.PI / 180.0) * ((double)rectangle.Width / 2.0));
								float val2 = (float)(Math.Cos((double)(num6 + num7) * Math.PI / 180.0) * ((double)rectangle.Width / 2.0));
								val2 = Math.Abs(Math.Max(val2, val) - Math.Min(val2, val));
								double num10 = Math.Cos((double)(num6 - num7 / 2f) * Math.PI / 180.0);
								val = (float)(num10 * ((double)rect.Width / 2.0 + 10.0));
								double num11 = Math.Sin((double)(num6 - num7 / 2f) * Math.PI / 180.0);
								float num12 = (float)(num11 * ((double)rect.Height / 2.0 + 10.0));
								string text = ((Information.UBound(m_arrItemsLegend) < num3) ? ("Item " + Conversions.ToString(num3 + 1)) : m_arrItemsLegend[(int)num3]);
								text = text + " (" + Conversions.ToSingle(Operators.MultiplyObject(Operators.DivideObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), m_dblSeriesRangeSumY[0]), 100)).ToString("0") + "%)";
								ValueCaption valueCaption = null;
								switch (m_ValuesLocationStyle)
								{
								case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE:
									if (val2 > num4)
									{
										int itemIndex5 = (int)num3;
										float sngPosX4 = (float)((double)val * 0.7 + (double)rect.Left + (double)rect.Width / 2.0);
										float sngPosY4 = (float)((double)num12 * 0.7 + (double)rect.Top + (double)rect.Height / 2.0);
										string value4 = text;
										double numericValue4 = num7;
										float sngHotSpotX4 = (float)((double)val * 0.7 + (double)rect.Left + (double)rect.Width / 2.0);
										float sngHotSpotY4 = (float)((double)num12 * 0.7 + (double)rect.Top + (double)rect.Height / 2.0);
										float percentage = 0f;
										float sngXDisplacementDirection = 0f;
										valueCaption = new ValueCaption(0, itemIndex5, sngPosX4, sngPosY4, value4, numericValue4, sngHotSpotX4, sngHotSpotY4, ref percentage, ref sngXDisplacementDirection);
									}
									else
									{
										int itemIndex6 = (int)num3;
										float sngPosX5 = (float)((double)(val + (float)rect.Left) + (double)rect.Width / 2.0);
										float sngPosY5 = (float)((double)(num12 + (float)rect.Top) + (double)rect.Height / 2.0);
										string value5 = text;
										double numericValue5 = num7;
										float sngHotSpotX5 = (float)((double)val * 0.9 + (double)rect.Left + (double)rect.Width / 2.0);
										float sngHotSpotY5 = (float)((double)num12 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
										float sngXDisplacementDirection = 0f;
										float percentage = 0f;
										valueCaption = new ValueCaption(0, itemIndex6, sngPosX5, sngPosY5, value5, numericValue5, sngHotSpotX5, sngHotSpotY5, ref sngXDisplacementDirection, ref percentage);
									}
									break;
								case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_DEFAULT:
								{
									int itemIndex4 = (int)num3;
									float sngPosX3 = (float)((double)val * 0.9 + (double)rect.Left + (double)rect.Width / 2.0);
									float sngPosY3 = (float)((double)num12 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
									string value3 = text;
									double numericValue3 = num7;
									float sngHotSpotX3 = (float)((double)val * 0.9 + (double)rect.Left + (double)rect.Width / 2.0);
									float sngHotSpotY3 = (float)((double)num12 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
									float sngXDisplacementDirection = (float)num10;
									float percentage = (float)num11;
									ValueCaption valueCaption2 = new ValueCaption(0, itemIndex4, sngPosX3, sngPosY3, value3, numericValue3, sngHotSpotX3, sngHotSpotY3, ref sngXDisplacementDirection, ref percentage);
									num11 = percentage;
									num10 = sngXDisplacementDirection;
									valueCaption = valueCaption2;
									break;
								}
								case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_SMART_PLACEMENT:
									if (val > 0f)
									{
										int itemIndex2 = (int)num3;
										float sngPosX = (float)(rect.Left + rect.Width) + num4;
										float sngPosY = (float)((double)num12 * 0.8 + (double)rect.Top + (double)rect.Height / 2.0);
										string value = text;
										double numericValue = num7;
										float sngHotSpotX = (float)((double)val * 0.8 + (double)rect.Left + (double)rect.Width / 2.0);
										float sngHotSpotY = (float)((double)num12 * 0.8 + (double)rect.Top + (double)rect.Height / 2.0);
										float sngXDisplacementDirection = 0f;
										float percentage = 1f;
										valueCaption = new ValueCaption(0, itemIndex2, sngPosX, sngPosY, value, numericValue, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref percentage);
									}
									else
									{
										int itemIndex3 = (int)num3;
										float sngPosX2 = (float)rect.Left - num4;
										float sngPosY2 = (float)((double)num12 * 0.8 + (double)rect.Top + (double)rect.Height / 2.0);
										string value2 = text;
										double numericValue2 = num7;
										float sngHotSpotX2 = (float)((double)val * 0.8 + (double)rect.Left + (double)rect.Width / 2.0);
										float sngHotSpotY2 = (float)((double)num12 * 0.8 + (double)rect.Top + (double)rect.Height / 2.0);
										float sngXDisplacementDirection = 0f;
										float percentage = -1f;
										valueCaption = new ValueCaption(0, itemIndex3, sngPosX2, sngPosY2, value2, numericValue2, sngHotSpotX2, sngHotSpotY2, ref sngXDisplacementDirection, ref percentage);
									}
									break;
								}
								valueCaption.AddZonePie(ref rect, num6, 0f - num7);
								m_vcc.AddCaption(valueCaption);
							}
							num6 -= num7;
							num3++;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
					}
				}
			}
		}
	}

	private void m_DrawDoughnutGraph3d(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		GraphicsPath graphicsPath = new GraphicsPath();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = 0L;
		long num2 = Information.UBound(m_arrItemsHighlight);
		checked
		{
			bool flag = default(bool);
			for (long num3 = num; num3 <= num2; num3++)
			{
				if (Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
				{
					flag = true;
					break;
				}
			}
			r = new Rectangle(r.Left, r.Top, r.Width, r.Height - m_intDepth * m_arrSeries.Length);
			if (flag)
			{
				long num3 = (long)Math.Round((double)Math.Min(r.Width, r.Height) * 0.1);
				r = new Rectangle((int)Math.Round((double)r.Left + (double)num3 / 2.0), (int)Math.Round((double)r.Top + (double)num3 / 2.0), (int)(r.Width - num3), (int)(r.Height - num3));
			}
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			float num4 = _g.MeasureString(m_dblSeriesMaxY.ToString("N"), m_ValuesFont).Width;
			int num5 = m_arrSeries.Length - 1;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (int i = 0; i <= num5; i++)
			{
				Rectangle rectangle = new Rectangle((int)Math.Round((double)r.Left + (double)r.Width / 2.0 - (double)r.Height / 2.0 + (double)(m_sngSlantX * (float)i / 2f)), (int)Math.Round((float)r.Top + m_sngSlantY / 2f - m_sngSlantY * (float)i / 2f + m_sngSlantX * (float)i / 2f), (int)Math.Round((float)r.Height - m_sngSlantX * (float)i), (int)Math.Round((float)r.Height - m_sngSlantY - (float)(m_intDepth * i)));
				for (int j = m_intDepth; j >= 0; j += -1)
				{
					long num3 = 0L;
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					float num6 = 90f;
					while (enumerator.MoveNext())
					{
						try
						{
							if (num3 <= Information.UBound(m_arrSeriesColor))
							{
								if ((double)j < (double)m_sngSlantY * 0.25)
								{
									int itemIndex = (int)num3;
									bool blnSombraTransparente = false;
									float percentage = (float)(0.2 - 0.2 * ((double)m_sngSlantY * 0.25 - (double)j) / ((double)m_sngSlantY * 0.25));
									m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
									num3 = itemIndex;
								}
								else
								{
									int itemIndex = (int)num3;
									bool blnSombraTransparente = false;
									float percentage = 0.2f;
									m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
									num3 = itemIndex;
								}
							}
							float num7 = Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), 360f), m_dblSeriesRangeSumY[i]));
							float num8 = num6;
							if (num7 >= 1f)
							{
								graphicsPath.Reset();
								graphicsPath.StartFigure();
								Rectangle rect = new Rectangle((int)Math.Round((float)rectangle.Left + m_sngSlantX / 2f), (int)Math.Round((float)(rectangle.Top + j) + m_sngSlantY / 2f), (int)Math.Round((float)rectangle.Width - m_sngSlantX), (int)Math.Round((float)rectangle.Height - m_sngSlantY));
								if (Information.UBound(m_arrItemsHighlight) >= num3 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
								{
									float num9 = (float)((double)(num6 - num7 / 2f) * Math.PI / 180.0);
									rect.Offset((int)Math.Round(Math.Cos(num9) * (double)rect.Width * 0.1), (int)Math.Round(Math.Sin(num9) * (double)rect.Height * 0.1));
								}
								graphicsPath.AddArc(rect, num8, 0f - num7);
								rect = new Rectangle((int)Math.Round((float)rectangle.Left + m_sngSlantX / 2f), (int)Math.Round((float)(rectangle.Top + j) + m_sngSlantY / 2f), (int)Math.Round((float)rectangle.Width - m_sngSlantX), (int)Math.Round((float)rectangle.Height - m_sngSlantY));
								if (Information.UBound(m_arrItemsHighlight) >= num3 && Operators.CompareString(m_arrItemsHighlight[(int)num3], "", TextCompare: false) != 0)
								{
									float num10 = (float)((double)(num6 - num7 / 2f) * Math.PI / 180.0);
									rect.Offset((int)Math.Round(Math.Cos(num10) * (double)rect.Width * 0.1), (int)Math.Round(Math.Sin(num10) * (double)rect.Height * 0.1));
								}
								GraphicsPath path = new GraphicsPath();
								Rectangle rect2 = new Rectangle((int)Math.Round((double)rect.Left + (double)rect.Width / 2.0 - (double)(rect.Width * m_intHoleSize) / 200.0), (int)Math.Round((double)rect.Top + (double)rect.Height / 2.0 - (double)(rect.Height * m_intHoleSize) / 200.0), (int)Math.Round((double)(rect.Width * m_intHoleSize) / 100.0), (int)Math.Round((double)(rect.Height * m_intHoleSize) / 100.0));
								path.AddArc(rect2, num8 - num7, num7);
								if (path.PointCount > 0)
								{
									int num11 = (int)Math.Round(path.PathPoints[0].X);
									int num12 = (int)Math.Round(path.PathPoints[0].Y);
									int num13 = (int)Math.Round(path.PathPoints[path.PointCount - 1].X);
									int num14 = (int)Math.Round(path.PathPoints[path.PointCount - 1].Y);
								}
								else
								{
									int num11 = 0;
									int num12 = 0;
									int num13 = 0;
									int num14 = 0;
								}
								path.AddArc(rect, num8, 0f - num7);
								path.CloseFigure();
								if (j > 0)
								{
									_g.FillPath(new LinearGradientBrush(rect, c1a, c2a, LinearGradientMode.Vertical), path);
								}
								else
								{
									_g.FillPath(new LinearGradientBrush(rect, c, c2, LinearGradientMode.Vertical), path);
								}
								if (j != m_intDepth && j == 0 && (m_blnShowValues | m_blnHotSpots))
								{
									float val = (float)(Math.Cos((double)num6 * Math.PI / 180.0) * ((double)rectangle.Width / 2.0));
									float val2 = (float)(Math.Cos((double)(num6 + num7) * Math.PI / 180.0) * ((double)rectangle.Width / 2.0));
									val2 = Math.Abs(Math.Max(val2, val) - Math.Min(val2, val));
									double num15 = Math.Cos((double)(num6 - num7 / 2f) * Math.PI / 180.0);
									val = (float)(num15 * ((double)rect.Width / 2.0 + 10.0));
									double num16 = Math.Sin((double)(num6 - num7 / 2f) * Math.PI / 180.0);
									float num17 = (float)(num16 * ((double)rect.Height / 2.0 + 10.0));
									string text = ((Information.UBound(m_arrItemsLegend) < num3) ? ("Item " + Conversions.ToString(num3 + 1)) : m_arrItemsLegend[(int)num3]);
									text = text + " (" + Conversions.ToSingle(Operators.DivideObject(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null), m_dblSeriesRangeSumY[0])).ToString("p") + ")";
									ValueCaption valueCaption = null;
									switch (m_ValuesLocationStyle)
									{
									case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE:
										if (val2 > num4)
										{
											int itemIndex5 = (int)num3;
											float sngPosX4 = (float)((double)val * 0.7 + (double)rect.Left + (double)rect.Width / 2.0);
											float sngPosY4 = (float)((double)num17 * 0.7 + (double)rect.Top + (double)rect.Height / 2.0);
											string value4 = text;
											double numericValue4 = num7;
											float sngHotSpotX4 = (float)((double)val * 0.7 + (double)rect.Left + (double)rect.Width / 2.0);
											float sngHotSpotY4 = (float)((double)num17 * 0.7 + (double)rect.Top + (double)rect.Height / 2.0);
											float percentage = 0f;
											float sngXDisplacementDirection = 0f;
											valueCaption = new ValueCaption(0, itemIndex5, sngPosX4, sngPosY4, value4, numericValue4, sngHotSpotX4, sngHotSpotY4, ref percentage, ref sngXDisplacementDirection);
										}
										else
										{
											int itemIndex6 = (int)num3;
											float sngPosX5 = (float)((double)(val + (float)rect.Left) + (double)rect.Width / 2.0);
											float sngPosY5 = (float)((double)(num17 + (float)rect.Top) + (double)rect.Height / 2.0);
											string value5 = text;
											double numericValue5 = num7;
											float sngHotSpotX5 = (float)((double)val * 0.9 + (double)rect.Left + (double)rect.Width / 2.0);
											float sngHotSpotY5 = (float)((double)num17 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
											float sngXDisplacementDirection = 0f;
											float percentage = 0f;
											valueCaption = new ValueCaption(0, itemIndex6, sngPosX5, sngPosY5, value5, numericValue5, sngHotSpotX5, sngHotSpotY5, ref sngXDisplacementDirection, ref percentage);
										}
										break;
									case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_DEFAULT:
									{
										int itemIndex4 = (int)num3;
										float sngPosX3 = (float)((double)val * 0.9 + (double)rect.Left + (double)rect.Width / 2.0);
										float sngPosY3 = (float)((double)num17 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
										string value3 = text;
										double numericValue3 = num7;
										float sngHotSpotX3 = (float)((double)val * 0.9 + (double)rect.Left + (double)rect.Width / 2.0);
										float sngHotSpotY3 = (float)((double)num17 * 0.9 + (double)rect.Top + (double)rect.Height / 2.0);
										float sngXDisplacementDirection = (float)num15;
										float percentage = (float)num16;
										ValueCaption valueCaption2 = new ValueCaption(0, itemIndex4, sngPosX3, sngPosY3, value3, numericValue3, sngHotSpotX3, sngHotSpotY3, ref sngXDisplacementDirection, ref percentage);
										num16 = percentage;
										num15 = sngXDisplacementDirection;
										valueCaption = valueCaption2;
										break;
									}
									case STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_SMART_PLACEMENT:
										if (val > 0f)
										{
											int itemIndex2 = (int)num3;
											float sngPosX = (float)(rect.Left + rect.Width) + num4;
											float sngPosY = (float)((double)num17 * 0.8 + (double)rect.Top + (double)rect.Height / 2.0);
											string value = text;
											double numericValue = num7;
											float sngHotSpotX = (float)((double)val * 0.8 + (double)rect.Left + (double)rect.Width / 2.0);
											float sngHotSpotY = (float)((double)num17 * 0.8 + (double)rect.Top + (double)rect.Height / 2.0);
											float sngXDisplacementDirection = 0f;
											float percentage = 1f;
											valueCaption = new ValueCaption(0, itemIndex2, sngPosX, sngPosY, value, numericValue, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref percentage);
										}
										else
										{
											int itemIndex3 = (int)num3;
											float sngPosX2 = (float)rect.Left - num4;
											float sngPosY2 = (float)((double)num17 * 0.8 + (double)rect.Top + (double)rect.Height / 2.0);
											string value2 = text;
											double numericValue2 = num7;
											float sngHotSpotX2 = (float)((double)val * 0.8 + (double)rect.Left + (double)rect.Width / 2.0);
											float sngHotSpotY2 = (float)((double)num17 * 0.8 + (double)rect.Top + (double)rect.Height / 2.0);
											float sngXDisplacementDirection = 0f;
											float percentage = -1f;
											valueCaption = new ValueCaption(0, itemIndex3, sngPosX2, sngPosY2, value2, numericValue2, sngHotSpotX2, sngHotSpotY2, ref sngXDisplacementDirection, ref percentage);
										}
										break;
									}
									valueCaption.AddZonePath(ref path);
									m_vcc.AddCaption(valueCaption);
								}
							}
							num6 -= num7;
							num3++;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
					}
				}
			}
		}
	}

	private void m_DrawBarGraph3D(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round(((float)r.Width - m_sngSlantX) / (float)m_lngNumX);
			float dx = m_sngSlantX / (float)(num + 1);
			float dy = m_sngSlantY / (float)(num + 1);
			m_DrawGrid3d_Start(r, num2, blnAcum: true);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			int num3 = 0;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			while (num3 < 2)
			{
				for (int i = num; i >= 0; i += -1)
				{
					long num4 = (long)Math.Round((float)r.Left + m_sngSlantX);
					num4 = (long)Math.Round((float)num4 - (float)(num - i + 1) * m_sngSlantX / (float)(num + 1));
					long num5 = (long)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)((float)r.Height - m_sngSlantY));
					num5 = (long)Math.Round((float)num5 + (float)(num - i + 1) * m_sngSlantY / (float)(num + 1));
					int itemIndex = 0;
					IEnumerator enumerator = m_arrSeriesAcum[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							if (enumerator.Current != null)
							{
								bool blnSombraTransparente = false;
								float percentage = 0.2f;
								m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
								long num6 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinYAcum), m_dblSeriesRangeYAcum), (float)r.Height - m_sngSlantY), m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)((float)r.Height - m_sngSlantY)));
								if (num6 == 0)
								{
									num6 = 1L;
								}
								if (unchecked((num6 < 0 && num3 == 0) || (num6 >= 0 && num3 > 0)))
								{
									RectangleF r2;
									if (num6 < 0)
									{
										r2 = new RectangleF(num4, num5, num2, -num6);
										Rectangle3dRenderer rectangle3dRenderer = new Rectangle3dRenderer(_g, r2, dx, dy, r, c2, c);
									}
									else
									{
										r2 = new RectangleF(num4, num5 - num6, num2, num6);
										Rectangle3dRenderer rectangle3dRenderer2 = new Rectangle3dRenderer(_g, r2, dx, dy, r, c, c2);
									}
									if (m_blnShowValues | m_blnHotSpots)
									{
										if (num6 < 0)
										{
											ValueCaptionRenderer vcc = m_vcc;
											percentage = r2.Left + r2.Width / 2f;
											float sngPosY = r2.Top - (float)num6 + 10f;
											vcc.AddCaption(new ValueCaption(ref i, ref itemIndex, ref percentage, ref sngPosY, Conversions.ToSingle(enumerator.Current)));
										}
										else
										{
											ValueCaptionRenderer vcc2 = m_vcc;
											float sngPosY = r2.Left + r2.Width / 2f;
											percentage = r2.Top - 10f;
											vcc2.AddCaption(new ValueCaption(ref i, ref itemIndex, ref sngPosY, ref percentage, Conversions.ToSingle(enumerator.Current)));
										}
									}
								}
							}
							itemIndex++;
							num4 += num2;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
					}
				}
				num3++;
				if (num3 == 1)
				{
					m_DrawGrid3d_End(r);
				}
			}
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawStackedBarGraph3D(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		float num2 = ((float)r.Width - m_sngSlantX) / (float)m_lngNumX;
		float sngSlantX = m_sngSlantX;
		float sngSlantY = m_sngSlantY;
		m_DrawGrid3d_Start(r, num2, blnAcum: true);
		stringFormat.Alignment = StringAlignment.Center;
		stringFormat.FormatFlags = StringFormatFlags.NoWrap;
		float num3 = r.Bottom;
		float num4 = r.Left;
		checked
		{
			int num5 = (int)(m_lngNumX - 1);
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (int i = 0; i <= num5; i++)
			{
				float num6 = num3;
				int num7 = num;
				for (int j = 0; j <= num7; j++)
				{
					try
					{
						if (m_arrSeries[j][i] == null)
						{
							continue;
						}
						bool blnSombraTransparente = false;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref j, ref i, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						float num8 = Conversions.ToSingle(m_arrSeries[j][i]);
						float num9 = (float)Math.Abs((double)num8 / m_dblSeriesMaxYAcum * (double)((float)r.Height - m_sngSlantY));
						if (num9 == 0f)
						{
							num9 = 1f;
						}
						RectangleF r2 = new RectangleF(num4, num6 - num9, num2, num9);
						Rectangle3dRenderer rectangle3dRenderer = new Rectangle3dRenderer(_g, r2, sngSlantX, sngSlantY, r, c, c2);
						if (m_blnShowValues | m_blnHotSpots)
						{
							if (num9 < 0f)
							{
								ValueCaptionRenderer vcc = m_vcc;
								percentage = r2.Left + r2.Width / 2f;
								float sngPosY = r2.Top - num9 + 10f;
								string value = num8.ToString(m_strValuesFormat);
								float sngHotSpotX = r2.Left + r2.Width / 2f;
								float sngHotSpotY = r2.Top - num9;
								vcc.AddCaption(new ValueCaption(ref j, ref i, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY));
							}
							else
							{
								ValueCaptionRenderer vcc2 = m_vcc;
								float sngHotSpotY = r2.Left + r2.Width / 2f;
								float sngHotSpotX = r2.Top - 10f;
								string value2 = num8.ToString(m_strValuesFormat);
								float sngPosY = r2.Left + r2.Width / 2f;
								percentage = r2.Top;
								vcc2.AddCaption(new ValueCaption(ref j, ref i, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage));
							}
						}
						num6 -= num9;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				num4 += num2;
			}
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawStackedColumnGraph3D(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		float num2 = ((float)r.Width - m_sngSlantX) / (float)m_lngNumX;
		float num3 = get_m_sngCalcThickness(num2);
		float sngSlantX = m_sngSlantX;
		float sngSlantY = m_sngSlantY;
		m_DrawGrid3d_Start(r, num2, blnAcum: true);
		stringFormat.Alignment = StringAlignment.Center;
		stringFormat.FormatFlags = StringFormatFlags.NoWrap;
		checked
		{
			float[] array = new float[(int)m_lngNumX + 1];
			float num4 = r.Bottom;
			float num5 = (float)r.Left + num2 / 2f - num3 / 2f;
			int num6 = (int)(m_lngNumX - 1);
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (int i = 0; i <= num6; i++)
			{
				float num7 = num4;
				int num8 = num;
				for (int j = 0; j <= num8; j++)
				{
					try
					{
						if (m_arrSeries[j][i] == null)
						{
							continue;
						}
						bool blnSombraTransparente = false;
						float percentage = 0.2f;
						m_CalculateColorRampFromItem(ref j, ref i, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
						float num9 = Conversions.ToSingle(m_arrSeries[j][i]);
						float num10 = (float)Math.Abs((double)num9 / m_dblSeriesMaxYAcum * (double)((float)r.Height - m_sngSlantY));
						if (num10 == 0f)
						{
							num10 = 1f;
						}
						RectangleF r2 = new RectangleF(num5, num7 - num10, num3, num10);
						Rectangle3dRenderer rectangle3dRenderer = new Rectangle3dRenderer(_g, r2, sngSlantX, sngSlantY, r, c, c2);
						if (m_blnShowValues | m_blnHotSpots)
						{
							if (num10 < 0f)
							{
								ValueCaptionRenderer vcc = m_vcc;
								percentage = r2.Left + r2.Width / 2f;
								float sngPosY = r2.Top - num10 + 10f;
								string value = num9.ToString(m_strValuesFormat);
								float sngHotSpotX = r2.Left + r2.Width / 2f;
								float sngHotSpotY = r2.Top - num10;
								vcc.AddCaption(new ValueCaption(ref j, ref i, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY));
							}
							else
							{
								ValueCaptionRenderer vcc2 = m_vcc;
								float sngHotSpotY = r2.Left + r2.Width / 2f;
								float sngHotSpotX = r2.Top - 10f;
								string value2 = num9.ToString(m_strValuesFormat);
								float sngPosY = r2.Left + r2.Width / 2f;
								percentage = r2.Top;
								vcc2.AddCaption(new ValueCaption(ref j, ref i, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage));
							}
						}
						num7 -= num10;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
				num5 += num2;
			}
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawColumnGraph3D(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		float num2 = ((float)r.Width - m_sngSlantX) / (float)m_lngNumX;
		float num3 = get_m_sngCalcThickness(num2);
		checked
		{
			float num4 = m_sngSlantX / (float)(num + 1);
			float dy = m_sngSlantY / (float)(num + 1);
			m_DrawGrid3d_Start(r, num2, blnAcum: false);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			int num5 = 0;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			while (num5 < 2)
			{
				for (int i = num; i >= 0; i += -1)
				{
					float num6 = (float)r.Left + num2 / 2f - num3 / 2f + (float)num * num4;
					num6 -= (float)(num - i) * num4;
					long num7 = (long)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY));
					num7 = (long)Math.Round((float)num7 + (float)(num - i + 1) * m_sngSlantY / (float)(num + 1));
					int itemIndex = 0;
					IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							if (enumerator.Current != null)
							{
								bool blnSombraTransparente = false;
								float percentage = 0.2f;
								m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
								long num8 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), (float)r.Height - m_sngSlantY), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY)));
								if (unchecked((num8 < 0 && num5 == 0) || (num8 >= 0 && num5 > 0)))
								{
									RectangleF r2;
									if (num8 < 0)
									{
										r2 = new RectangleF(num6, num7, num3, -num8);
										Rectangle3dRenderer rectangle3dRenderer = new Rectangle3dRenderer(_g, r2, num4, dy, r, c2, c);
									}
									else
									{
										r2 = new RectangleF(num6, num7 - num8, num3, num8);
										Rectangle3dRenderer rectangle3dRenderer2 = new Rectangle3dRenderer(_g, r2, num4, dy, r, c, c2);
									}
									if (m_blnShowValues | m_blnHotSpots)
									{
										if (num8 < 0)
										{
											ValueCaptionRenderer vcc = m_vcc;
											percentage = r2.Left + r2.Width / 2f;
											float sngPosY = r2.Top - (float)num8 + 10f;
											vcc.AddCaption(new ValueCaption(ref i, ref itemIndex, ref percentage, ref sngPosY, Conversions.ToSingle(enumerator.Current)));
										}
										else
										{
											ValueCaptionRenderer vcc2 = m_vcc;
											float sngPosY = r2.Left + r2.Width / 2f;
											percentage = r2.Top - 10f;
											vcc2.AddCaption(new ValueCaption(ref i, ref itemIndex, ref sngPosY, ref percentage, Conversions.ToSingle(enumerator.Current)));
										}
									}
								}
							}
							itemIndex++;
							num6 += num2;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
					}
				}
				num5++;
				if (num5 == 1)
				{
					m_DrawGrid3d_End(r);
				}
			}
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawLineGraph3d(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		int num = m_intValuesMaxWidth();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num2 = Information.UBound(m_arrSeries);
		checked
		{
			long num3 = (long)Math.Round(((float)r.Width - m_sngSlantX) / (float)(m_lngNumX - 1));
			m_DrawGrid3d_Start(r, num3, blnAcum: false);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			float dx = m_sngSlantX / (float)(num2 + 1);
			float dy = m_sngSlantY / (float)(num2 + 1);
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (long num4 = num2; num4 >= 0; num4 += -1)
			{
				long num5 = (long)Math.Round((float)r.Left + m_sngSlantX);
				num5 = (long)Math.Round((float)num5 - (float)(num2 - num4 + 1) * m_sngSlantX / (float)(num2 + 1));
				long num6 = (long)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY));
				num6 = (long)Math.Round((float)num6 + (float)(num2 - num4 + 1) * m_sngSlantY / (float)(num2 + 1));
				long num7 = -1L;
				int itemIndex = 1;
				IEnumerator enumerator = m_arrSeries[(int)num4].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							int serieIndex = (int)num4;
							int itemIndex2 = itemIndex - 1;
							bool blnSombraTransparente = false;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex2, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							num4 = serieIndex;
							long num8 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), (float)r.Height - m_sngSlantY), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY)));
							RectangleF r2;
							if (num7 != -1)
							{
								r2 = new RectangleF(num5 - num3, num6 - num7, num3, num7 - num8);
								Line3dRenderer line3dRenderer = new Line3dRenderer(_g, r2, dx, dy, r, c, c2);
							}
							else
							{
								r2 = new RectangleF(num5 - num3, num6 - num8, num3, 1f);
							}
							if (m_blnShowValues | m_blnHotSpots)
							{
								float sngHotSpotY = r2.Bottom;
								float sngPosY = ((num8 <= num7) ? (r2.Bottom + m_sngSlantY + 15f) : (r2.Bottom - 15f));
								if (sngPosY < (float)r.Top)
								{
									sngPosY = r.Top + 25;
								}
								else if (sngPosY > (float)r.Bottom)
								{
									sngPosY = r.Bottom - 25;
								}
								ValueCaptionRenderer vcc = m_vcc;
								itemIndex2 = (int)num4;
								percentage = r2.Right;
								string value = Conversions.ToString(enumerator.Current);
								float sngHotSpotX = r2.Right;
								ValueCaption vc = new ValueCaption(ref itemIndex2, ref itemIndex, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
								num4 = itemIndex2;
								vcc.AddCaption(vc);
							}
							num7 = num8;
						}
						num5 += num3;
						itemIndex++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			m_DrawGrid3d_End(r);
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawStackedAreaGraph3d(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		PointF[] array = new PointF[4];
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round(((float)r.Width - m_sngSlantX) / (float)(m_lngNumX - 1));
			m_DrawGrid3d_Start(r, num2, blnAcum: true);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			float dx = m_sngSlantX / (float)(num + 1);
			float dy = m_sngSlantY / (float)(num + 1);
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			long num9 = default(long);
			for (long num3 = num; num3 >= 0; num3 += -1)
			{
				long num4 = (long)Math.Round((float)r.Left + m_sngSlantX);
				num4 = (long)Math.Round((float)num4 - (float)(num - num3 + 1) * m_sngSlantX / (float)(num + 1));
				long num5 = (long)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)((float)r.Height - m_sngSlantY));
				num5 = (long)Math.Round((float)num5 + (float)(num - num3 + 1) * m_sngSlantY / (float)(num + 1));
				long num6 = -1L;
				IEnumerator enumerator = m_arrSeriesAcum[(int)num3].GetEnumerator();
				long num7 = 0L;
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							int serieIndex = (int)num3;
							int itemIndex = (int)num7;
							bool blnSombraTransparente = false;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							num7 = itemIndex;
							num3 = serieIndex;
							long num8 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinYAcum), m_dblSeriesRangeYAcum), (float)r.Height - m_sngSlantY), m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)((float)r.Height - m_sngSlantY)));
							if (num6 != -1)
							{
								ref PointF reference = ref array[0];
								reference = new PointF(num4 - num2 - 1, num5);
								ref PointF reference2 = ref array[1];
								reference2 = new PointF(num4 - num2 - 1, num5 - num6);
								ref PointF reference3 = ref array[2];
								reference3 = new PointF(num4, num5 - num8);
								ref PointF reference4 = ref array[3];
								reference4 = new PointF(num4, num5);
								Area3dRenderer area3dRenderer = new Area3dRenderer(_g, array, dx, dy, r, c, c2, num7 == 1, num7 == m_lngNumX - 1);
							}
							if (m_blnShowValues | m_blnHotSpots)
							{
								if (num9 < 0)
								{
									ValueCaptionRenderer vcc = m_vcc;
									itemIndex = (int)num3;
									serieIndex = (int)num7;
									percentage = num4;
									float sngPosY = num5 - num8 + 10;
									string value = Conversions.ToString(enumerator.Current);
									float sngHotSpotX = num4;
									float sngHotSpotY = num5 - num8;
									ValueCaption vc = new ValueCaption(ref itemIndex, ref serieIndex, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
									num4 = (long)Math.Round(sngHotSpotX);
									num4 = (long)Math.Round(percentage);
									num7 = serieIndex;
									num3 = itemIndex;
									vcc.AddCaption(vc);
								}
								else
								{
									ValueCaptionRenderer vcc2 = m_vcc;
									itemIndex = (int)num3;
									serieIndex = (int)num7;
									float sngHotSpotY = num4;
									float sngHotSpotX = num5 - num8 - 10;
									string value2 = Conversions.ToString(enumerator.Current);
									float sngPosY = num4;
									percentage = num5 - num8;
									ValueCaption vc2 = new ValueCaption(ref itemIndex, ref serieIndex, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage);
									num4 = (long)Math.Round(sngPosY);
									num4 = (long)Math.Round(sngHotSpotY);
									num7 = serieIndex;
									num3 = itemIndex;
									vcc2.AddCaption(vc2);
								}
							}
							num6 = num8;
						}
						num4 += num2;
						num7++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			m_DrawGrid3d_End(r);
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawCylinderGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		float num2 = (float)((double)r.Width / (double)m_lngNumX);
		checked
		{
			float num3 = get_m_sngCalcThickness(num2 / (float)(num + 1));
			long num4 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			if (m_blnShadow)
			{
				long num5 = 0L;
				long num6 = num;
				for (long num7 = num5; num7 <= num6; num7++)
				{
					float num8 = (float)((double)((float)r.Left + num3 * (float)num7) + (double)num2 * 0.125);
					int itemIndex = 0;
					IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							if (enumerator.Current != null)
							{
								int serieIndex = (int)num7;
								bool blnSombraTransparente = true;
								float percentage = 0.2f;
								m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
								num7 = serieIndex;
								long num9 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
								if (num9 < 0)
								{
									Rectangle rectangle = new Rectangle((int)Math.Round(num8), (int)num4, (int)Math.Round(num3), (int)(-num9));
									m_DrawRectShadow(rectangle, c, c2);
								}
								else
								{
									if (num9 == 0)
									{
										num9 = 1L;
									}
									Rectangle rectangle = new Rectangle((int)Math.Round(num8), (int)(num4 - num9), (int)Math.Round(num3), (int)num9);
									m_DrawRectShadow(rectangle, c2, c);
								}
							}
							itemIndex++;
							num8 += num2;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
					}
				}
			}
			long num10 = 0L;
			long num11 = num;
			for (long num7 = num10; num7 <= num11; num7++)
			{
				float num8 = (float)((double)((float)r.Left + num3 * (float)num7) + (double)num2 * 0.125);
				int itemIndex2 = 0;
				IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							int serieIndex = (int)num7;
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex2, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							num7 = serieIndex;
							long num9 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							Rectangle rectangle;
							if (num9 < 0)
							{
								rectangle = new Rectangle((int)Math.Round(num8), (int)num4, (int)Math.Round(num3), (int)(-num9));
								LinearGradientBrush linearGradientBrush = new LinearGradientBrush(rectangle, c2, c, LinearGradientMode.Horizontal);
								linearGradientBrush.SetSigmaBellShape(0.5f);
								_g.FillRectangle(linearGradientBrush, rectangle);
							}
							else
							{
								if (num9 == 0)
								{
									num9 = 1L;
								}
								rectangle = new Rectangle((int)Math.Round(num8), (int)(num4 - num9), (int)Math.Round(num3), (int)num9);
								LinearGradientBrush linearGradientBrush = new LinearGradientBrush(rectangle, c2, c, LinearGradientMode.Horizontal);
								linearGradientBrush.SetSigmaBellShape(0.5f);
								_g.FillRectangle(linearGradientBrush, rectangle);
							}
							_g.DrawRectangle(new Pen(Color.Black, 1f), rectangle);
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaption valueCaption2;
								if (num9 < 0)
								{
									serieIndex = (int)num7;
									percentage = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngPosY = rectangle.Top - num9 + 10;
									string value = Conversions.ToString(enumerator.Current);
									float sngHotSpotX = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotY = rectangle.Top - num9;
									ValueCaption valueCaption = new ValueCaption(ref serieIndex, ref itemIndex2, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
									num7 = serieIndex;
									valueCaption2 = valueCaption;
								}
								else
								{
									serieIndex = (int)num7;
									float sngHotSpotY = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotX = rectangle.Top - 10;
									string value2 = Conversions.ToString(enumerator.Current);
									float sngPosY = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									percentage = rectangle.Top;
									ValueCaption valueCaption3 = new ValueCaption(ref serieIndex, ref itemIndex2, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage);
									num7 = serieIndex;
									valueCaption2 = valueCaption3;
								}
								valueCaption2.AddZoneRectangle(ref rectangle);
								m_vcc.AddCaption(valueCaption2);
							}
						}
						itemIndex2++;
						num8 += num2;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawPictureGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		float num2 = (float)((double)r.Width / (double)m_lngNumX);
		checked
		{
			float num3 = (float)((double)num2 * (0.75 / (double)(num + 1)));
			long num4 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			long num5 = 0L;
			long num6 = num;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (long num7 = num5; num7 <= num6; num7++)
			{
				float num8 = (float)((double)((float)r.Left + num3 * (float)num7) + (double)num2 * 0.125);
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							int serieIndex = (int)num7;
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							num7 = serieIndex;
							long num9 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							Rectangle r2;
							if (num9 < 0)
							{
								r2 = new Rectangle((int)Math.Round(num8), (int)num4, (int)Math.Round(num3), (int)(-num9));
							}
							else
							{
								if (num9 == 0)
								{
									num9 = 1L;
								}
								r2 = new Rectangle((int)Math.Round(num8), (int)(num4 - num9), (int)Math.Round(num3), (int)num9);
							}
							if (m_arrSeriesPictures[(int)num7] != null)
							{
								_g.g.DrawImage(m_arrSeriesPictures[(int)num7], r2);
							}
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaption valueCaption2;
								if (num9 < 0)
								{
									serieIndex = (int)num7;
									percentage = (float)((double)r2.Left + (double)r2.Width / 2.0);
									float sngPosY = r2.Top - num9 + 10;
									string value = Conversions.ToString(enumerator.Current);
									float sngHotSpotX = (float)((double)r2.Left + (double)r2.Width / 2.0);
									float sngHotSpotY = r2.Top - num9;
									ValueCaption valueCaption = new ValueCaption(ref serieIndex, ref itemIndex, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
									num7 = serieIndex;
									valueCaption2 = valueCaption;
								}
								else
								{
									serieIndex = (int)num7;
									float sngHotSpotY = (float)((double)r2.Left + (double)r2.Width / 2.0);
									float sngHotSpotX = r2.Top - 10;
									string value2 = Conversions.ToString(enumerator.Current);
									float sngPosY = (float)((double)r2.Left + (double)r2.Width / 2.0);
									percentage = r2.Top;
									ValueCaption valueCaption3 = new ValueCaption(ref serieIndex, ref itemIndex, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage);
									num7 = serieIndex;
									valueCaption2 = valueCaption3;
								}
								valueCaption2.AddZoneRectangle(ref r2);
								m_vcc.AddCaption(valueCaption2);
							}
						}
						itemIndex++;
						num8 += num2;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawPyramidGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		float num2 = (float)((double)r.Width / (double)m_lngNumX);
		checked
		{
			float num3 = (float)((double)num2 * (0.75 / (double)(num + 1)));
			long num4 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			PointF[] points = new PointF[3];
			PointF[] array = new PointF[3];
			long num5 = 0L;
			long num6 = num;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			for (long num7 = num5; num7 <= num6; num7++)
			{
				float num8 = (float)((double)((float)r.Left + num3 * (float)num7) + (double)num2 * 0.125);
				int itemIndex = 0;
				IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							int serieIndex = (int)num7;
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							num7 = serieIndex;
							long num9 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							Rectangle rect;
							if (num9 < 0)
							{
								rect = new Rectangle((int)Math.Round(num8), (int)num4, (int)Math.Round(num3), (int)(-num9));
								ref PointF reference = ref points[0];
								reference = new PointF(rect.Left, rect.Top);
								ref PointF reference2 = ref points[1];
								reference2 = new PointF(rect.Right, rect.Top);
								ref PointF reference3 = ref points[2];
								reference3 = new PointF((float)((double)rect.Left + (double)rect.Width / 2.0), rect.Bottom);
								if (m_blnShadow)
								{
									ref PointF reference4 = ref array[0];
									reference4 = new PointF(points[0].X + 5f, points[0].Y - 5f);
									ref PointF reference5 = ref array[1];
									reference5 = new PointF(points[1].X + 5f, points[1].Y - 5f);
									ref PointF reference6 = ref array[2];
									reference6 = new PointF(points[2].X + 5f, points[2].Y - 5f);
									RectangleF rect2 = new RectangleF(rect.Left + 5, rect.Top - 5, rect.Width, rect.Height);
									_g.FillPolygon(new LinearGradientBrush(rect2, c2a, c1a, LinearGradientMode.Vertical), array);
								}
								_g.FillPolygon(new LinearGradientBrush(rect, c2, c, LinearGradientMode.Vertical), points);
							}
							else
							{
								if (num9 == 0)
								{
									num9 = 1L;
								}
								rect = new Rectangle((int)Math.Round(num8), (int)(num4 - num9), (int)Math.Round(num3), (int)num9);
								ref PointF reference7 = ref points[0];
								reference7 = new PointF((float)((double)rect.Left + (double)rect.Width / 2.0), rect.Top);
								ref PointF reference8 = ref points[1];
								reference8 = new PointF(rect.Left, rect.Bottom);
								ref PointF reference9 = ref points[2];
								reference9 = new PointF(rect.Right, rect.Bottom);
								if (m_blnShadow)
								{
									ref PointF reference10 = ref array[0];
									reference10 = new PointF(points[0].X + 5f, points[0].Y - 5f);
									ref PointF reference11 = ref array[1];
									reference11 = new PointF(points[1].X + 5f, points[1].Y - 5f);
									ref PointF reference12 = ref array[2];
									reference12 = new PointF(points[2].X + 5f, points[2].Y - 5f);
									RectangleF rect2 = new RectangleF(rect.Left + 5, rect.Top - 5, rect.Width, rect.Height);
									_g.FillPolygon(new LinearGradientBrush(rect2, c1a, c2a, LinearGradientMode.Vertical), array);
								}
								_g.FillPolygon(new LinearGradientBrush(rect, c2, c, LinearGradientMode.Vertical), points);
							}
							_g.DrawPolygon(new Pen(Color.Black, 2f), points);
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaption valueCaption2;
								if (num9 < 0)
								{
									serieIndex = (int)num7;
									percentage = (float)((double)rect.Left + (double)rect.Width / 2.0);
									float sngPosY = rect.Top - num9 + 10;
									string value = Conversions.ToString(enumerator.Current);
									float sngHotSpotX = (float)((double)rect.Left + (double)rect.Width / 2.0);
									float sngHotSpotY = rect.Top - num9;
									ValueCaption valueCaption = new ValueCaption(ref serieIndex, ref itemIndex, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
									num7 = serieIndex;
									valueCaption2 = valueCaption;
								}
								else
								{
									serieIndex = (int)num7;
									float sngHotSpotY = (float)((double)rect.Left + (double)rect.Width / 2.0);
									float sngHotSpotX = rect.Top - 10;
									string value2 = Conversions.ToString(enumerator.Current);
									float sngPosY = (float)((double)rect.Left + (double)rect.Width / 2.0);
									percentage = rect.Top;
									ValueCaption valueCaption3 = new ValueCaption(ref serieIndex, ref itemIndex, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage);
									num7 = serieIndex;
									valueCaption2 = valueCaption3;
								}
								valueCaption2.AddZonePolygon(ref points);
								m_vcc.AddCaption(valueCaption2);
							}
						}
						itemIndex++;
						num8 += num2;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawCylinderGraph3D(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round(((float)r.Width - m_sngSlantX) / (float)m_lngNumX);
			float dx = get_m_sngCalcThickness(m_sngSlantX);
			float dy = m_sngSlantY / (float)(num + 1);
			m_DrawGrid3d_Start(r, num2, blnAcum: true);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			int num3 = 0;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			while (num3 < 2)
			{
				for (int i = num; i >= 0; i += -1)
				{
					long num4 = (long)Math.Round((float)r.Left + m_sngSlantX);
					num4 = (long)Math.Round((float)num4 - (float)(num - i + 1) * m_sngSlantX / (float)(num + 1));
					long num5 = (long)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)((float)r.Height - m_sngSlantY));
					num5 = (long)Math.Round((float)num5 + (float)(num - i + 1) * m_sngSlantY / (float)(num + 1));
					int itemIndex = 0;
					IEnumerator enumerator = m_arrSeriesAcum[i].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							if (enumerator.Current != null)
							{
								bool blnSombraTransparente = false;
								float percentage = 0.2f;
								m_CalculateColorRampFromItem(ref i, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
								long num6 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinYAcum), m_dblSeriesRangeYAcum), (float)r.Height - m_sngSlantY), m_dblSeriesMiddleYAcum / m_dblSeriesRangeYAcum * (double)((float)r.Height - m_sngSlantY)));
								if (num6 == 0)
								{
									num6 = 1L;
								}
								if (unchecked((num6 < 0 && num3 == 0) || (num6 >= 0 && num3 > 0)))
								{
									RectangleF r2;
									if (num6 < 0)
									{
										r2 = new RectangleF(num4, num5, num2, -num6);
										Cylinder3dRenderer cylinder3dRenderer = new Cylinder3dRenderer(_g, r2, dx, dy, m_arrSeriesColor[i]);
									}
									else
									{
										r2 = new RectangleF(num4, num5 - num6, num2, num6);
										Cylinder3dRenderer cylinder3dRenderer2 = new Cylinder3dRenderer(_g, r2, dx, dy, m_arrSeriesColor[i]);
									}
									if (m_blnShowValues | m_blnHotSpots)
									{
										if (num6 < 0)
										{
											ValueCaptionRenderer vcc = m_vcc;
											percentage = r2.Left + r2.Width / 2f;
											float sngPosY = r2.Top - (float)num6 + 10f;
											vcc.AddCaption(new ValueCaption(ref i, ref itemIndex, ref percentage, ref sngPosY, Conversions.ToSingle(enumerator.Current)));
										}
										else
										{
											ValueCaptionRenderer vcc2 = m_vcc;
											float sngPosY = r2.Left + r2.Width / 2f;
											percentage = r2.Top - 10f;
											vcc2.AddCaption(new ValueCaption(ref i, ref itemIndex, ref sngPosY, ref percentage, Conversions.ToSingle(enumerator.Current)));
										}
									}
								}
							}
							num4 += num2;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
						itemIndex++;
					}
				}
				num3++;
				if (num3 == 1)
				{
					m_DrawGrid3d_End(r);
				}
			}
			m_DrawGrid3d_Box(r);
		}
	}

	private void m_DrawRoundedBarGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		float num2 = (float)((double)r.Width / (double)m_lngNumX);
		checked
		{
			float num3 = (float)((double)num2 * (0.75 / (double)(num + 1)));
			long num4 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			if (m_blnShadow)
			{
				long num5 = 0L;
				long num6 = num;
				for (long num7 = num5; num7 <= num6; num7++)
				{
					float num8 = (float)((double)((float)r.Left + num3 * (float)num7) + (double)num2 * 0.125);
					int itemIndex = 0;
					IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							if (enumerator.Current != null)
							{
								int serieIndex = (int)num7;
								bool blnSombraTransparente = true;
								float percentage = 0.2f;
								m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
								num7 = serieIndex;
								long num9 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
								if (num9 < 0)
								{
									Rectangle rectangle = new Rectangle((int)Math.Round(num8), (int)num4, (int)Math.Round(num3), (int)(-num9));
									m_DrawRectShadow(rectangle, c, c2);
								}
								else
								{
									if (num9 == 0)
									{
										num9 = 1L;
									}
									Rectangle rectangle = new Rectangle((int)Math.Round(num8), (int)(num4 - num9), (int)Math.Round(num3), (int)num9);
									m_DrawRectShadow(rectangle, c2, c);
								}
							}
							itemIndex++;
							num8 += num2;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
					}
				}
			}
			long num10 = 0L;
			long num11 = num;
			for (long num7 = num10; num7 <= num11; num7++)
			{
				float num8 = (float)((double)((float)r.Left + num3 * (float)num7) + (double)num2 * 0.125);
				int itemIndex2 = 0;
				IEnumerator enumerator = m_arrSeries[(int)num7].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							int serieIndex = (int)num7;
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex2, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							num7 = serieIndex;
							long num9 = Conversions.ToLong(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
							Rectangle rectangle;
							RoundedRectangle roundedRectangle;
							if (num9 < 0)
							{
								rectangle = new Rectangle((int)Math.Round(num8), (int)num4, (int)Math.Round(num3), (int)(-num9));
								LinearGradientBrush linearGradientBrush = new LinearGradientBrush(rectangle, c2, c, LinearGradientMode.Horizontal);
								linearGradientBrush.SetSigmaBellShape(0.5f);
								roundedRectangle = new RoundedRectangle(_g, rectangle, 0.7f);
								roundedRectangle.Render(Color.Black, linearGradientBrush);
							}
							else
							{
								if (num9 == 0)
								{
									num9 = 1L;
								}
								rectangle = new Rectangle((int)Math.Round(num8), (int)(num4 - num9), (int)Math.Round(num3), (int)num9);
								LinearGradientBrush linearGradientBrush = new LinearGradientBrush(rectangle, c2, c, LinearGradientMode.Horizontal);
								linearGradientBrush.SetSigmaBellShape(0.5f);
								roundedRectangle = new RoundedRectangle(_g, rectangle, 0.7f);
								roundedRectangle.Render(Color.Black, linearGradientBrush);
							}
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaption valueCaption2;
								if (num9 < 0)
								{
									serieIndex = (int)num7;
									percentage = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngPosY = rectangle.Top - num9 + 10;
									string value = Conversions.ToString(enumerator.Current);
									float sngHotSpotX = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotY = rectangle.Top - num9;
									ValueCaption valueCaption = new ValueCaption(ref serieIndex, ref itemIndex2, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
									num7 = serieIndex;
									valueCaption2 = valueCaption;
								}
								else
								{
									serieIndex = (int)num7;
									float sngHotSpotY = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									float sngHotSpotX = rectangle.Top - 10;
									string value2 = Conversions.ToString(enumerator.Current);
									float sngPosY = (float)((double)rectangle.Left + (double)rectangle.Width / 2.0);
									percentage = rectangle.Top;
									ValueCaption valueCaption3 = new ValueCaption(ref serieIndex, ref itemIndex2, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage);
									num7 = serieIndex;
									valueCaption2 = valueCaption3;
								}
								ValueCaption valueCaption4 = valueCaption2;
								GraphicsPath path = roundedRectangle.PATH;
								valueCaption4.AddZonePath(ref path);
								m_vcc.AddCaption(valueCaption2);
							}
						}
						itemIndex2++;
						num8 += num2;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawCalculationVertical(Rectangle r)
	{
		if ((m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME))
		{
			switch (m_CalculationStyle)
			{
			case CALCULATION.CALCULATION_AVERAGE_SPLINE:
				m_DrawCalculationAverageSplineScatterDateTime(r);
				break;
			case CALCULATION.CALCULATION_AVERAGE:
				m_DrawCalculationAverageScatterDateTime(r);
				break;
			}
			return;
		}
		if ((m_lngStyle == STYLE2D3D.STYLE2D_XY) | (m_lngStyle == STYLE2D3D.STYLE2D_BUBBLE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE_DEV))
		{
			switch (m_CalculationStyle)
			{
			case CALCULATION.CALCULATION_AVERAGE_SPLINE:
				m_DrawCalculationAverageSpline2D(r);
				break;
			case CALCULATION.CALCULATION_AVERAGE:
				m_DrawCalculationAverage2D(r);
				break;
			}
			return;
		}
		switch (m_CalculationStyle)
		{
		case CALCULATION.CALCULATION_AVERAGE:
		case CALCULATION.CALCULATION_PARETO:
		case CALCULATION.CALCULATION_TOP_LINE:
			m_DrawCalculationAverageVertical(r);
			break;
		case CALCULATION.CALCULATION_AVERAGE_SPLINE:
		case CALCULATION.CALCULATION_TOP_SPLINE:
			m_DrawCalculationAverageSplineVertical(r);
			break;
		case (CALCULATION)12:
		case (CALCULATION)13:
		case (CALCULATION)14:
		case (CALCULATION)15:
		case (CALCULATION)16:
		case (CALCULATION)17:
		case (CALCULATION)18:
		case (CALCULATION)19:
		case (CALCULATION)21:
		case (CALCULATION)22:
		case (CALCULATION)23:
		case (CALCULATION)24:
		case (CALCULATION)25:
		case (CALCULATION)26:
		case (CALCULATION)27:
		case (CALCULATION)28:
		case (CALCULATION)29:
			break;
		}
	}

	private void m_DrawCalculationAverageVertical(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			float num3 = default(float);
			float num4 = default(float);
			if ((m_lngStyle == STYLE2D3D.STYLE2D_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_PYRAMID) | (m_lngStyle == STYLE2D3D.STYLE2D_PICTURES) | (m_lngStyle == STYLE2D3D.STYLE2D_CYLINDER) | (m_lngStyle == STYLE2D3D.STYLE2D_ROUNDED_BAR))
			{
				num3 = (float)((double)r.Width / (double)m_lngNumX);
				num4 = (float)r.Left + num3 / 2f;
			}
			else if (m_lngStyle == STYLE2D3D.STYLE2D_POINT)
			{
				num3 = (float)((double)r.Width / (double)m_lngNumX);
				num4 = r.Left + 15;
			}
			long num5 = -1L;
			float x = num4 - num3;
			int num6 = Information.UBound(m_arrCalculation);
			for (int i = 0; i <= num6; i++)
			{
				try
				{
					if (m_arrCalculation[i] > double.MinValue)
					{
						long num7 = (long)Math.Round((m_arrCalculation[i] - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Height - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
						if (num5 != -1)
						{
							_g.DrawLine(m_CalculationLineStyle, x, num2 - num5, num4, num2 - num7);
						}
						num5 = num7;
						x = num4;
					}
					num4 += num3;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					ProjectData.ClearProjectError();
				}
			}
		}
	}

	private void m_DrawGrid3d_Start(Rectangle r, float stepX, bool blnAcum)
	{
		StringFormat stringFormat = new StringFormat();
		Pen pen = new Pen(Color.Black);
		PointF[] array = new PointF[4];
		checked
		{
			if ((m_lngNumDividersY > 0) & (m_WallsBackStyle != STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_TRANSPARENT))
			{
				int num = (int)(m_lngNumDividersY - 1);
				for (int i = 0; i <= num; i++)
				{
					Color color = ((unchecked(i % 2) != 0) ? m_WallsBackColorSecondary : m_WallsBackColorPrincipal);
					float num2 = (float)r.Bottom - (float)i * ((float)r.Height - m_sngSlantY) / (float)m_lngNumDividersY;
					float num3 = (float)r.Bottom - (float)(i + 1) * ((float)r.Height - m_sngSlantY) / (float)m_lngNumDividersY;
					ref PointF reference = ref array[0];
					reference = new PointF(r.Left, num2);
					ref PointF reference2 = ref array[1];
					reference2 = new PointF(r.Left, num3);
					ref PointF reference3 = ref array[2];
					reference3 = new PointF((float)r.Left + m_sngSlantX, num3 - m_sngSlantY);
					ref PointF reference4 = ref array[3];
					reference4 = new PointF((float)r.Left + m_sngSlantX, num2 - m_sngSlantY);
					_g.FillPolygon(new SolidBrush(color), array);
					if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_BANDS)
					{
						_g.FillRectangle(new SolidBrush(color), Rectangle.FromLTRB((int)Math.Round((float)r.Left + m_sngSlantX), (int)Math.Round(num3 - m_sngSlantY), r.Right, (int)Math.Round(num2 - m_sngSlantY)));
						continue;
					}
					int num4 = (int)(m_lngNumX - 1);
					for (int j = 0; j <= num4; j++)
					{
						float num5 = (float)r.Left + (float)j * stepX + m_sngSlantX;
						_g.FillRectangle(new SolidBrush(color), Rectangle.FromLTRB((int)Math.Round(num5), (int)Math.Round(num3 - m_sngSlantY), (int)Math.Round((float)r.Left + (float)(j + 1) * stepX + m_sngSlantX), (int)Math.Round(num2 - m_sngSlantY)));
						unchecked
						{
							color = ((checked(j + i) % 2 != 0) ? m_WallsBackColorPrincipal : m_WallsBackColorSecondary);
						}
					}
				}
			}
			CustomGraphics g = _g;
			Rectangle r2 = new Rectangle((int)Math.Round((float)r.Left + m_sngSlantX), r.Top, (int)Math.Round((float)r.Width - m_sngSlantX), (int)Math.Round((float)r.Height - m_sngSlantY));
			g.DrawRectangle(pen, r2);
			_g.DrawLine(pen, r.Left, (long)Math.Round((float)r.Top + m_sngSlantY), r.Left, r.Bottom);
			_g.DrawLine(pen, r.Left, (long)Math.Round((float)r.Top + m_sngSlantY), (long)Math.Round((float)r.Left + m_sngSlantX), r.Top);
			_g.DrawLine(pen, r.Left, r.Bottom, (long)Math.Round((float)r.Left + m_sngSlantX), (long)Math.Round((float)r.Bottom - m_sngSlantY));
			_g.DrawLine(pen, r.Left, r.Bottom, (long)Math.Round((float)r.Right - m_sngSlantX), r.Bottom);
			_g.DrawLine(pen, (long)Math.Round((float)r.Right - m_sngSlantX), r.Bottom, r.Right, (long)Math.Round((float)r.Bottom - m_sngSlantY));
			stringFormat.Alignment = StringAlignment.Far;
			stringFormat.LineAlignment = StringAlignment.Center;
			pen.DashStyle = DashStyle.Dot;
			if (m_lngNumDividersY > 0)
			{
				int num6 = (int)m_lngNumDividersY;
				for (int i = 0; i <= num6; i++)
				{
					float num2 = (float)r.Bottom - (float)i * ((float)r.Height - m_sngSlantY) / (float)m_lngNumDividersY;
					_g.DrawLine(m_GridLineStyle, r.Left, num2, (float)r.Left + m_sngSlantX, num2 - m_sngSlantY);
					_g.DrawLine(m_GridLineStyle, (float)r.Left + m_sngSlantX, num2 - m_sngSlantY, r.Right, num2 - m_sngSlantY);
					RectangleF rf = new RectangleF(r.Left - m_YAxisCurrentWidth - 5, num2 - 10f, m_YAxisCurrentWidth, 20f);
					if (m_blnYAxisLabelsRotated)
					{
						_g.TranslateTransform(rf.Left, rf.Top + 35f);
						_g.RotateTransform(-45f);
						rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
					}
					if (blnAcum)
					{
						_g.DrawString(((double)i * m_dblSeriesRangeYAcum / (double)m_lngNumDividersY + m_dblSeriesMinYAcum).ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(Color.Black), rf, stringFormat);
					}
					else
					{
						_g.DrawString(((double)i * m_dblSeriesRangeY / (double)m_lngNumDividersY + m_dblSeriesMinY).ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(Color.Black), rf, stringFormat);
					}
					_g.ResetTransform();
					if (m_YAxisTickLength != 0)
					{
						_g.DrawLine(new Pen(Color.Black), r.Left, num2, r.Left - m_YAxisTickLength, num2);
					}
				}
			}
			if (m_blnShowDividersX)
			{
				int num7 = (int)(m_lngNumX - 1);
				for (int i = 1; i <= num7; i++)
				{
					float num5 = (float)r.Left + (float)i * stepX;
					_g.DrawLine(m_GridLineStyle, num5 + m_sngSlantX, (float)r.Bottom - m_sngSlantY, num5, r.Bottom);
					_g.DrawLine(m_GridLineStyle, num5 + m_sngSlantX, (float)r.Bottom - m_sngSlantY, num5 + m_sngSlantX, r.Top);
				}
			}
			if (m_XAxisTickLength > 0)
			{
				Pen pen2 = new Pen(XAxisColor);
				int num8 = (int)(m_lngNumX - 1);
				for (int i = 1; i <= num8; i++)
				{
					float num5 = (float)r.Left + (float)i * stepX;
					_g.DrawLine(pen2, num5, r.Bottom + 1, num5, r.Bottom + m_XAxisTickLength);
				}
			}
			if ((m_dblSeriesMinY < 0.0) & m_blnSurface)
			{
				gp = new GraphicsPath();
				int num9 = (int)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY));
				gp.StartFigure();
				gp.AddLine(r.Left, (float)num9 + m_sngSlantY, (float)r.Left + m_sngSlantX, num9);
				gp.AddLine((float)r.Left + m_sngSlantX, num9, r.Right, num9);
				gp.AddLine((float)r.Right - m_sngSlantX, (float)num9 + m_sngSlantY, r.Left, (float)num9 + m_sngSlantY);
				gp.CloseFigure();
				_g.DrawPath(new Pen(Color.Black), gp);
			}
		}
	}

	private void m_DrawGrid3d_End(Rectangle r)
	{
		try
		{
			if (!((r.Height < 1) | (r.Width < 1)) && ((m_dblSeriesMinY < 0.0) & m_blnSurface))
			{
				gp = new GraphicsPath();
				int num = checked((int)Math.Round((double)((float)r.Bottom - m_sngSlantY) - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)((float)r.Height - m_sngSlantY)));
				gp.StartFigure();
				gp.AddLine(r.Left, (float)num + m_sngSlantY, (float)r.Left + m_sngSlantX, num);
				gp.AddLine((float)r.Left + m_sngSlantX, num, r.Right, num);
				gp.AddLine((float)r.Right - m_sngSlantX, (float)num + m_sngSlantY, r.Left, (float)num + m_sngSlantY);
				gp.CloseFigure();
				_g.FillPath(new SolidBrush(Color.FromArgb(64, 148, 232, 255)), gp);
				_g.DrawLine(new Pen(Color.Black, 1f), (float)r.Right - m_sngSlantX, (float)num + m_sngSlantY, r.Left, (float)num + m_sngSlantY);
				gp.Reset();
				gp.StartFigure();
				gp.AddLine(r.Left, (float)num + m_sngSlantY, (float)r.Right - m_sngSlantX, (float)num + m_sngSlantY);
				gp.AddLine((float)r.Right - m_sngSlantX, (float)num + m_sngSlantY, (float)r.Right - m_sngSlantX, r.Bottom);
				gp.AddLine((float)r.Right - m_sngSlantX, r.Bottom, r.Left, r.Bottom);
				gp.CloseFigure();
				_g.FillPath(new LinearGradientBrush(gp.GetBounds(), Color.FromArgb(64, 148, 232, 255), Color.FromArgb(64, 128, 192, 255), LinearGradientMode.Vertical), gp);
				gp.Reset();
				gp.StartFigure();
				gp.AddLine((float)r.Right - m_sngSlantX, (float)num + m_sngSlantY, r.Right, num);
				gp.AddLine(r.Right, num, r.Right, (float)r.Bottom - m_sngSlantY);
				gp.AddLine(r.Right, (float)r.Bottom - m_sngSlantY, (float)r.Right - m_sngSlantX, r.Bottom);
				gp.CloseFigure();
				_g.FillPath(new SolidBrush(Color.FromArgb(64, 88, 152, 255)), gp);
				_g.DrawPath(new Pen(Color.Black), gp);
			}
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			ProjectData.ClearProjectError();
		}
	}

	private void m_DrawGridXYZ_Box(Rectangle r, bool blnDraw)
	{
		if (m_WallsStyle == STYLEWALLS.STYLEWALLS_NOWALLS)
		{
			return;
		}
		gp = new GraphicsPath();
		gp.StartFigure();
		PointF pointF = m_transformToXY(r, 0f, r.Height, r.Width);
		PointF pointF2 = m_transformToXY(r, r.Width, r.Height, r.Width);
		PointF pointF3 = m_transformToXY(r, r.Width, r.Height, 0f);
		PointF pointF4 = m_transformToXY(r, 0f, r.Height, 0f);
		gp.AddLine(pointF.X, pointF.Y, pointF2.X, pointF2.Y);
		gp.AddLine(pointF2.X, pointF2.Y, pointF3.X, pointF3.Y);
		gp.AddLine(pointF3.X, pointF3.Y, pointF4.X, pointF4.Y);
		gp.CloseFigure();
		if (blnDraw)
		{
			if (m_WallsStyle == STYLEWALLS.STYLEWALLS_VISIBLE)
			{
				_g.FillPath(new SolidBrush(Color.FromArgb(64, 148, 232, 255)), gp);
			}
			_g.DrawPath(new Pen(Color.Black), gp);
		}
		gp.Reset();
		gp.StartFigure();
		pointF = m_transformToXY(r, 0f, 0f, r.Width);
		pointF2 = m_transformToXY(r, 0f, r.Height, r.Width);
		pointF3 = m_transformToXY(r, 0f, r.Height, 0f);
		pointF4 = m_transformToXY(r, 0f, 0f, 0f);
		gp.AddLine(pointF.X, pointF.Y, pointF2.X, pointF2.Y);
		gp.AddLine(pointF2.X, pointF2.Y, pointF3.X, pointF3.Y);
		gp.AddLine(pointF3.X, pointF3.Y, pointF4.X, pointF4.Y);
		gp.CloseFigure();
		if (blnDraw)
		{
			if (m_WallsStyle == STYLEWALLS.STYLEWALLS_VISIBLE)
			{
				_g.FillPath(new SolidBrush(Color.FromArgb(64, 88, 152, 255)), gp);
			}
			_g.DrawPath(new Pen(Color.Black), gp);
		}
		gp.Reset();
		gp.StartFigure();
		pointF = m_transformToXY(r, 0f, 0f, 0f);
		pointF2 = m_transformToXY(r, 0f, r.Height, 0f);
		pointF3 = m_transformToXY(r, r.Width, r.Height, 0f);
		pointF4 = m_transformToXY(r, r.Width, 0f, 0f);
		gp.AddLine(pointF.X, pointF.Y, pointF2.X, pointF2.Y);
		gp.AddLine(pointF2.X, pointF2.Y, pointF3.X, pointF3.Y);
		gp.AddLine(pointF3.X, pointF3.Y, pointF4.X, pointF4.Y);
		gp.CloseFigure();
		if (blnDraw)
		{
			if (m_WallsStyle == STYLEWALLS.STYLEWALLS_VISIBLE)
			{
				_g.FillPath(new SolidBrush(Color.FromArgb(64, 88, 152, 255)), gp);
			}
			_g.DrawPath(new Pen(Color.Black), gp);
		}
	}

	private void m_checkBoundaries(float dx, float dy)
	{
		if (dx < m_XYZ_minX)
		{
			m_XYZ_minX = dx;
		}
		if (dx > m_XYZ_maxX)
		{
			m_XYZ_maxX = dx;
		}
		if (dy < m_XYZ_minY)
		{
			m_XYZ_minY = dy;
		}
		if (dy > m_XYZ_maxY)
		{
			m_XYZ_maxY = dy;
		}
	}

	private PointF m_transformToXY(RectangleF r, float x, float y, float z)
	{
		if (m_XYZ_XAngle_LastValue != m_XYZ_XAngle)
		{
			m_XYZ_XAngle_LastValue = m_XYZ_XAngle;
			m_XYZ_cosXAngle = (float)Math.Cos(m_XYZ_XAngle);
			m_XYZ_sinXAngle = (float)Math.Sin(m_XYZ_XAngle);
		}
		if (m_XYZ_YAngle_LastValue != m_XYZ_YAngle)
		{
			m_XYZ_YAngle_LastValue = m_XYZ_YAngle;
			m_XYZ_cosYAngle = (float)Math.Cos(m_XYZ_YAngle);
			m_XYZ_sinYAngle = (float)Math.Sin(m_XYZ_YAngle);
		}
		if (m_XYZ_ZAngle_LastValue != m_XYZ_ZAngle)
		{
			m_XYZ_ZAngle_LastValue = m_XYZ_ZAngle;
			m_XYZ_cosZAngle = (float)Math.Cos(m_XYZ_ZAngle);
			m_XYZ_sinZAngle = (float)Math.Sin(m_XYZ_ZAngle);
		}
		float num = m_XYZ_cosYAngle * (m_XYZ_sinZAngle * y + m_XYZ_cosZAngle * x) - m_XYZ_sinYAngle * z;
		float num2 = m_XYZ_sinXAngle * (m_XYZ_cosYAngle * z + m_XYZ_sinYAngle * (m_XYZ_sinZAngle * y + m_XYZ_cosZAngle * x)) + m_XYZ_cosXAngle * (m_XYZ_cosZAngle * y - m_XYZ_sinZAngle * x);
		if (m_XYZ_applyScale)
		{
			num = (num - m_XYZ_minX) * r.Width / (m_XYZ_maxX - m_XYZ_minX);
			num = r.Left + num;
			num2 = (num2 - m_XYZ_minY) * r.Height / (m_XYZ_maxY - m_XYZ_minY);
			num2 = r.Bottom - num2;
		}
		else
		{
			m_checkBoundaries(num, num2);
		}
		return new PointF(num, num2);
	}

	private vector m_transformVector(float x, float y, float z)
	{
		if (m_XYZ_XAngle_LastValue != m_XYZ_XAngle)
		{
			m_XYZ_XAngle_LastValue = m_XYZ_XAngle;
			m_XYZ_cosXAngle = (float)Math.Cos(m_XYZ_XAngle);
			m_XYZ_sinXAngle = (float)Math.Sin(m_XYZ_XAngle);
		}
		if (m_XYZ_YAngle_LastValue != m_XYZ_YAngle)
		{
			m_XYZ_YAngle_LastValue = m_XYZ_YAngle;
			m_XYZ_cosYAngle = (float)Math.Cos(m_XYZ_YAngle);
			m_XYZ_sinYAngle = (float)Math.Sin(m_XYZ_YAngle);
		}
		if (m_XYZ_ZAngle_LastValue != m_XYZ_ZAngle)
		{
			m_XYZ_ZAngle_LastValue = m_XYZ_ZAngle;
			m_XYZ_cosZAngle = (float)Math.Cos(m_XYZ_ZAngle);
			m_XYZ_sinZAngle = (float)Math.Sin(m_XYZ_ZAngle);
		}
		float num = m_XYZ_cosYAngle * (m_XYZ_sinZAngle * y + m_XYZ_cosZAngle * x) - m_XYZ_sinYAngle * z;
		float num2 = m_XYZ_sinXAngle * (m_XYZ_cosYAngle * z + m_XYZ_sinYAngle * (m_XYZ_sinZAngle * y + m_XYZ_cosZAngle * x)) + m_XYZ_cosXAngle * (m_XYZ_cosZAngle * y - m_XYZ_sinZAngle * x);
		float z2 = m_XYZ_cosXAngle * (m_XYZ_cosYAngle * z + m_XYZ_sinYAngle * (m_XYZ_sinZAngle * y + m_XYZ_cosZAngle * x)) - m_XYZ_sinXAngle * (m_XYZ_cosZAngle * y - m_XYZ_sinZAngle * x);
		return new vector(num, num2, z2);
	}

	private void m_DrawGridXYZ_Start(Rectangle r, bool blnAcum, bool blnDraw)
	{
		StringFormat stringFormat = new StringFormat();
		Pen pen = new Pen(Color.Black);
		PointF[] array = new PointF[4];
		if (!blnDraw)
		{
			m_XYZ_applyScale = false;
			m_XYZ_minX = 99990f;
			m_XYZ_minY = 99990f;
			m_XYZ_maxX = 0f;
			m_XYZ_maxY = 0f;
			m_transformToXY(r, 0f, 0f, 0f);
			m_transformToXY(r, r.Width, 0f, 0f);
			m_transformToXY(r, r.Width, 0f, r.Width);
			m_transformToXY(r, 0f, 0f, r.Width);
			m_transformToXY(r, r.Width, r.Height, r.Width);
			m_transformToXY(r, 0f, r.Height, r.Width);
			m_transformToXY(r, r.Width, r.Height, 0f);
		}
		else
		{
			m_XYZ_applyScale = true;
		}
		ref PointF reference = ref array[0];
		reference = m_transformToXY(r, 0f, 0f, 0f);
		ref PointF reference2 = ref array[1];
		reference2 = m_transformToXY(r, r.Width, 0f, 0f);
		ref PointF reference3 = ref array[2];
		reference3 = m_transformToXY(r, r.Width, 0f, r.Width);
		ref PointF reference4 = ref array[3];
		reference4 = m_transformToXY(r, 0f, 0f, r.Width);
		if (blnDraw)
		{
			STYLEWALLBACKGROUND wallsBackStyle = m_WallsBackStyle;
			if (wallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_SOLID)
			{
				_g.FillPolygon(new SolidBrush(m_WallsBackColorPrincipal), array);
			}
			_g.DrawPolygon(pen, array);
		}
		ref PointF reference5 = ref array[0];
		reference5 = m_transformToXY(r, 0f, 0f, r.Width);
		ref PointF reference6 = ref array[1];
		reference6 = m_transformToXY(r, r.Width, 0f, r.Width);
		ref PointF reference7 = ref array[2];
		reference7 = m_transformToXY(r, r.Width, r.Height, r.Width);
		ref PointF reference8 = ref array[3];
		reference8 = m_transformToXY(r, 0f, r.Height, r.Width);
		if (blnDraw)
		{
			STYLEWALLBACKGROUND wallsBackStyle2 = m_WallsBackStyle;
			if (wallsBackStyle2 == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_SOLID)
			{
				_g.FillPolygon(new SolidBrush(m_WallsBackColorPrincipal), array);
			}
			_g.DrawPolygon(pen, array);
		}
		ref PointF reference9 = ref array[0];
		reference9 = m_transformToXY(r, r.Width, 0f, 0f);
		ref PointF reference10 = ref array[1];
		reference10 = m_transformToXY(r, r.Width, 0f, r.Width);
		ref PointF reference11 = ref array[2];
		reference11 = m_transformToXY(r, r.Width, r.Height, r.Width);
		ref PointF reference12 = ref array[3];
		reference12 = m_transformToXY(r, r.Width, r.Height, 0f);
		checked
		{
			if (blnDraw)
			{
				switch (m_WallsBackStyle)
				{
				case STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_SOLID:
					_g.FillPolygon(new SolidBrush(m_WallsBackColorPrincipal), array);
					break;
				case STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_BANDS:
				{
					PointF[] array2 = new PointF[4];
					int num = (int)(m_lngNumDividersY - 1);
					for (int i = 0; i <= num; i++)
					{
						Color color = ((unchecked(i % 2) != 0) ? m_WallsBackColorSecondary : m_WallsBackColorPrincipal);
						float num2 = (float)((double)(i * r.Height) / (double)m_lngNumDividersY);
						float num3 = (float)((double)((i + 1) * r.Height) / (double)m_lngNumDividersY);
						ref PointF reference13 = ref array2[0];
						reference13 = m_transformToXY(r, r.Width, num2, 0f);
						ref PointF reference14 = ref array2[1];
						reference14 = m_transformToXY(r, r.Width, num3, 0f);
						ref PointF reference15 = ref array2[2];
						reference15 = m_transformToXY(r, r.Width, num3, r.Width);
						ref PointF reference16 = ref array2[3];
						reference16 = m_transformToXY(r, r.Width, num2, r.Width);
						_g.FillPolygon(new SolidBrush(color), array2);
					}
					break;
				}
				}
				_g.DrawPolygon(pen, array);
			}
			pen.DashStyle = DashStyle.Dot;
			int num4 = (int)Math.Round(_g.MeasureString(m_dblSeriesMaxY.ToString(m_YAxisNumericFormat), m_YAxisValuesFont).Width + 10f);
			PointF pointF = m_transformToXY(r, 0f, 0f, r.Width);
			PointF pointF2 = m_transformToXY(r, r.Width, 0f, r.Width);
			bool flag = pointF2.X < pointF.X;
			if (Operators.CompareString(m_YAxisTitle, "", TextCompare: false) != 0)
			{
				int num5 = (int)Math.Round(_g.MeasureString(m_YAxisTitle, m_YAxisTitleFont).Height);
				int i = (int)Math.Round(_g.MeasureString(m_dblSeriesMinY.ToString(m_YAxisNumericFormat), m_YAxisValuesFont).Width + 10f);
				if (i > num4)
				{
					num4 = i;
				}
				pointF = m_transformToXY(r, 0f, 0f, r.Width);
				pointF2 = m_transformToXY(r, 0f, r.Height, r.Width);
				float num6 = pointF2.X - pointF.X;
				float num7 = pointF2.Y - pointF.Y;
				float num8 = (float)Math.Sqrt(num6 * num6 + num7 * num7);
				double num9 = Math.Atan2(num7, num6);
				if (flag)
				{
					_g.RotateTransform((float)(num9 * 180.0 / Math.PI));
					_g.TranslateTransform(pointF.X, pointF.Y, MatrixOrder.Append);
					stringFormat.Alignment = StringAlignment.Center;
					stringFormat.LineAlignment = StringAlignment.Center;
					RectangleF rf = new RectangleF(0f, num4, num8, num5);
					if (blnDraw)
					{
						_g.DrawString(m_YAxisTitle, m_YAxisTitleFont, new SolidBrush(m_YAxisColor), rf, stringFormat);
					}
					else
					{
						m_checkBoundaries(pointF2.X + (float)num5 + (float)num4, pointF.Y);
						m_checkBoundaries(pointF.X, pointF.Y - (float)num5 - (float)num4);
						m_checkBoundaries(pointF.X, pointF2.Y + (float)num5 + (float)num4);
					}
					_g.ResetTransform();
				}
				else
				{
					_g.RotateTransform((float)(num9 * 180.0 / Math.PI));
					_g.TranslateTransform(pointF.X, pointF.Y, MatrixOrder.Append);
					stringFormat.Alignment = StringAlignment.Center;
					stringFormat.LineAlignment = StringAlignment.Center;
					RectangleF rf = new RectangleF(0f, -num5 - num4, num8, num5);
					if (blnDraw)
					{
						_g.DrawString(m_YAxisTitle, m_YAxisTitleFont, new SolidBrush(m_YAxisColor), rf, stringFormat);
					}
					else
					{
						m_checkBoundaries(pointF.X - (float)num5 - (float)num4 - (float)num4, pointF.Y);
						m_checkBoundaries(pointF.X, pointF.Y - (float)num5 - (float)num4);
						m_checkBoundaries(pointF.X, pointF2.Y + (float)num5 + (float)num4);
					}
					_g.ResetTransform();
				}
			}
			int num10;
			if (m_blnYAxis)
			{
				if (flag)
				{
					stringFormat.Alignment = StringAlignment.Near;
				}
				else
				{
					stringFormat.Alignment = StringAlignment.Far;
				}
				stringFormat.LineAlignment = StringAlignment.Near;
				num10 = (int)m_lngNumDividersY;
				if (num10 == 0)
				{
					num10 = 10;
				}
				int num11 = num10;
				for (int i = 0; i <= num11; i++)
				{
					float num2 = (float)((double)(i * r.Height) / (double)num10);
					pointF = m_transformToXY(r, r.Width, num2, 0f);
					pointF2 = m_transformToXY(r, r.Width, num2, r.Width);
					if (m_blnShowDividersY)
					{
						if (blnDraw)
						{
							_g.DrawLine(m_GridLineStyle, pointF, pointF2);
						}
						pointF = m_transformToXY(r, 0f, num2, r.Width);
						if (blnDraw)
						{
							_g.DrawLine(m_GridLineStyle, pointF2, pointF);
						}
					}
					pointF = m_transformToXY(r, 0f, num2, r.Width);
					RectangleF rf;
					if (flag)
					{
						rf = new RectangleF(pointF.X + 5f, pointF.Y - 10f, num4, 50f);
						if (!blnDraw)
						{
							m_checkBoundaries(pointF.X + 5f + (float)num4, pointF.Y);
						}
					}
					else
					{
						rf = new RectangleF(pointF.X - (float)num4 - 5f, pointF.Y - 10f, num4, 50f);
						if (!blnDraw)
						{
							m_checkBoundaries(pointF.X - (float)num4 - 5f, pointF.Y);
						}
					}
					if (m_blnYAxisLabelsRotated)
					{
						_g.TranslateTransform(rf.Left, rf.Top + 35f);
						_g.RotateTransform(-45f);
						rf = new RectangleF(0f, 0f, rf.Width, rf.Height);
					}
					if (blnDraw)
					{
						if (blnAcum)
						{
							_g.DrawString(((double)i * m_dblSeriesRangeYAcum / (double)num10 + m_dblSeriesMinYAcum).ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(m_YAxisColor), rf, stringFormat);
						}
						else
						{
							_g.DrawString(((double)i * m_dblSeriesRangeY / (double)num10 + m_dblSeriesMinY).ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(m_YAxisColor), rf, stringFormat);
						}
					}
					_g.ResetTransform();
					if (m_YAxisTickLength != 0)
					{
						pointF = m_transformToXY(r, -m_YAxisTickLength, num2, r.Width);
						pointF2 = m_transformToXY(r, 0f, num2, r.Width);
						if (blnDraw)
						{
							_g.DrawLine(new Pen(Color.Black), pointF.X, pointF.Y, pointF2.X, pointF2.Y);
						}
					}
				}
			}
			if (blnDraw)
			{
				pointF = m_transformToXY(r, 0f, 0f, 0f);
				pointF2 = m_transformToXY(r, r.Width, 0f, 0f);
				_g.DrawLine(new Pen(Color.Black), pointF.X, pointF.Y, pointF2.X, pointF2.Y);
			}
			if (Operators.CompareString(m_ZAxisTitle, "", TextCompare: false) != 0)
			{
				int num12 = (int)Math.Round(_g.MeasureString(m_ZAxisTitle, m_ZAxisTitleFont).Height);
				int num13 = (int)Math.Round(_g.MeasureString(m_dblSeriesMaxZ.ToString(m_ZAxisNumericFormat), m_ZAxisValuesFont).Width + 10f);
				int i = (int)Math.Round(_g.MeasureString(m_dblSeriesMinZ.ToString(m_ZAxisNumericFormat), m_ZAxisValuesFont).Width + 10f);
				if (i > num13)
				{
					num13 = i;
				}
				pointF = m_transformToXY(r, 0f, 0f, 0f);
				pointF2 = m_transformToXY(r, r.Width, 0f, 0f);
				float num14 = pointF2.X - pointF.X;
				float num15 = pointF2.Y - pointF.Y;
				float num16 = (float)Math.Sqrt(num14 * num14 + num15 * num15);
				double num17 = Math.Atan2(num15, num14);
				_g.RotateTransform((float)(num17 * 180.0 / Math.PI));
				_g.TranslateTransform(pointF.X, pointF.Y, MatrixOrder.Append);
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Center;
				RectangleF rf = new RectangleF(0f, num13, num16, num12);
				if (blnDraw)
				{
					_g.DrawString(m_ZAxisTitle, m_ZAxisTitleFont, new SolidBrush(m_ZAxisColor), rf, stringFormat);
				}
				else
				{
					m_checkBoundaries(pointF.X, pointF.Y - (float)num12 - (float)num13);
					m_checkBoundaries(pointF2.X, pointF2.Y - (float)num12 - (float)num13);
				}
				_g.ResetTransform();
			}
			if (m_blnZAxis)
			{
				stringFormat.Alignment = StringAlignment.Near;
				num10 = ((m_ZAxisScaleMode != SCALEMODE.SCALEMODE_CUSTOM_INTERVALS) ? ((int)m_lngNumDividersZ) : (m_lngNumZ - 1));
				if (num10 == 0)
				{
					num10 = 10;
				}
				int num18 = num10;
				PointF pointF3 = default(PointF);
				for (int i = 0; i <= num18; i++)
				{
					float num19 = ((m_ZAxisScaleMode != SCALEMODE.SCALEMODE_CUSTOM_INTERVALS) ? ((float)((double)(i * r.Width) / (double)num10)) : Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(m_arrSeries[i][0], new object[1] { 2 }, null), m_dblSeriesMinZ), r.Width), m_dblSeriesRangeZ)));
					pointF = m_transformToXY(r, num19, r.Height, r.Width);
					if (m_blnShowDividersZ)
					{
						pointF2 = m_transformToXY(r, num19, 0f, r.Width);
						pointF3 = pointF2;
						if (blnDraw)
						{
							_g.DrawLine(m_GridLineStyle, pointF, pointF2);
						}
						pointF = m_transformToXY(r, num19, 0f, 0f);
						if (blnDraw)
						{
							_g.DrawLine(m_GridLineStyle, pointF2, pointF);
						}
					}
					pointF = m_transformToXY(r, num19, 0f, 0f);
					if (blnDraw)
					{
						int num20 = (int)Math.Round(_g.MeasureString(m_dblSeriesMaxZ.ToString(m_ZAxisNumericFormat), m_ZAxisValuesFont).Width);
						int num21 = (int)Math.Round(_g.MeasureString(m_dblSeriesMaxZ.ToString(m_ZAxisNumericFormat), m_ZAxisValuesFont).Height);
						float num22 = pointF3.X - pointF.X;
						float num23 = pointF3.Y - pointF.Y;
						float num24 = (float)Math.Sqrt(num22 * num22 + num23 * num23);
						double num25 = Math.Atan2(num23, num22) + Math.PI;
						RectangleF rf = new RectangleF(10f, (float)((double)(-num21) / 2.0), num20 + 20, num21);
						_g.RotateTransform((float)(num25 * 180.0 / Math.PI));
						_g.TranslateTransform(pointF.X, pointF.Y, MatrixOrder.Append);
						if (blnAcum)
						{
							_g.DrawString(((double)i * m_dblSeriesRangeZAcum / (double)num10 + m_dblSeriesMinZAcum).ToString(m_ZAxisNumericFormat), m_ZAxisValuesFont, new SolidBrush(m_ZAxisColor), rf, stringFormat);
						}
						else if (m_ZAxisScaleMode == SCALEMODE.SCALEMODE_CUSTOM_INTERVALS)
						{
							_g.DrawString(Conversion.Val(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[i][0], new object[1] { 2 }, null))).ToString(m_ZAxisNumericFormat), m_ZAxisValuesFont, new SolidBrush(m_ZAxisColor), rf, stringFormat);
						}
						else
						{
							_g.DrawString(((double)i * m_dblSeriesRangeZ / (double)num10 + m_dblSeriesMinZ).ToString(m_ZAxisNumericFormat), m_ZAxisValuesFont, new SolidBrush(m_ZAxisColor), rf, stringFormat);
						}
					}
					_g.ResetTransform();
					if (m_ZAxisTickLength != 0)
					{
						pointF = m_transformToXY(r, num19, 0f, 0f);
						pointF2 = m_transformToXY(r, num19, 0f, -m_ZAxisTickLength);
						if (blnDraw)
						{
							_g.DrawLine(new Pen(Color.Black), pointF.X, pointF.Y, pointF2.X, pointF2.Y);
						}
					}
				}
			}
			if (blnDraw)
			{
				pointF = m_transformToXY(r, 0f, 0f, 0f);
				pointF2 = m_transformToXY(r, 0f, 0f, r.Width);
				_g.DrawLine(new Pen(Color.Black), pointF.X, pointF.Y, pointF2.X, pointF2.Y);
				PointF pointF4 = pointF;
				PointF pointF3 = pointF2;
			}
			if (Operators.CompareString(m_XAxisTitle, "", TextCompare: false) != 0)
			{
				int num26 = (int)Math.Round(_g.MeasureString(m_XAxisTitle, m_XAxisTitleFont).Height);
				int num27 = (int)Math.Round(_g.MeasureString(m_dblSeriesMaxX.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width + 10f);
				int i = (int)Math.Round(_g.MeasureString(m_dblSeriesMinX.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width + 10f);
				if (i > num27)
				{
					num27 = i;
				}
				float num28 = pointF2.X - pointF.X;
				float num29 = pointF2.Y - pointF.Y;
				float num30 = (float)Math.Sqrt(num28 * num28 + num29 * num29);
				double num31 = Math.Atan2(num29, num28) + Math.PI;
				_g.RotateTransform((float)(num31 * 180.0 / Math.PI));
				_g.TranslateTransform(pointF.X, pointF.Y, MatrixOrder.Append);
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Center;
				if (num28 != 0f)
				{
					RectangleF rf = new RectangleF(0f - num30, num27, num30, num26);
					if (blnDraw)
					{
						_g.DrawString(m_XAxisTitle, m_XAxisTitleFont, new SolidBrush(m_XAxisColor), rf, stringFormat);
					}
				}
				_g.ResetTransform();
			}
			if (!m_blnXAxis)
			{
				return;
			}
			stringFormat.Alignment = StringAlignment.Near;
			num10 = ((m_XAxisScaleMode != SCALEMODE.SCALEMODE_CUSTOM_INTERVALS) ? ((int)m_lngNumDividersX) : ((int)(m_lngNumX - 1)));
			if (num10 == 0)
			{
				num10 = 10;
			}
			int num32 = num10;
			for (int i = 0; i <= num32; i++)
			{
				float num33 = ((m_XAxisScaleMode != SCALEMODE.SCALEMODE_CUSTOM_INTERVALS) ? ((float)((double)(i * r.Width) / (double)num10)) : Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(m_arrSeries[i][0], new object[1] { 0 }, null), m_dblSeriesMinX), r.Width), m_dblSeriesRangeX)));
				num33 = (float)r.Width - num33;
				pointF = m_transformToXY(r, r.Width, 0f, num33);
				PointF pointF4 = pointF;
				if (m_blnShowDividersX)
				{
					pointF2 = m_transformToXY(r, r.Width, r.Height, num33);
					if (blnDraw)
					{
						_g.DrawLine(m_GridLineStyle, pointF, pointF2);
					}
					pointF2 = m_transformToXY(r, 0f, 0f, num33);
					if (blnDraw)
					{
						_g.DrawLine(m_GridLineStyle, pointF2, pointF);
					}
				}
				int num34 = (int)Math.Round(_g.MeasureString(m_dblSeriesMaxX.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Width);
				int num35 = (int)Math.Round(_g.MeasureString(m_dblSeriesMaxX.ToString(m_XAxisNumericFormat), m_XAxisValuesFont).Height);
				pointF = m_transformToXY(r, 0f, 0f, num33);
				if (blnDraw)
				{
					float num36 = pointF4.X - pointF.X;
					float num37 = pointF4.Y - pointF.Y;
					float num38 = (float)Math.Sqrt(num36 * num36 + num37 * num37);
					double num39 = Math.Atan2(num37, num36);
					RectangleF rf = new RectangleF(-num34 - 10, (float)((double)(-num35) / 2.0), num34 + 20, num35);
					_g.RotateTransform((float)(num39 * 180.0 / Math.PI));
					_g.TranslateTransform(pointF.X, pointF.Y, MatrixOrder.Append);
					if (blnAcum)
					{
						double num40 = ((!m_XAxisReverse) ? ((double)i * m_dblSeriesRangeXAcum / (double)num10 + m_dblSeriesMinXAcum) : ((double)(num10 - i) * m_dblSeriesRangeXAcum / (double)num10 + m_dblSeriesMinXAcum));
						_g.DrawString(num40.ToString(m_XAxisNumericFormat), m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat);
					}
					else if (m_XAxisScaleMode == SCALEMODE.SCALEMODE_CUSTOM_INTERVALS)
					{
						_g.DrawString(Conversion.Val(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[0][i], new object[1] { 0 }, null))).ToString(m_XAxisNumericFormat), m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat);
					}
					else
					{
						double num40 = ((!m_XAxisReverse) ? ((double)i * m_dblSeriesRangeX / (double)num10 + m_dblSeriesMinX) : ((double)(num10 - i) * m_dblSeriesRangeX / (double)num10 + m_dblSeriesMinX));
						_g.DrawString(num40.ToString(m_XAxisNumericFormat), m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rf, stringFormat);
					}
				}
				_g.ResetTransform();
				if (m_XAxisTickLength != 0)
				{
					pointF = m_transformToXY(r, 0f, 0f, num33);
					pointF2 = m_transformToXY(r, -m_XAxisTickLength, 0f, num33);
					if (blnDraw)
					{
						_g.DrawLine(new Pen(Color.Black), pointF.X, pointF.Y, pointF2.X, pointF2.Y);
					}
				}
			}
		}
	}

	private void m_DrawGrid3d_Box(Rectangle r)
	{
		if (m_WallsStyle != 0)
		{
			gp = new GraphicsPath();
			gp.StartFigure();
			gp.AddLine(r.Left, (float)r.Top + m_sngSlantY, (float)r.Left + m_sngSlantX, r.Top);
			gp.AddLine((float)r.Left + m_sngSlantX, r.Top, r.Right, r.Top);
			gp.AddLine(r.Right, r.Top, (float)r.Right - m_sngSlantX, (float)r.Top + m_sngSlantY);
			gp.CloseFigure();
			if (m_WallsStyle == STYLEWALLS.STYLEWALLS_VISIBLE)
			{
				_g.FillPath(new SolidBrush(Color.FromArgb(64, 148, 232, 255)), gp);
			}
			_g.DrawPath(new Pen(Color.Black), gp);
			gp.Reset();
			gp.StartFigure();
			gp.AddLine((float)r.Right - m_sngSlantX, (float)r.Top + m_sngSlantY, r.Right, r.Top);
			gp.AddLine(r.Right, r.Top, r.Right, (float)r.Bottom - m_sngSlantY);
			gp.AddLine(r.Right, (float)r.Bottom - m_sngSlantY, (float)r.Right - m_sngSlantX, r.Bottom);
			gp.CloseFigure();
			if (m_WallsStyle == STYLEWALLS.STYLEWALLS_VISIBLE)
			{
				_g.FillPath(new SolidBrush(Color.FromArgb(64, 88, 152, 255)), gp);
			}
			_g.DrawPath(new Pen(Color.Black), gp);
		}
	}

	private void m_DrawCalculationAverageSplineVertical(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		int num = Information.UBound(m_arrSeries);
		checked
		{
			long num2 = (long)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			float num3;
			float num4;
			if ((m_lngStyle == STYLE2D3D.STYLE2D_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_PICTURES) | (m_lngStyle == STYLE2D3D.STYLE2D_PYRAMID) | (m_lngStyle == STYLE2D3D.STYLE2D_CYLINDER) | (m_lngStyle == STYLE2D3D.STYLE2D_ROUNDED_BAR))
			{
				num3 = (float)((double)r.Width / (double)m_lngNumX);
				num4 = (float)r.Left + num3 / 2f;
			}
			else
			{
				num3 = (float)((double)r.Width / (double)(m_lngNumX - 1));
				num4 = r.Left;
			}
			long num5 = -1L;
			int num6 = -1;
			int num7 = Information.UBound(m_arrCalculation);
			for (int i = 0; i <= num7; i++)
			{
				if (m_arrCalculation[i] > double.MinValue)
				{
					num6++;
				}
			}
			Point[] array = new Point[num6 + 1];
			int num8 = -1;
			int num9 = Information.UBound(m_arrCalculation);
			for (int i = 0; i <= num9; i++)
			{
				try
				{
					if (m_arrCalculation[i] > double.MinValue)
					{
						long num10 = (long)Math.Round((m_arrCalculation[i] - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Height - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
						num8++;
						ref Point reference = ref array[num8];
						reference = new Point((int)Math.Round(num4), (int)(num2 - num10));
					}
					num4 += num3;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					ProjectData.ClearProjectError();
				}
			}
			_g.DrawCurve(m_CalculationLineStyle, array);
		}
	}

	private void m_DrawCalculationAverageSpline2D(Rectangle r)
	{
		int num = 0;
		if (m_lngNumX == 0)
		{
			return;
		}
		checked
		{
			Point[] array = new Point[(int)(m_lngNumX - 1) + 1];
			int num2 = (int)Math.Round((double)r.Left + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width);
			int num3 = (int)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			IEnumerator enumerator = m_arrSeries[0].GetEnumerator();
			while (enumerator.MoveNext())
			{
				try
				{
					if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
					{
						return;
					}
					float num4 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), num2));
					float num5 = Conversions.ToSingle(Operators.SubtractObject(num3, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
					ref Point reference = ref array[num];
					reference = new Point((int)Math.Round(num4), (int)Math.Round(num5));
					num++;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					ProjectData.ClearProjectError();
				}
			}
			_g.DrawCurve(m_CalculationLineStyle, array);
		}
	}

	private void m_DrawCalculationAverage2D(Rectangle r)
	{
		int num = 0;
		if (m_lngNumX != 0)
		{
			double num2 = (double)r.Left + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width;
			double num3 = (double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height;
			ArrayList[] series = Series;
			foreach (ArrayList arrayList in series)
			{
				Trendline trendline = Statistics.CalculateLinearRegression2D(arrayList);
				double num4 = (trendline.x1 - m_dblSeriesMinX) / m_dblSeriesRangeX * (double)r.Width - m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width + num2;
				double num5 = num3 - ((trendline.y1 - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Height - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
				double num6 = (trendline.x2 - m_dblSeriesMinX) / m_dblSeriesRangeX * (double)r.Width - m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width + num2;
				double num7 = num3 - ((trendline.y2 - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Height - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
				_g.DrawLine(CalculationLineStyle, (float)num4, (float)num5, (float)num6, (float)num7);
				num = checked(num + 1);
			}
		}
	}

	private void m_DrawCalculationAverageSplineScatterDateTime(Rectangle r)
	{
		int num = 0;
		if (m_lngNumX == 0)
		{
			return;
		}
		checked
		{
			Point[] array = new Point[(int)(m_lngNumX - 1) + 1];
			long num2 = m_XAxisMaxDateTime.Ticks - m_XAxisMinDateTime.Ticks;
			if (m_lngNumX == 0)
			{
				return;
			}
			int num3 = Information.UBound(m_arrSeries);
			int num4 = (int)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			IEnumerator enumerator = m_arrSeries[0].GetEnumerator();
			while (enumerator.MoveNext())
			{
				try
				{
					if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
					{
						return;
					}
					float num5 = Conversions.ToSingle(Operators.AddObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), null, "Ticks", new object[0], null, null, null), m_XAxisMinDateTime.Ticks), num2), r.Width), r.Left));
					float num6 = Conversions.ToSingle(Operators.SubtractObject(num4, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
					ref Point reference = ref array[num];
					reference = new Point((int)Math.Round(num5), (int)Math.Round(num6));
					num++;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					ProjectData.ClearProjectError();
				}
			}
			GraphicsPath graphicsPath = new GraphicsPath();
			_g.DrawCurve(m_CalculationLineStyle, array);
		}
	}

	private void m_DrawCalculationAverageScatterDateTime(Rectangle r)
	{
		int num = 0;
		if (m_lngNumX == 0)
		{
			return;
		}
		checked
		{
			Point[] array = new Point[(int)(m_lngNumX - 1) + 1];
			long num2 = m_XAxisMaxDateTime.Ticks - m_XAxisMinDateTime.Ticks;
			if (m_lngNumX == 0)
			{
				return;
			}
			int num3 = Information.UBound(m_arrSeries);
			int num4 = (int)Math.Round((double)r.Bottom - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
			IEnumerator enumerator = m_arrSeries[0].GetEnumerator();
			while (enumerator.MoveNext())
			{
				try
				{
					if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
					{
						return;
					}
					float num5 = Conversions.ToSingle(Operators.AddObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), null, "Ticks", new object[0], null, null, null), m_XAxisMinDateTime.Ticks), num2), r.Width), r.Left));
					float num6 = Conversions.ToSingle(Operators.SubtractObject(num4, Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height)));
					ref Point reference = ref array[num];
					reference = new Point((int)Math.Round(num5), (int)Math.Round(num6));
					num++;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					ProjectData.ClearProjectError();
				}
			}
			GraphicsPath graphicsPath = new GraphicsPath();
			graphicsPath.AddLines(array);
			_g.DrawPath(m_CalculationLineStyle, graphicsPath);
		}
	}

	internal void m_RefreshGraphXYZ(ref Rectangle r)
	{
		m_vcc = new ValueCaptionRenderer(_g, blnHorizontalChart: false, m_dblShowValuesMin, m_dblShowValuesMax);
		m_rectChart = r;
		if (m_arrSeries != null)
		{
			if (m_GridBackgroundImage != null)
			{
				if (m_GridBackgroundImageTransparency > 0)
				{
					float[][] newColorMatrix = new float[5][]
					{
						new float[5] { 1f, 0f, 0f, 0f, 0f },
						new float[5] { 0f, 1f, 0f, 0f, 0f },
						new float[5] { 0f, 0f, 1f, 0f, 0f },
						new float[5]
						{
							0f,
							0f,
							0f,
							(float)((double)m_GridBackgroundImageTransparency / 100.0),
							0f
						},
						new float[5] { 0f, 0f, 0f, 0f, 1f }
					};
					ColorMatrix newColorMatrix2 = new ColorMatrix(newColorMatrix);
					ImageAttributes imageAttributes = new ImageAttributes();
					imageAttributes.SetColorMatrix(newColorMatrix2, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
					_g.g.DrawImage(m_GridBackgroundImage, r, 0, 0, m_GridBackgroundImage.Width, m_GridBackgroundImage.Height, GraphicsUnit.Pixel, imageAttributes);
				}
				else
				{
					_g.g.DrawImage(m_GridBackgroundImage, r);
				}
			}
			switch (m_lngStyle)
			{
			case STYLE2D3D.STYLE3D_XYZ_SCATTER:
				m_DrawXYZScatter(r);
				break;
			case STYLE2D3D.STYLE3D_XYZ_LINE:
				m_DrawXYZLines(r);
				break;
			case STYLE2D3D.STYLE3D_XYZ_MESH:
				m_DrawXYZMesh(r);
				break;
			case STYLE2D3D.STYLE3D_XYZ_SURFACE:
				m_DrawXYZSurfaceQuads(r);
				break;
			case STYLE2D3D.STYLE3D_XYZ_SURFACE_TRIANGLE:
				m_DrawXYZSurfaceTriangle(r);
				break;
			}
		}
		if (m_blnShowValues)
		{
			STYLECAPTIONLOCATION valuesLocationStyle = m_ValuesLocationStyle;
			ValueCaptionRenderer vcc = m_vcc;
			bool blnShowDisplacementLine = (m_lngStyle != STYLE2D3D.STYLE2D_LINE) & (m_lngStyle != STYLE2D3D.STYLE2D_POINT) & (m_lngStyle != STYLE2D3D.STYLE2D_SPLINE) & (m_lngStyle != STYLE2D3D.STYLE3D_LINE) & (m_lngStyle != STYLE2D3D.STYLE3D_SPLINE) & (m_lngStyle != STYLE2D3D.STYLE3D_SPLINE_AREA) & (m_lngStyle != STYLE2D3D.STYLE3D_SPLINE_STACKED_AREA);
			Rectangle rectChart = r;
			ArrayList itemsSelected = m_ItemsSelected;
			Super2d3dGraph chart = this;
			vcc.Render(blnShowDisplacementLine, rectChart, itemsSelected, ref chart);
		}
		m_vcc.HighlightSelection(this);
	}

	private void m_DrawXYZScatter(Rectangle r)
	{
		if (m_lngNumX != 0)
		{
			m_DrawOrNotXYZScatter(r, blnDraw: false);
			m_DrawOrNotXYZScatter(r, blnDraw: true);
		}
	}

	private void m_DrawXYZMesh(Rectangle r)
	{
		if (m_lngNumX != 0)
		{
			m_DrawOrNotXYZMesh(r, blnDraw: false);
			m_DrawOrNotXYZMesh(r, blnDraw: true);
		}
	}

	private void m_DrawXYZLines(Rectangle r)
	{
		if (m_lngNumX != 0)
		{
			m_DrawOrNotXYZLines(r, blnDraw: false);
			m_DrawOrNotXYZLines(r, blnDraw: true);
		}
	}

	private void m_DrawOrNotXYZScatter(Rectangle r, bool blnDraw)
	{
		m_DrawGridXYZ_Start(r, blnAcum: false, blnDraw);
		int num = Information.UBound(m_arrSeries);
		int num2 = num;
		checked
		{
			for (int i = 0; i <= num2; i++)
			{
				int num3 = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						float num4 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width));
						float num5 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						float num6 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinZ), m_dblSeriesRangeZ), r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width));
						if (!m_XAxisReverse)
						{
							num4 = (float)r.Width - num4;
						}
						PointF p = m_transformToXY(r, num6, num5, num4);
						if (blnDraw)
						{
							m_DrawPoint(p, i);
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaptionRenderer vcc = m_vcc;
								int seriesIndex = i;
								int itemIndex = num3;
								float sngPosX = p.X;
								float sngPosY = p.Y - 15f;
								string value = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)).ToString(m_strValuesFormat);
								float sngHotSpotX = p.X;
								float sngHotSpotY = p.Y;
								float sngXDisplacementDirection = 0f;
								float sngYDisplacementDirection = 0f;
								vcc.AddCaption(new ValueCaption(seriesIndex, itemIndex, sngPosX, sngPosY, value, 0.0, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref sngYDisplacementDirection));
							}
						}
						num3++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			m_DrawGridXYZ_Box(r, blnDraw);
		}
	}

	private void m_DrawOrNotXYZLines(Rectangle r, bool blnDraw)
	{
		m_DrawGridXYZ_Start(r, blnAcum: false, blnDraw);
		int num = Information.UBound(m_arrSeries);
		int num2 = num;
		checked
		{
			PointF pointF2 = default(PointF);
			for (int i = 0; i <= num2; i++)
			{
				int num3 = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						float num4 = (float)((Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)) - m_dblSeriesMinX) / m_dblSeriesRangeX * (double)r.Width - m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width);
						float num5 = (float)((Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)) - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Height - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height + m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
						float num6 = (float)((Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)) - m_dblSeriesMinZ) / m_dblSeriesRangeZ * (double)r.Width - m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width + m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width);
						if (!m_XAxisReverse)
						{
							num4 = (float)r.Width - num4;
						}
						PointF pointF = m_transformToXY(r, num6, num5, num4);
						if (blnDraw)
						{
							if (num3 > 0)
							{
								_g.DrawLine(SeriesLineStyle[i], pointF2.X, pointF2.Y, pointF.X, pointF.Y);
							}
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaptionRenderer vcc = m_vcc;
								int seriesIndex = i;
								int itemIndex = num3;
								float sngPosX = pointF.X;
								float sngPosY = pointF.Y - 15f;
								string value = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)).ToString(m_strValuesFormat);
								float sngHotSpotX = pointF.X;
								float sngHotSpotY = pointF.Y;
								float sngXDisplacementDirection = 0f;
								float sngYDisplacementDirection = 0f;
								vcc.AddCaption(new ValueCaption(seriesIndex, itemIndex, sngPosX, sngPosY, value, 0.0, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref sngYDisplacementDirection));
							}
							pointF2 = pointF;
						}
						num3++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			m_DrawGridXYZ_Box(r, blnDraw);
		}
	}

	private void m_DrawOrNotXYZMesh(Rectangle r, bool blnDraw)
	{
		m_DrawGridXYZ_Start(r, blnAcum: false, blnDraw);
		int num = Information.UBound(m_arrSeries);
		checked
		{
			int num2 = num - 1;
			PointF pointF3 = default(PointF);
			PointF pointF4 = default(PointF);
			for (int i = 0; i <= num2; i++)
			{
				int num3 = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				IEnumerator enumerator2 = m_arrSeries[i + 1].GetEnumerator();
				while (enumerator.MoveNext() & enumerator2.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						float num4 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width));
						float num5 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						float num6 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinZ), m_dblSeriesRangeZ), r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width));
						if (!m_XAxisReverse)
						{
							num4 = (float)r.Width - num4;
						}
						PointF pointF = m_transformToXY(r, num6, num5, num4);
						float num7 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator2.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width));
						float num8 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator2.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
						float num9 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator2.Current, new object[1] { 2 }, null), m_dblSeriesMinZ), m_dblSeriesRangeZ), r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width));
						if (!m_XAxisReverse)
						{
							num7 = (float)r.Width - num7;
						}
						PointF pointF2 = m_transformToXY(r, num9, num8, num7);
						if (blnDraw)
						{
							if (num3 > 0)
							{
								if (num3 == 1)
								{
									_g.DrawLine(SeriesLineStyle[i], pointF3.X, pointF3.Y, pointF4.X, pointF4.Y);
								}
								_g.DrawLine(SeriesLineStyle[i], pointF4.X, pointF4.Y, pointF2.X, pointF2.Y);
								_g.DrawLine(SeriesLineStyle[i], pointF2.X, pointF2.Y, pointF.X, pointF.Y);
								if (i == 0)
								{
									_g.DrawLine(SeriesLineStyle[i], pointF.X, pointF.Y, pointF3.X, pointF3.Y);
								}
							}
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaptionRenderer vcc = m_vcc;
								int seriesIndex = i;
								int itemIndex = num3;
								float sngPosX = pointF.X;
								float sngPosY = pointF.Y - 15f;
								string value = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)).ToString(m_strValuesFormat);
								float sngHotSpotX = pointF.X;
								float sngHotSpotY = pointF.Y;
								float sngXDisplacementDirection = 0f;
								float sngYDisplacementDirection = 0f;
								vcc.AddCaption(new ValueCaption(seriesIndex, itemIndex, sngPosX, sngPosY, value, 0.0, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref sngYDisplacementDirection));
								if (i == num - 1)
								{
									ValueCaptionRenderer vcc2 = m_vcc;
									int seriesIndex2 = i + 1;
									int itemIndex2 = num3;
									float sngPosX2 = pointF2.X;
									float sngPosY2 = pointF2.Y - 15f;
									string value2 = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)).ToString(m_strValuesFormat);
									float sngHotSpotX2 = pointF2.X;
									float sngHotSpotY2 = pointF2.Y;
									sngYDisplacementDirection = 0f;
									sngXDisplacementDirection = 0f;
									vcc2.AddCaption(new ValueCaption(seriesIndex2, itemIndex2, sngPosX2, sngPosY2, value2, 0.0, sngHotSpotX2, sngHotSpotY2, ref sngYDisplacementDirection, ref sngXDisplacementDirection));
								}
							}
							pointF3 = pointF;
							pointF4 = pointF2;
						}
						num3++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
				}
			}
			m_DrawGridXYZ_Box(r, blnDraw);
		}
	}

	private void m_DrawXYZSurfaceQuads(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		m_DrawGridXYZ_Start(r, blnAcum: false, blnDraw: false);
		m_DrawGridXYZ_Start(r, blnAcum: false, blnDraw: true);
		int num = Information.UBound(m_arrSeries);
		PointF pointF = default(PointF);
		PointF p = default(PointF);
		PointF pointF2 = default(PointF);
		PointF p2 = default(PointF);
		vector vector2 = null;
		vector vector3 = null;
		vector vector4 = null;
		vector vector5 = null;
		HsbColorUtil hsbColorUtil = null;
		HsbColorUtil hsbColorUtil2 = null;
		Color color2 = default(Color);
		Color color = default(Color);
		int a = default(int);
		switch (m_SurfaceGradientType)
		{
		case SURFACE_GRADIENT_TYPE.ONE_COLOR:
			if (m_SurfaceBrushStyle is SolidBrush)
			{
				SolidBrush solidBrush = (SolidBrush)m_SurfaceBrushStyle;
				color2 = ControlPaint.Light(solidBrush.Color);
				color = ControlPaint.Dark(solidBrush.Color);
				a = solidBrush.Color.A;
			}
			break;
		case SURFACE_GRADIENT_TYPE.TWO_COLORS_LINEAR_GRADIENT:
			if (m_SurfaceBrushStyle is LinearGradientBrush)
			{
				LinearGradientBrush linearGradientBrush = (LinearGradientBrush)m_SurfaceBrushStyle;
				color = linearGradientBrush.LinearColors[0];
				color2 = linearGradientBrush.LinearColors[1];
				a = color.A;
			}
			break;
		case SURFACE_GRADIENT_TYPE.TWO_COLORS_HUE_GRADIENT:
			hsbColorUtil = m_SurfaceGradientHueStart;
			hsbColorUtil2 = m_SurfaceGradientHueEnd;
			break;
		}
		int num2 = -1;
		checked
		{
			int num3 = (int)((num + 1) * m_lngNumX - 1);
			quad[] array = new quad[num3 + 1];
			int num4 = num - 1;
			float num6 = default(float);
			Color color3 = default(Color);
			for (int i = 0; i <= num4; i++)
			{
				int num5 = 0;
				IEnumerator enumerator = m_arrSeries[i].GetEnumerator();
				IEnumerator enumerator2 = m_arrSeries[i + 1].GetEnumerator();
				float num7 = unchecked(0 - ((num6 == float.MinValue) ? 1 : 0));
				while (enumerator.MoveNext() & enumerator2.MoveNext())
				{
					try
					{
						if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
						{
							return;
						}
						float num8 = Conversions.ToSingle(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null));
						float num9 = Conversions.ToSingle(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null));
						float num10 = Conversions.ToSingle(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null));
						float num11 = Conversions.ToSingle(NewLateBinding.LateIndexGet(enumerator2.Current, new object[1] { 0 }, null));
						float num12 = Conversions.ToSingle(NewLateBinding.LateIndexGet(enumerator2.Current, new object[1] { 1 }, null));
						float num13 = Conversions.ToSingle(NewLateBinding.LateIndexGet(enumerator2.Current, new object[1] { 2 }, null));
						float num14 = (float)(((double)num8 - m_dblSeriesMinX) / m_dblSeriesRangeX * (double)r.Width - m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width);
						float num15 = (float)(((double)num9 - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Height - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height + m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
						float num16 = (float)(((double)num10 - m_dblSeriesMinZ) / m_dblSeriesRangeZ * (double)r.Width - m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width + m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width);
						if (!m_XAxisReverse)
						{
							num14 = (float)r.Width - num14;
						}
						pointF = m_transformToXY(r, num16, num15, num14);
						vector2 = m_transformVector(num16, num15, num14);
						float num17 = (float)(((double)num11 - m_dblSeriesMinX) / m_dblSeriesRangeX * (double)r.Width - m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width + m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width);
						float num18 = (float)(((double)num12 - m_dblSeriesMinY) / m_dblSeriesRangeY * (double)r.Height - m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height + m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height);
						float num19 = (float)(((double)num13 - m_dblSeriesMinZ) / m_dblSeriesRangeZ * (double)r.Width - m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width + m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width);
						if (!m_XAxisReverse)
						{
							num17 = (float)r.Width - num17;
						}
						pointF2 = m_transformToXY(r, num19, num18, num17);
						vector4 = m_transformVector(num19, num18, num17);
						float num20 = (float)(((double)num9 - m_dblSeriesMinY) / m_dblSeriesRangeY);
						float num21 = (float)(((double)num12 - m_dblSeriesMinY) / m_dblSeriesRangeY);
						float num22 = ((num7 == float.MinValue) ? ((num20 + num21) / 2f) : ((num20 + num21 + num7 + num6) / 4f));
						num7 = num20;
						num6 = num21;
						if (num5 > 0)
						{
							if (!m_SurfaceWireOnly)
							{
								if (m_SurfaceGradientType == SURFACE_GRADIENT_TYPE.TWO_COLORS_HUE_GRADIENT)
								{
									double num23 = (double)num22 * (hsbColorUtil2.Hue - hsbColorUtil.Hue) + hsbColorUtil.Hue;
									double luminance = (double)num22 * (hsbColorUtil2.Luminance - hsbColorUtil.Luminance) + hsbColorUtil.Luminance;
									double saturation = (double)num22 * (hsbColorUtil2.Saturation - hsbColorUtil2.Saturation) + hsbColorUtil.Saturation;
									if (num23 < 0.0)
									{
										num23 = 0.0;
									}
									else if (num23 > 360.0)
									{
										num23 = 360.0;
									}
									color3 = new HsbColorUtil(num23, luminance, saturation).Color;
								}
								else
								{
									if (num22 < (float)m_SurfaceBrushMinBrightness)
									{
										num22 = m_SurfaceBrushMinBrightness;
									}
									else if (num22 > (float)m_SurfaceBrushMaxBrightness)
									{
										num22 = m_SurfaceBrushMaxBrightness;
									}
									int val = (int)Math.Round(num22 * (float)(color2.R - color.R) + (float)unchecked((int)color.R));
									int val2 = (int)Math.Round(num22 * (float)(color2.G - color.G) + (float)unchecked((int)color.G));
									int val3 = (int)Math.Round(num22 * (float)(color2.B - color.B) + (float)unchecked((int)color.B));
									color3 = Color.FromArgb(a, Math.Min(val, 255), Math.Min(val2, 255), Math.Min(val3, 255));
								}
							}
							vector vector6 = vector5 - vector4;
							vector vector7 = vector2 - vector4;
							vector vector8 = vector6 * vector7;
							if ((vector8.z < 0f) | !m_SurfaceWireOnly)
							{
								num2++;
								array[num2] = default(quad);
								quad[] array2 = array;
								int num24 = num2;
								array2[num24].p0 = p2;
								array2[num24].p1 = pointF2;
								array2[num24].p2 = pointF;
								array2[num24].p3 = p;
								array2[num24].z = (vector3.z + vector2.z + vector5.z + vector4.z) / 4f;
								array2[num24].color = color3;
								ref quad reference = ref array2[num24];
								int seriesIndex = i;
								int itemIndex = num5;
								float sngPosX = pointF.X;
								float sngPosY = pointF.Y - 15f;
								string value = num8.ToString(m_strValuesFormat) + ":" + num9.ToString(m_strValuesFormat) + ":" + num10.ToString(m_strValuesFormat);
								float sngHotSpotX = pointF.X;
								float sngHotSpotY = pointF.Y;
								float sngXDisplacementDirection = 0f;
								float sngYDisplacementDirection = 0f;
								reference.vc = new ValueCaption(seriesIndex, itemIndex, sngPosX, sngPosY, value, 0.0, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref sngYDisplacementDirection);
							}
							if (i == num - 1)
							{
								int seriesIndex2 = i + 1;
								int itemIndex2 = num5;
								float sngPosX2 = pointF2.X;
								float sngPosY2 = pointF2.Y - 15f;
								string value2 = num11.ToString(m_strValuesFormat) + ":" + num12.ToString(m_strValuesFormat) + ":" + num13.ToString(m_strValuesFormat);
								float sngHotSpotX2 = pointF2.X;
								float sngHotSpotY2 = pointF2.Y;
								float sngYDisplacementDirection = 0f;
								float sngXDisplacementDirection = 0f;
								ValueCaption vc = new ValueCaption(seriesIndex2, itemIndex2, sngPosX2, sngPosY2, value2, 0.0, sngHotSpotX2, sngHotSpotY2, ref sngYDisplacementDirection, ref sngXDisplacementDirection);
								m_vcc.AddCaption(vc);
							}
						}
						else
						{
							int seriesIndex3 = i;
							int itemIndex3 = num5;
							float sngPosX3 = pointF.X;
							float sngPosY3 = pointF.Y - 15f;
							string value3 = num8.ToString(m_strValuesFormat) + ":" + num9.ToString(m_strValuesFormat) + ":" + num10.ToString(m_strValuesFormat);
							float sngHotSpotX3 = pointF.X;
							float sngHotSpotY3 = pointF.Y;
							float sngYDisplacementDirection = 0f;
							float sngXDisplacementDirection = 0f;
							ValueCaption vc2 = new ValueCaption(seriesIndex3, itemIndex3, sngPosX3, sngPosY3, value3, 0.0, sngHotSpotX3, sngHotSpotY3, ref sngYDisplacementDirection, ref sngXDisplacementDirection);
							m_vcc.AddCaption(vc2);
							if (i == num - 1)
							{
								int seriesIndex4 = i + 1;
								int itemIndex4 = num5;
								float sngPosX4 = pointF2.X;
								float sngPosY4 = pointF2.Y - 15f;
								string value4 = num11.ToString(m_strValuesFormat) + ":" + num12.ToString(m_strValuesFormat) + ":" + num13.ToString(m_strValuesFormat);
								float sngHotSpotX4 = pointF2.X;
								float sngHotSpotY4 = pointF2.Y;
								sngYDisplacementDirection = 0f;
								sngXDisplacementDirection = 0f;
								vc2 = new ValueCaption(seriesIndex4, itemIndex4, sngPosX4, sngPosY4, value4, 0.0, sngHotSpotX4, sngHotSpotY4, ref sngYDisplacementDirection, ref sngXDisplacementDirection);
								m_vcc.AddCaption(vc2);
							}
						}
						p = pointF;
						p2 = pointF2;
						vector3 = vector2;
						vector5 = vector4;
						num5++;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						MessageBox.Show(ex2.ToString());
						ProjectData.ClearProjectError();
					}
				}
			}
			SurfaceQuadComparerClass comparer = new SurfaceQuadComparerClass();
			Array.Sort(array, 0, num2 + 1, comparer);
			int num25 = num2;
			for (int j = 0; j <= num25; j++)
			{
				quad[] array3 = array;
				int num26 = j;
				if (array3[num26].vc != null)
				{
					if (!m_SurfaceWireOnly)
					{
						_g.FillPolygon(new SolidBrush(array3[num26].color), new PointF[4]
						{
							array3[num26].p0,
							array3[num26].p1,
							array3[num26].p2,
							array3[num26].p3
						});
					}
					if (SeriesLineStyle[0].Color != Color.Transparent)
					{
						_g.DrawPolygon(SeriesLineStyle[0], new PointF[4]
						{
							array3[num26].p0,
							array3[num26].p1,
							array3[num26].p2,
							array3[num26].p3
						});
					}
					if (m_blnShowValues | m_blnHotSpots)
					{
						m_vcc.AddCaption(array3[num26].vc);
					}
				}
			}
			m_DrawGridXYZ_Box(r, blnDraw: true);
		}
	}

	private void m_DrawXYZSurfaceTriangle(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		m_DrawGridXYZ_Start(r, blnAcum: false, blnDraw: false);
		m_DrawGridXYZ_Start(r, blnAcum: false, blnDraw: true);
		PointF pointF = default(PointF);
		PointF pointF2 = default(PointF);
		PointF pointF3 = default(PointF);
		vector vector2 = null;
		vector vector3 = null;
		vector vector4 = null;
		vector vector5 = null;
		SolidBrush solidBrush = (SolidBrush)m_SurfaceBrushStyle;
		Color color = solidBrush.Color;
		int num = 0;
		int count = m_arrSeries[0].Count;
		checked
		{
			tri[] array = new tri[count + 1];
			int num2 = 0;
			IEnumerator enumerator = m_arrSeries[0].GetEnumerator();
			while (enumerator.MoveNext())
			{
				try
				{
					if (!Information.IsArray(RuntimeHelpers.GetObjectValue(enumerator.Current)))
					{
						return;
					}
					float num3 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width));
					float num4 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
					float num5 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinZ), m_dblSeriesRangeZ), r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width));
					if (!m_XAxisReverse)
					{
						num3 = (float)r.Width - num3;
					}
					pointF = m_transformToXY(r, num5, num4, num3);
					vector2 = m_transformVector(num5, num4, num3);
					if (!enumerator.MoveNext())
					{
						break;
					}
					num3 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width));
					num4 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
					num5 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinZ), m_dblSeriesRangeZ), r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width));
					if (!m_XAxisReverse)
					{
						num3 = (float)r.Width - num3;
					}
					pointF2 = m_transformToXY(r, num5, num4, num3);
					vector3 = m_transformVector(num5, num4, num3);
					if (!enumerator.MoveNext())
					{
						break;
					}
					num3 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null), m_dblSeriesMinX), m_dblSeriesRangeX), r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width), m_dblSeriesMiddleX / m_dblSeriesRangeX * (double)r.Width));
					num4 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), m_dblSeriesRangeY), r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Height));
					num5 = Conversions.ToSingle(Operators.AddObject(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null), m_dblSeriesMinZ), m_dblSeriesRangeZ), r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width), m_dblSeriesMiddleZ / m_dblSeriesRangeZ * (double)r.Width));
					if (!m_XAxisReverse)
					{
						num3 = (float)r.Width - num3;
					}
					pointF3 = m_transformToXY(r, num5, num4, num3);
					vector4 = m_transformVector(num5, num4, num3);
					float num6 = Conversions.ToSingle(Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null), m_dblSeriesMinY), 100), m_dblSeriesRangeY));
					if (num6 < (float)m_SurfaceBrushMinBrightness)
					{
						num6 = m_SurfaceBrushMinBrightness;
					}
					else if (num6 > (float)m_SurfaceBrushMaxBrightness)
					{
						num6 = m_SurfaceBrushMaxBrightness;
					}
					int red = (int)Math.Round((float)unchecked((int)color.R) * num6 / 100f);
					int green = (int)Math.Round((float)unchecked((int)color.G) * num6 / 100f);
					int blue = (int)Math.Round((float)unchecked((int)color.B) * num6 / 100f);
					Color color2 = Color.FromArgb(color.A, red, green, blue);
					vector vector6 = vector4 - vector2;
					vector vector7 = vector3 - vector2;
					vector vector8 = vector6 * vector7;
					if (vector8.z < 0f)
					{
						num++;
						array[num] = default(tri);
						tri[] array2 = array;
						int num7 = num;
						array2[num7].p0 = pointF;
						array2[num7].p1 = pointF2;
						array2[num7].p2 = pointF3;
						array2[num7].z = (vector2.z + vector3.z + vector4.z) / 3f;
						array2[num7].color = color2;
						ref tri reference = ref array2[num7];
						int itemIndex = num2;
						float sngPosX = pointF.X;
						float sngPosY = pointF.Y - 15f;
						string value = Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 0 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 1 }, null)).ToString(m_strValuesFormat) + ":" + Conversions.ToDouble(NewLateBinding.LateIndexGet(enumerator.Current, new object[1] { 2 }, null)).ToString(m_strValuesFormat);
						float sngHotSpotX = pointF.X;
						float sngHotSpotY = pointF.Y;
						float sngXDisplacementDirection = 0f;
						float sngYDisplacementDirection = 0f;
						reference.vc = new ValueCaption(0, itemIndex, sngPosX, sngPosY, value, 0.0, sngHotSpotX, sngHotSpotY, ref sngXDisplacementDirection, ref sngYDisplacementDirection);
					}
					num2++;
					continue;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					MessageBox.Show(ex2.ToString());
					ProjectData.ClearProjectError();
					continue;
				}
			}
			int num8 = num - 1;
			for (int i = 1; i <= num8; i++)
			{
				int num9 = i + 1;
				int num10 = num;
				for (int j = num9; j <= num10; j++)
				{
					if (array[i].z < array[j].z)
					{
						tri tri2 = array[i];
						ref tri reference2 = ref array[i];
						reference2 = array[j];
						array[j] = tri2;
					}
				}
			}
			int num11 = num;
			for (int k = 1; k <= num11; k++)
			{
				tri[] array3 = array;
				int num12 = k;
				if (!m_SurfaceWireOnly)
				{
					_g.FillPolygon(new SolidBrush(array3[num12].color), new PointF[3]
					{
						array3[num12].p0,
						array3[num12].p1,
						array3[num12].p2
					});
				}
				_g.DrawPolygon(m_arrSeriesLineStyle[0], new PointF[3]
				{
					array3[num12].p0,
					array3[num12].p1,
					array3[num12].p2
				});
				if (m_blnShowValues | m_blnHotSpots)
				{
					m_vcc.AddCaption(array3[num12].vc);
				}
			}
			m_DrawGridXYZ_Box(r, blnDraw: true);
		}
	}

	private void m_DrawDataTable(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		checked
		{
			if (m_DataTableStartIndex > 0)
			{
				m_DataTableStartIndex_CurrentValue = Math.Min(m_DataTableStartIndex - 1, m_arrSeries[0].Count - 1);
			}
			else
			{
				m_DataTableStartIndex_CurrentValue = 0;
			}
			if (m_DataTableLastIndex > 0)
			{
				m_DataTableLastIndex_CurrentValue = Math.Min(m_arrSeries[0].Count - 1, m_DataTableLastIndex - 1);
				m_DataTableLastIndex_CurrentValue = Math.Max(m_DataTableLastIndex_CurrentValue, m_DataTableStartIndex_CurrentValue);
			}
			else
			{
				m_DataTableLastIndex_CurrentValue = m_arrSeries[0].Count - 1;
			}
			int num = m_DataTableLastIndex_CurrentValue - m_DataTableStartIndex_CurrentValue + 1;
			long num2 = m_intDataTableItemsMaxWidth();
			long num3 = m_intDatatableLegendMaxWidth();
			bool flag = (m_arrItemsLegend.Length > 0) & (m_blnItemsLegend | m_blnIsPie());
			long num4 = r.Top;
			StringFormat stringFormat = new StringFormat();
			if (Operators.CompareString(Strings.Trim(m_strDataTableCaption), "", TextCompare: false) != 0)
			{
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Center;
				RectangleF rectangleF = new RectangleF(r.Left, r.Top + 5, r.Width, r.Height);
				Font font = new Font(m_DataTableFont, FontStyle.Bold);
				SizeF sizeF = _g.MeasureString(m_strDataTableCaption, font);
				sizeF.Width += 10f;
				sizeF.Height += 6f;
				CustomGraphics g = _g;
				RectangleF rf = new RectangleF(rectangleF.Left + rectangleF.Width / 2f - sizeF.Width / 2f, rectangleF.Top - 3f, sizeF.Width, sizeF.Height);
				RoundedRectangle roundedRectangle = new RoundedRectangle(g, rf, 0.5f);
				roundedRectangle.Render(Color.Black, m_DataTableBackColor);
				_g.DrawString(m_strDataTableCaption, font, new SolidBrush(m_DataTableColor), roundedRectangle.RECT, stringFormat);
				num4 += 30;
			}
			else
			{
				num4 += 10;
			}
			StringFormat stringFormat2 = new StringFormat();
			stringFormat2.Alignment = m_ValuesAlignment;
			stringFormat2.LineAlignment = StringAlignment.Center;
			stringFormat.Alignment = StringAlignment.Near;
			stringFormat.LineAlignment = StringAlignment.Center;
			float num5 = num2 + 10;
			int num6 = m_intNumSeries();
			if (Operators.CompareString(m_DataTableAdditionalRowTitle, "", TextCompare: false) != 0)
			{
				num6++;
			}
			long num7 = ((!flag) ? ((long)Math.Round((double)(r.Height - (num4 - r.Top)) / (double)num6)) : ((long)Math.Round((double)(r.Height - (num4 - r.Top)) / (double)(num6 + 1))));
			if (m_blnIsPie())
			{
				num5 += (float)(num7 - 10);
			}
			float num8 = num5 * (float)num;
			if (m_blnShowLegendInDatatable)
			{
				num8 += (float)(15 + num3 + num7);
			}
			float num9 = (float)((double)r.Left + (double)r.Width / 2.0 - (double)(num8 / 2f));
			if (num9 < (float)m_intMarginLeft)
			{
				num9 = m_intMarginLeft;
			}
			float num10 = num9;
			Rectangle r2 = Rectangle.FromLTRB((int)Math.Round(num10 + 3f), (int)(num4 + 3), (int)Math.Round(num10 + num8 + 3f), r.Bottom + 3);
			_g.FillRectangle(new SolidBrush(Color.FromArgb(100, Color.Brown)), r2);
			Rectangle r3 = Rectangle.FromLTRB((int)Math.Round(num10), (int)num4, (int)Math.Round(num10 + num8), r.Bottom);
			_g.FillRectangle(new SolidBrush(m_DataTableBackColor), r3);
			num9 = num10;
			if (m_blnShowDividersX)
			{
				if (m_blnShowLegendInDatatable)
				{
					num9 += (float)(15 + num3 + num7);
				}
				Pen pen = new Pen(Color.Black);
				long num11 = 1L;
				long num12 = num;
				for (long num13 = num11; num13 <= num12; num13++)
				{
					_g.DrawLine(pen, num9, num4, num9, r.Bottom);
					num9 += num5;
				}
			}
			Rectangle r4;
			if (flag)
			{
				num9 = num10;
				if (m_blnShowLegendInDatatable)
				{
					num9 += (float)(15 + num3 + num7);
				}
				r4 = new Rectangle((int)Math.Round(num10), (int)num4, (int)Math.Round(num8), (int)num7);
				_g.DrawRectangle(new Pen(Color.Black), r4);
				long num14 = 0L;
				long num15 = Math.Min(Information.UBound(m_arrItemsLegend), num - 1);
				for (long num13 = num14; num13 <= num15; num13++)
				{
					RectangleF rectangleF;
					if (m_blnIsPie())
					{
						r4 = new Rectangle((int)Math.Round(num9 + 5f), (int)(num4 + 5), (int)(num7 - 10), (int)(num7 - 10));
						if (num13 <= Information.UBound(m_arrSeriesColor))
						{
							_g.FillRectangle(m_arrSeriesFillStyle[(int)num13], r4);
						}
						_g.DrawRectangle(new Pen(Color.Black), r4);
						rectangleF = new RectangleF(num9 + (float)num7, num4, num5, num7);
					}
					else
					{
						stringFormat.Alignment = StringAlignment.Center;
						rectangleF = new RectangleF(num9, num4, num5, num7);
					}
					_g.DrawString(m_arrItemsLegend[(int)num13], m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat);
					num9 += num5;
				}
				num4 += num7;
				stringFormat.Alignment = StringAlignment.Near;
			}
			int count = m_Charts.Count;
			for (int i = 1; i <= count; i++)
			{
				Super2d3dGraph super2d3dGraph = (Super2d3dGraph)m_Charts[i];
				long num16 = 0L;
				long num17 = Information.UBound(super2d3dGraph.Series);
				for (long num13 = num16; num13 <= num17; num13++)
				{
					r4 = new Rectangle((int)Math.Round(num10), (int)num4, (int)Math.Round(num8), (int)num7);
					_g.DrawRectangle(new Pen(Color.Black), r4);
					if (m_blnShowLegendInDatatable)
					{
						r4 = new Rectangle((int)Math.Round(num10 + 5f), (int)(num4 + 5), (int)(num7 - 10), (int)(num7 - 10));
						_g.FillRectangle(super2d3dGraph.SeriesFillStyle[(int)num13], r4);
						_g.DrawRectangle(new Pen(SeriesColor[(int)num13], 2f), r4);
						RectangleF rectangleF = new RectangleF(r4.Left + num7, num4, r.Width, num7);
						if (num13 < super2d3dGraph.SeriesLegend.Length)
						{
							_g.DrawString(super2d3dGraph.SeriesLegend[(int)num13], m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat);
						}
						num9 = num10 + 15f + (float)num3 + (float)num7;
					}
					else
					{
						num9 = num10;
					}
					int dataTableStartIndex_CurrentValue = m_DataTableStartIndex_CurrentValue;
					int dataTableLastIndex_CurrentValue = m_DataTableLastIndex_CurrentValue;
					for (int j = dataTableStartIndex_CurrentValue; j <= dataTableLastIndex_CurrentValue; j++)
					{
						if (j < super2d3dGraph.Series[(int)num13].Count)
						{
							object objectValue = RuntimeHelpers.GetObjectValue(super2d3dGraph.Series[(int)num13][j]);
							if (objectValue != null)
							{
								double num18 = ((!Information.IsArray(RuntimeHelpers.GetObjectValue(objectValue))) ? Conversions.ToDouble(objectValue) : (super2d3dGraph.Style switch
								{
									STYLE2D3D.STYLE2D_CANDLESTICK => Conversions.ToSingle(Operators.SubtractObject(NewLateBinding.LateIndexGet(objectValue, new object[1] { 3 }, null), NewLateBinding.LateIndexGet(objectValue, new object[1] { 2 }, null))), 
									STYLE2D3D.STYLE2D_HIGHLOWCLOSE => Conversions.ToSingle(NewLateBinding.LateIndexGet(objectValue, new object[1] { 2 }, null)), 
									STYLE2D3D.STYLE2D_HIGHLOW => Conversions.ToSingle(Operators.SubtractObject(NewLateBinding.LateIndexGet(objectValue, new object[1] { 1 }, null), NewLateBinding.LateIndexGet(objectValue, new object[1] { 0 }, null))), 
									_ => Conversions.ToSingle(NewLateBinding.LateIndexGet(objectValue, new object[1] { Information.UBound((Array)objectValue) }, null)), 
								}));
								RectangleF rectangleF = new RectangleF(num9, num4, num5, num7);
								string text = num18.ToString(m_strValuesFormat);
								if ((num18 >= super2d3dGraph.SeriesMaxY) & super2d3dGraph.MarkHighest)
								{
									Rectangle r5 = new Rectangle((int)Math.Round(rectangleF.Left), (int)Math.Round(rectangleF.Top), (int)Math.Round(rectangleF.Width), (int)Math.Round(rectangleF.Height));
									_g.FillRectangle(new SolidBrush(Color.Yellow), rectangleF);
									Font font2 = new Font(m_DataTableFont, FontStyle.Bold);
									_g.DrawString(text, font2, new SolidBrush(Color.Blue), rectangleF, stringFormat2);
									_g.DrawRectangle(new Pen(Color.Black, 2f), r5);
								}
								else if ((num18 <= super2d3dGraph.SeriesMinY) & super2d3dGraph.MarkLowest)
								{
									Rectangle r6 = new Rectangle((int)Math.Round(rectangleF.Left), (int)Math.Round(rectangleF.Top), (int)Math.Round(rectangleF.Width), (int)Math.Round(rectangleF.Height));
									_g.FillRectangle(new SolidBrush(Color.Red), rectangleF);
									Font font2 = new Font(m_DataTableFont, FontStyle.Bold);
									_g.DrawString(text, font2, new SolidBrush(Color.Yellow), rectangleF, stringFormat2);
									_g.DrawRectangle(new Pen(Color.Black, 2f), r6);
								}
								else
								{
									_g.DrawString(text, m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat2);
								}
							}
						}
						num9 += num5;
					}
					num4 += num7;
				}
			}
			if (Operators.CompareString(m_DataTableAdditionalRowTitle, "", TextCompare: false) == 0)
			{
				return;
			}
			r4 = new Rectangle((int)Math.Round(num10), (int)num4, (int)Math.Round(num8), (int)num7);
			_g.DrawRectangle(new Pen(Color.Black), r4);
			if (m_blnShowLegendInDatatable)
			{
				RectangleF rectangleF = new RectangleF(new Rectangle((int)Math.Round(num10 + 5f), (int)(num4 + 5), (int)(num7 - 10), (int)(num7 - 10)).Left + num7, num4, r.Width, num7);
				_g.DrawString(m_DataTableAdditionalRowTitle, m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat);
				num9 = num10 + 15f + (float)num3 + (float)num7;
			}
			else
			{
				num9 = num10;
			}
			if (!((m_DataTableAdditionalRowValues != null) & !m_blnAnimating))
			{
				return;
			}
			int dataTableStartIndex_CurrentValue2 = m_DataTableStartIndex_CurrentValue;
			int dataTableLastIndex_CurrentValue2 = m_DataTableLastIndex_CurrentValue;
			for (int k = dataTableStartIndex_CurrentValue2; k <= dataTableLastIndex_CurrentValue2; k++)
			{
				if (k < m_DataTableAdditionalRowValues.Length)
				{
					string text2 = m_DataTableAdditionalRowValues[k];
					RectangleF rectangleF = new RectangleF(num9, num4, num5, num7);
					_g.DrawString(text2, m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat2);
				}
				num9 += num5;
			}
			num4 += num7;
		}
	}

	private void m_DrawDataTableGantt(Rectangle r)
	{
		if (m_lngNumX == 0)
		{
			return;
		}
		string[] array = new string[3] { "Start", "End", "Completed" };
		long num = m_intDataTableItemsMaxWidth();
		float num2 = r.Top;
		StringFormat stringFormat = new StringFormat();
		checked
		{
			try
			{
				if (Operators.CompareString(Strings.Trim(m_strDataTableCaption), "", TextCompare: false) != 0)
				{
					stringFormat.Alignment = StringAlignment.Center;
					stringFormat.LineAlignment = StringAlignment.Center;
					RectangleF rectangleF = new RectangleF(r.Left, r.Top + 5, r.Width, r.Height);
					Font font = new Font(m_DataTableFont, FontStyle.Bold);
					SizeF sizeF = _g.MeasureString(m_strDataTableCaption, font);
					sizeF.Width += 10f;
					sizeF.Height += 6f;
					CustomGraphics g = _g;
					RectangleF rf = new RectangleF(rectangleF.Left + rectangleF.Width / 2f - sizeF.Width / 2f, rectangleF.Top - 3f, sizeF.Width, sizeF.Height);
					RoundedRectangle roundedRectangle = new RoundedRectangle(g, rf, 0.5f);
					roundedRectangle.Render(Color.Black, m_DataTableBackColor);
					_g.DrawString(m_strDataTableCaption, font, new SolidBrush(m_DataTableColor), roundedRectangle.RECT, stringFormat);
					num2 += 30f;
				}
				else
				{
					num2 += 10f;
				}
				StringFormat stringFormat2 = new StringFormat();
				stringFormat2.Alignment = m_ValuesAlignment;
				stringFormat2.LineAlignment = StringAlignment.Center;
				stringFormat.Alignment = StringAlignment.Center;
				stringFormat.LineAlignment = StringAlignment.Center;
				long num3 = 100L;
				int num4 = m_arrItemsLegend.Length;
				long num5 = (long)Math.Round(((float)r.Height - (num2 - (float)r.Top)) / (float)(num4 + 1));
				float num6 = num3 * 3;
				num6 += (float)(15 + num + num5);
				float num7 = (float)((double)r.Left + (double)r.Width / 2.0 - (double)(num6 / 2f));
				if (num7 < (float)m_intMarginLeft)
				{
					num7 = m_intMarginLeft;
				}
				float num8 = num7;
				Rectangle r2 = Rectangle.FromLTRB((int)Math.Round(num8 + 3f), (int)Math.Round(num2 + 3f), (int)Math.Round(num8 + num6 + 3f), (int)Math.Round(num2 + (float)(num5 * (num4 + 1)) + 3f));
				_g.FillRectangle(new SolidBrush(Color.FromArgb(100, Color.Brown)), r2);
				Rectangle r3 = Rectangle.FromLTRB((int)Math.Round(num8), (int)Math.Round(num2), (int)Math.Round(num8 + num6), (int)Math.Round(num2 + (float)(num5 * (num4 + 1))));
				_g.FillRectangle(new SolidBrush(m_DataTableBackColor), r3);
				num7 = num8;
				if (m_blnShowDividersX)
				{
					num7 += (float)(15 + num + num5);
					Pen pen = new Pen(Color.Black);
					long num9 = 1L;
					do
					{
						_g.DrawLine(pen, num7, num2, num7, num2 + (float)(num5 * (num4 + 1)));
						num7 += (float)num3;
						num9++;
					}
					while (num9 <= 3);
				}
				num7 = num8;
				num7 += (float)(15 + num + num5);
				Rectangle r4 = new Rectangle((int)Math.Round(num8), (int)Math.Round(num2), (int)Math.Round(num6), (int)num5);
				_g.DrawRectangle(new Pen(Color.Black), r4);
				long num10 = 0L;
				long num11 = array.Length - 1;
				for (long num9 = num10; num9 <= num11; num9++)
				{
					RectangleF rectangleF = new RectangleF(num7, num2, num3, num5);
					_g.DrawString(array[(int)num9], m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat);
					num7 += (float)num3;
				}
				stringFormat.Alignment = StringAlignment.Near;
				float num12 = num2;
				long num13 = 1L;
				long num14 = m_arrItemsLegend.Length;
				for (long num9 = num13; num9 <= num14; num9++)
				{
					num2 = num12 + (float)(num9 * num5);
					r4 = new Rectangle((int)Math.Round(num8), (int)Math.Round(num2 + 1f), (int)Math.Round(num6), (int)num5);
					_g.DrawRectangle(new Pen(Color.Black), r4);
					RectangleF rectangleF = new RectangleF(r4.Left + 5, num2, r.Width, num5);
					_g.DrawString(m_arrItemsLegend[(int)(num9 - 1)], m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat);
					num7 = num8 + (float)num + (float)num5;
					rectangleF = new RectangleF(num7, num2, num3, num5);
					string text = Conversions.ToDate(NewLateBinding.LateIndexGet(m_arrSeries[0][(int)(num9 - 1)], new object[1] { 0 }, null)).ToString("d");
					_g.DrawString(text, m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat2);
					num7 += (float)num3;
					rectangleF = new RectangleF(num7, num2, num3, num5);
					text = Conversions.ToDate(NewLateBinding.LateIndexGet(m_arrSeries[0][(int)(num9 - 1)], new object[1] { 1 }, null)).ToString("d");
					_g.DrawString(text, m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat2);
					num7 += (float)num3;
					rectangleF = new RectangleF(num7, num2, num3, num5);
					text = Conversions.ToSingle(NewLateBinding.LateIndexGet(m_arrSeries[0][(int)(num9 - 1)], new object[1] { 2 }, null)).ToString("p0");
					_g.DrawString(text, m_DataTableFont, new SolidBrush(m_DataTableColor), rectangleF, stringFormat2);
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}

	protected void m_DrawRectShadow(RectangleF r0, Color c1, Color c2)
	{
		checked
		{
			Rectangle rectangle = new Rectangle((int)Math.Round(r0.Left + (float)m_intShadowOffset), (int)Math.Round((double)r0.Top - (double)m_intShadowOffset * 0.8), (int)Math.Round(r0.Width), (int)Math.Round(r0.Height));
			if (!m_blnColoredShadows)
			{
				c1 = Color.DimGray;
				c2 = c1;
			}
			int alpha = Math.Max(128 - m_intShadowOffset * 4, 0);
			c1 = Color.FromArgb(alpha, c1.R, c1.G, c1.B);
			c2 = Color.FromArgb(alpha, c2.R, c2.G, c2.B);
			if (m_blnShadowSmooth)
			{
				GraphicsPath graphicsPath = new GraphicsPath();
				graphicsPath.AddRectangle(rectangle);
				PathGradientBrush pathGradientBrush = new PathGradientBrush(graphicsPath);
				ColorBlend colorBlend = new ColorBlend(3);
				colorBlend.Colors = new Color[3]
				{
					Color.Transparent,
					c1,
					c2
				};
				colorBlend.Positions = new float[3] { 0f, 0.2f, 1f };
				pathGradientBrush.InterpolationColors = colorBlend;
				pathGradientBrush.WrapMode = WrapMode.Clamp;
				_g.FillBlurredPath(pathGradientBrush, graphicsPath);
			}
			else
			{
				_g.FillRectangle(new LinearGradientBrush(rectangle, c1, c2, LinearGradientMode.Vertical), rectangle);
			}
		}
	}

	private void m_DrawHorizontalBarGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Information.UBound(m_arrSeries);
		double num2 = (double)r.Height / (double)m_lngNumX;
		checked
		{
			double num3 = num2 * (0.75 / (double)(num + 1));
			long num4 = (long)Math.Round((double)r.Left + m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Width);
			if (m_blnYAxisLabelsRotated)
			{
				stringFormat.Alignment = StringAlignment.Far;
			}
			else
			{
				stringFormat.Alignment = StringAlignment.Center;
			}
			Pen pen = new Pen(m_YAxisColor);
			pen.DashStyle = DashStyle.Dot;
			if (m_lngNumDividersY > 0)
			{
				long num5 = 0L;
				long lngNumDividersY = m_lngNumDividersY;
				for (long num6 = num5; num6 <= lngNumDividersY; num6++)
				{
					long num7 = (long)Math.Round((double)r.Left + (double)(num6 * r.Width) / (double)m_lngNumDividersY);
					if ((m_WallsBackStyle != STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_TRANSPARENT) & (num6 < m_lngNumDividersY))
					{
						Color color = ((unchecked(num6 % 2) != 0) ? m_WallsBackColorSecondary : m_WallsBackColorPrincipal);
						if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_BANDS)
						{
							_g.FillRectangle(new SolidBrush(color), Rectangle.FromLTRB((int)num7, r.Top, (int)Math.Round((double)r.Left + (double)((num6 + 1) * r.Width) / (double)m_lngNumDividersY), r.Bottom));
						}
						else
						{
							long num8 = 0L;
							long num9 = m_lngNumX - 1;
							for (long num10 = num8; num10 <= num9; num10++)
							{
								double a = (double)r.Top + (double)num10 * num2 - num2 * 0.125;
								_g.FillRectangle(new SolidBrush(color), Rectangle.FromLTRB((int)num7, (int)Math.Round(a), (int)Math.Round((double)r.Left + (double)((num6 + 1) * r.Width) / (double)m_lngNumDividersY), (int)Math.Round((double)r.Top + (double)(num10 + 1) * num2 - num2 * 0.125)));
								unchecked
								{
									color = ((checked(num10 + num6) % 2 != 0) ? m_WallsBackColorPrincipal : m_WallsBackColorSecondary);
								}
							}
						}
					}
					_g.DrawLine(m_GridLineStyle, num7, r.Top, num7, r.Bottom);
					_g.DrawLine(pen, num7, r.Bottom, num7, r.Bottom + m_YAxisTickLength);
					float num11 = (float)((double)num6 * m_dblSeriesRangeY / (double)m_lngNumDividersY + m_dblSeriesMinY);
					RectangleF rectangleF;
					if (m_blnYAxisLabelsRotated)
					{
						SizeF sizeF = _g.MeasureString(num11.ToString(m_YAxisNumericFormat), m_YAxisValuesFont);
						rectangleF = new RectangleF((float)((double)num7 - (double)sizeF.Width / 1.4142), (float)((double)(r.Bottom + 10) + (double)sizeF.Width / 1.4142), sizeF.Width, sizeF.Height);
						_g.TranslateTransform(rectangleF.Left, rectangleF.Top);
						_g.RotateTransform(-45f);
						rectangleF = new RectangleF(0f, 0f, rectangleF.Width, rectangleF.Height);
					}
					else
					{
						rectangleF = new RectangleF((float)((double)num7 - (double)r.Width / (double)m_lngNumDividersY / 2.0), r.Bottom + 10, (float)((double)r.Width / (double)m_lngNumDividersY), 20f);
					}
					_g.DrawString(num11.ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(m_YAxisColor), rectangleF, stringFormat);
					_g.ResetTransform();
				}
			}
			stringFormat.Alignment = StringAlignment.Center;
			if (m_blnShowDividersX)
			{
				long num12 = 1L;
				long num13 = m_lngNumX - 1;
				for (long num6 = num12; num6 <= num13; num6++)
				{
					double a = (double)r.Top + (double)num6 * num2;
					_g.DrawLine(m_GridLineStyle, r.Left, (float)a, r.Right, (float)a);
				}
			}
			if (m_blnXAxis)
			{
				stringFormat.FormatFlags = StringFormatFlags.NoClip;
				if (m_blnXAxisLabelsRotated90)
				{
					stringFormat.Alignment = StringAlignment.Far;
					long num14 = 0L;
					long num15 = Math.Min(Information.UBound(m_arrItemsLegend), m_lngNumX - 1);
					for (long num6 = num14; num6 <= num15; num6++)
					{
						int num16 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont).Width + 10f);
						int num17 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont).Height);
						RectangleF rectangleF = new RectangleF(r.Left - num16 - 10, (float)((double)r.Top + (double)num6 * num2 + num2 / 2.0 - (double)num17 / 2.0), num16, num17);
						_g.DrawString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rectangleF, stringFormat);
					}
				}
				else if (m_blnXAxisLabelsRotated)
				{
					stringFormat.Alignment = StringAlignment.Far;
					long num18 = 0L;
					long num19 = Math.Min(Information.UBound(m_arrItemsLegend), m_lngNumX - 1);
					for (long num6 = num18; num6 <= num19; num6++)
					{
						int val = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont).Width + 10f);
						val = Math.Min(m_intXAxisHeight, val);
						int num20 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont).Height);
						RectangleF rectangleF = new RectangleF((float)((double)r.Left - (double)val / 1.4142), (float)((double)r.Top + (double)num6 * num2 + num2 / 2.0 - (double)val / 1.4142), val, num20);
						_g.RotateTransform(45f);
						_g.TranslateTransform(rectangleF.Left, rectangleF.Top, MatrixOrder.Append);
						rectangleF = new RectangleF(0f, 0f, rectangleF.Width, rectangleF.Height);
						_g.DrawString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rectangleF, stringFormat);
						_g.ResetTransform();
					}
				}
				else
				{
					stringFormat.Alignment = StringAlignment.Center;
					long num21 = 0L;
					long num22 = Math.Min(Information.UBound(m_arrItemsLegend), m_lngNumX - 1);
					for (long num6 = num21; num6 <= num22; num6++)
					{
						RectangleF rectangleF = new RectangleF(r.Left - 10, (float)((double)r.Top + (double)num6 * num2 - num2 * 0.125), (float)num2, 250f);
						_g.RotateTransform(90f);
						_g.TranslateTransform(rectangleF.Left, rectangleF.Top, MatrixOrder.Append);
						rectangleF = new RectangleF(0f, 0f, rectangleF.Width, rectangleF.Height);
						_g.DrawString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rectangleF, stringFormat);
						_g.ResetTransform();
					}
				}
			}
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			if (m_blnShadow)
			{
				long num23 = 0L;
				long num24 = num;
				for (long num6 = num23; num6 <= num24; num6++)
				{
					double a = (double)r.Top + num2 * 0.125 + num3 * (double)num6;
					int itemIndex = 0;
					IEnumerator enumerator = m_arrSeries[(int)num6].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							if (enumerator.Current != null)
							{
								int serieIndex = (int)num6;
								bool blnSombraTransparente = true;
								float percentage = 0.2f;
								m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
								num6 = serieIndex;
								double num25 = Conversions.ToDouble(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Width), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Width));
								if (num25 < 0.0)
								{
									Rectangle rectangle = new Rectangle((int)Math.Round((double)num4 + num25), (int)Math.Round(a), (int)Math.Round(0.0 - num25), (int)Math.Round(num3));
									m_DrawRectShadow(rectangle, c, c2);
								}
								else
								{
									if (num25 == 0.0)
									{
										num25 = 1.0;
									}
									Rectangle rectangle = new Rectangle((int)num4, (int)Math.Round(a), (int)Math.Round(num25), (int)Math.Round(num3));
									m_DrawRectShadow(rectangle, c2, c);
								}
							}
							itemIndex++;
							a += num2;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
					}
				}
			}
			long num26 = 0L;
			long num27 = num;
			for (long num6 = num26; num6 <= num27; num6++)
			{
				double a = (double)r.Top + num2 * 0.125 + num3 * (double)num6;
				int itemIndex2 = 0;
				IEnumerator enumerator = m_arrSeries[(int)num6].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							int serieIndex = (int)num6;
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex2, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							num6 = serieIndex;
							double num25 = Conversions.ToDouble(Operators.SubtractObject(Operators.MultiplyObject(Operators.DivideObject(Operators.SubtractObject(enumerator.Current, m_dblSeriesMinY), m_dblSeriesRangeY), r.Width), m_dblSeriesMiddleY / m_dblSeriesRangeY * (double)r.Width));
							Rectangle rectangle;
							if (num25 < 0.0)
							{
								rectangle = new Rectangle((int)Math.Round((double)num4 + num25), (int)Math.Round(a), (int)Math.Round(0.0 - num25), (int)Math.Round(num3));
								_g.FillRectangle(new LinearGradientBrush(rectangle, c2, c, LinearGradientMode.Horizontal), rectangle);
							}
							else
							{
								if (num25 == 0.0)
								{
									num25 = 1.0;
								}
								rectangle = new Rectangle((int)num4, (int)Math.Round(a), (int)Math.Round(num25), (int)Math.Round(num3));
								_g.FillRectangle(new LinearGradientBrush(rectangle, c, c2, LinearGradientMode.Horizontal), rectangle);
							}
							_g.DrawRectangle(m_arrSeriesBorderStyle[(int)num6], rectangle);
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaption valueCaption2;
								if (num25 < 0.0)
								{
									serieIndex = (int)num6;
									percentage = rectangle.Left - 10;
									float sngPosY = (float)((double)rectangle.Top + (double)rectangle.Height / 2.0);
									string value = Conversions.ToString(enumerator.Current);
									float sngHotSpotX = (float)((double)rectangle.Left - num25);
									float sngHotSpotY = (float)((double)rectangle.Top + (double)rectangle.Height / 2.0);
									ValueCaption valueCaption = new ValueCaption(ref serieIndex, ref itemIndex2, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
									num6 = serieIndex;
									valueCaption2 = valueCaption;
								}
								else
								{
									serieIndex = (int)num6;
									float sngHotSpotY = rectangle.Right + 25;
									float sngHotSpotX = (float)((double)rectangle.Top + (double)rectangle.Height / 2.0);
									string value2 = Conversions.ToString(enumerator.Current);
									float sngPosY = rectangle.Right;
									percentage = (float)((double)rectangle.Top + (double)rectangle.Height / 2.0);
									ValueCaption valueCaption3 = new ValueCaption(ref serieIndex, ref itemIndex2, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage);
									num6 = serieIndex;
									valueCaption2 = valueCaption3;
								}
								valueCaption2.AddZoneRectangle(ref rectangle);
								m_vcc.AddCaption(valueCaption2);
							}
						}
						itemIndex2++;
						a += num2;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	private void m_DrawTornadoGraph(Rectangle r)
	{
		StringFormat stringFormat = new StringFormat();
		if (m_lngNumX == 0)
		{
			return;
		}
		long num = Math.Min(Information.UBound(m_arrSeries), 2);
		double num2 = (double)r.Height / (double)m_lngNumX;
		double num3 = get_m_sngCalcThickness((float)num2);
		checked
		{
			long num4 = (long)Math.Round((double)r.Left + (m_dblSeriesMiddleY + m_dblSeriesRangeY / 2.0) / m_dblSeriesRangeY * (double)r.Width);
			if (m_blnYAxisLabelsRotated)
			{
				stringFormat.Alignment = StringAlignment.Far;
			}
			else
			{
				stringFormat.Alignment = StringAlignment.Center;
			}
			Pen pen = new Pen(m_YAxisColor);
			pen.DashStyle = DashStyle.Dot;
			if (m_lngNumDividersY > 0)
			{
				long num5 = 0L;
				long lngNumDividersY = m_lngNumDividersY;
				for (long num6 = num5; num6 <= lngNumDividersY; num6++)
				{
					long num7 = (long)Math.Round((double)r.Left + (double)(num6 * r.Width) / (double)m_lngNumDividersY);
					if ((m_WallsBackStyle != STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_TRANSPARENT) & (num6 < m_lngNumDividersY))
					{
						Color color = ((unchecked(num6 % 2) != 0) ? m_WallsBackColorSecondary : m_WallsBackColorPrincipal);
						if (m_WallsBackStyle == STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_BANDS)
						{
							_g.FillRectangle(new SolidBrush(color), Rectangle.FromLTRB((int)num7, r.Top, (int)Math.Round((double)r.Left + (double)((num6 + 1) * r.Width) / (double)m_lngNumDividersY), r.Bottom));
						}
						else
						{
							long num8 = 0L;
							long num9 = m_lngNumX - 1;
							for (long num10 = num8; num10 <= num9; num10++)
							{
								double a = (double)r.Top + (double)num10 * num2 - num2 * 0.125;
								_g.FillRectangle(new SolidBrush(color), Rectangle.FromLTRB((int)num7, (int)Math.Round(a), (int)Math.Round((double)r.Left + (double)((num6 + 1) * r.Width) / (double)m_lngNumDividersY), (int)Math.Round((double)r.Top + (double)(num10 + 1) * num2 - num2 * 0.125)));
								unchecked
								{
									color = ((checked(num10 + num6) % 2 != 0) ? m_WallsBackColorPrincipal : m_WallsBackColorSecondary);
								}
							}
						}
					}
					_g.DrawLine(m_GridLineStyle, num7, r.Top, num7, r.Bottom);
					_g.DrawLine(pen, num7, r.Bottom, num7, r.Bottom + m_YAxisTickLength);
					float num11 = (float)Math.Abs((double)num6 * m_dblSeriesMaxY * 2.0 / (double)m_lngNumDividersY - m_dblSeriesMaxY);
					RectangleF rectangleF;
					if (m_blnYAxisLabelsRotated)
					{
						SizeF sizeF = _g.MeasureString(num11.ToString(m_YAxisNumericFormat), m_YAxisValuesFont);
						rectangleF = new RectangleF((float)((double)num7 - (double)sizeF.Width / 1.4142), (float)((double)(r.Bottom + 10) + (double)sizeF.Width / 1.4142), sizeF.Width, sizeF.Height);
						_g.TranslateTransform(rectangleF.Left, rectangleF.Top);
						_g.RotateTransform(-45f);
						rectangleF = new RectangleF(0f, 0f, rectangleF.Width, rectangleF.Height);
					}
					else
					{
						rectangleF = new RectangleF((float)((double)num7 - (double)r.Width / (double)m_lngNumDividersY / 2.0), r.Bottom + 10, (float)((double)r.Width / (double)m_lngNumDividersY), 20f);
					}
					_g.DrawString(num11.ToString(m_YAxisNumericFormat), m_YAxisValuesFont, new SolidBrush(m_YAxisColor), rectangleF, stringFormat);
					_g.ResetTransform();
				}
			}
			stringFormat.Alignment = StringAlignment.Center;
			if (m_blnShowDividersX)
			{
				long num12 = 1L;
				long num13 = m_lngNumX - 1;
				for (long num6 = num12; num6 <= num13; num6++)
				{
					double a = (double)r.Top + (double)num6 * num2;
					_g.DrawLine(m_GridLineStyle, r.Left, (float)a, r.Right, (float)a);
				}
			}
			if (m_blnXAxis)
			{
				stringFormat.FormatFlags = StringFormatFlags.NoClip;
				if (m_blnXAxisLabelsRotated90)
				{
					stringFormat.Alignment = StringAlignment.Far;
					long num14 = 0L;
					long num15 = Math.Min(Information.UBound(m_arrItemsLegend), m_lngNumX - 1);
					for (long num6 = num14; num6 <= num15; num6++)
					{
						int num16 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont).Width + 10f);
						int num17 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont).Height);
						RectangleF rectangleF = new RectangleF(r.Left - num16 - 10, (float)((double)r.Top + (double)num6 * num2 + num2 / 2.0 - (double)num17 / 2.0), num16, num17);
						_g.DrawString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rectangleF, stringFormat);
					}
				}
				else if (m_blnXAxisLabelsRotated)
				{
					stringFormat.Alignment = StringAlignment.Far;
					long num18 = 0L;
					long num19 = Math.Min(Information.UBound(m_arrItemsLegend), m_lngNumX - 1);
					for (long num6 = num18; num6 <= num19; num6++)
					{
						int val = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont).Width + 10f);
						val = Math.Min(m_intXAxisHeight, val);
						int num20 = (int)Math.Round(_g.MeasureString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont).Height);
						RectangleF rectangleF = new RectangleF((float)((double)r.Left - (double)val / 1.4142), (float)((double)r.Top + (double)num6 * num2 + num2 / 2.0 - (double)val / 1.4142), val, num20);
						_g.RotateTransform(45f);
						_g.TranslateTransform(rectangleF.Left, rectangleF.Top, MatrixOrder.Append);
						rectangleF = new RectangleF(0f, 0f, rectangleF.Width, rectangleF.Height);
						_g.DrawString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rectangleF, stringFormat);
						_g.ResetTransform();
					}
				}
				else
				{
					stringFormat.Alignment = StringAlignment.Center;
					long num21 = 0L;
					long num22 = Math.Min(Information.UBound(m_arrItemsLegend), m_lngNumX - 1);
					for (long num6 = num21; num6 <= num22; num6++)
					{
						RectangleF rectangleF = new RectangleF(r.Left - 10, (float)((double)r.Top + (double)num6 * num2 - num2 * 0.125), (float)num2, 250f);
						_g.RotateTransform(90f);
						_g.TranslateTransform(rectangleF.Left, rectangleF.Top, MatrixOrder.Append);
						rectangleF = new RectangleF(0f, 0f, rectangleF.Width, rectangleF.Height);
						_g.DrawString(m_arrItemsLegend[(int)num6], m_XAxisValuesFont, new SolidBrush(m_XAxisColor), rectangleF, stringFormat);
						_g.ResetTransform();
					}
				}
			}
			stringFormat.LineAlignment = StringAlignment.Center;
			stringFormat.FormatFlags = StringFormatFlags.NoWrap;
			Color c = default(Color);
			Color c2 = default(Color);
			Color c1a = default(Color);
			Color c2a = default(Color);
			if (m_blnShadow)
			{
				long num23 = 0L;
				long num24 = num;
				for (long num6 = num23; num6 <= num24; num6++)
				{
					double a = (double)r.Top + num2 * 0.5 - num3 / 2.0;
					int itemIndex = 0;
					IEnumerator enumerator = m_arrSeries[(int)num6].GetEnumerator();
					while (enumerator.MoveNext())
					{
						try
						{
							if (enumerator.Current != null)
							{
								float num25 = Conversions.ToSingle(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null));
								if (num6 == 0)
								{
									num25 = 0f - num25;
								}
								int serieIndex = (int)num6;
								bool blnSombraTransparente = true;
								float percentage = 0.2f;
								m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
								num6 = serieIndex;
								double num26 = (double)num25 / m_dblSeriesMaxY * ((double)r.Width / 2.0);
								if (num26 < 0.0)
								{
									Rectangle rectangle = new Rectangle((int)Math.Round((double)num4 + num26), (int)Math.Round(a), (int)Math.Round(0.0 - num26), (int)Math.Round(num3));
									m_DrawRectShadow(rectangle, c, c2);
								}
								else
								{
									if (num26 == 0.0)
									{
										num26 = 1.0;
									}
									Rectangle rectangle = new Rectangle((int)num4, (int)Math.Round(a), (int)Math.Round(num26), (int)Math.Round(num3));
									m_DrawRectShadow(rectangle, c2, c);
								}
							}
							itemIndex++;
							a += num2;
						}
						catch (Exception ex)
						{
							ProjectData.SetProjectError(ex);
							Exception ex2 = ex;
							ProjectData.ClearProjectError();
						}
					}
				}
			}
			long num27 = 0L;
			long num28 = num;
			for (long num6 = num27; num6 <= num28; num6++)
			{
				double a = (double)r.Top + num2 * 0.5 - num3 / 2.0;
				int itemIndex2 = 0;
				IEnumerator enumerator = m_arrSeries[(int)num6].GetEnumerator();
				while (enumerator.MoveNext())
				{
					try
					{
						if (enumerator.Current != null)
						{
							float num29 = Conversions.ToSingle(NewLateBinding.LateGet(null, typeof(Math), "Abs", new object[1] { RuntimeHelpers.GetObjectValue(enumerator.Current) }, null, null, null));
							if (num6 == 0)
							{
								num29 = 0f - num29;
							}
							int serieIndex = (int)num6;
							bool blnSombraTransparente = true;
							float percentage = 0.2f;
							m_CalculateColorRampFromItem(ref serieIndex, ref itemIndex2, ref c, ref c2, ref c1a, ref c2a, ref blnSombraTransparente, ref percentage);
							num6 = serieIndex;
							double num26 = (double)num29 / m_dblSeriesMaxY * ((double)r.Width / 2.0);
							Rectangle rectangle;
							if (num26 < 0.0)
							{
								rectangle = new Rectangle((int)Math.Round((double)num4 + num26), (int)Math.Round(a), (int)Math.Round(0.0 - num26), (int)Math.Round(num3));
								_g.FillRectangle(new LinearGradientBrush(rectangle, c2, c, LinearGradientMode.Horizontal), rectangle);
							}
							else
							{
								if (num26 == 0.0)
								{
									num26 = 1.0;
								}
								rectangle = new Rectangle((int)num4, (int)Math.Round(a), (int)Math.Round(num26), (int)Math.Round(num3));
								_g.FillRectangle(new LinearGradientBrush(rectangle, c, c2, LinearGradientMode.Horizontal), rectangle);
							}
							_g.DrawRectangle(m_arrSeriesBorderStyle[(int)num6], rectangle);
							if (m_blnShowValues | m_blnHotSpots)
							{
								ValueCaption valueCaption2;
								if (num26 < 0.0)
								{
									serieIndex = (int)num6;
									percentage = rectangle.Left - 10;
									float sngPosY = (float)((double)rectangle.Top + (double)rectangle.Height / 2.0);
									string value = Conversions.ToString(enumerator.Current);
									float sngHotSpotX = (float)((double)rectangle.Left - num26);
									float sngHotSpotY = (float)((double)rectangle.Top + (double)rectangle.Height / 2.0);
									ValueCaption valueCaption = new ValueCaption(ref serieIndex, ref itemIndex2, ref percentage, ref sngPosY, value, ref sngHotSpotX, ref sngHotSpotY);
									num6 = serieIndex;
									valueCaption2 = valueCaption;
								}
								else
								{
									serieIndex = (int)num6;
									float sngHotSpotY = rectangle.Right + 25;
									float sngHotSpotX = (float)((double)rectangle.Top + (double)rectangle.Height / 2.0);
									string value2 = Conversions.ToString(enumerator.Current);
									float sngPosY = rectangle.Right;
									percentage = (float)((double)rectangle.Top + (double)rectangle.Height / 2.0);
									ValueCaption valueCaption3 = new ValueCaption(ref serieIndex, ref itemIndex2, ref sngHotSpotY, ref sngHotSpotX, value2, ref sngPosY, ref percentage);
									num6 = serieIndex;
									valueCaption2 = valueCaption3;
								}
								valueCaption2.AddZoneRectangle(ref rectangle);
								m_vcc.AddCaption(valueCaption2);
							}
						}
						itemIndex2++;
						a += num2;
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						ProjectData.ClearProjectError();
					}
				}
			}
		}
	}

	protected void m_CalculateColorRampFromItem(ref int serieIndex, ref int itemIndex, ref Color c1, ref Color c2, ref Color c1a, ref Color c2a, ref bool blnSombraTransparente, [Optional][DefaultParameterValue(0.2f)] ref float percentage)
	{
		Color color = ((!((m_blnIsPie() | (m_lngStyle == STYLE2D3D.STYLE2D_GANTT)) & (m_arrSeriesColor.Length > itemIndex))) ? m_arrSeriesColor[serieIndex] : m_arrSeriesColor[itemIndex]);
		if (Information.IsArray(m_ItemsColor) && m_ItemsColor.Length > serieIndex && m_ItemsColor[serieIndex] != null && m_ItemsColor[serieIndex].Count > itemIndex && m_ItemsColor[serieIndex][itemIndex] is Color)
		{
			object obj = m_ItemsColor[serieIndex][itemIndex];
			Color color2 = default(Color);
			color = ((obj != null) ? ((Color)obj) : color2);
		}
		if (m_blnSolidColor | (percentage == 0f))
		{
			c1 = color;
			c2 = c1;
		}
		else
		{
			c1 = ControlPaint.Dark(color, percentage);
			c2 = ControlPaint.Light(color, percentage);
		}
		Color color3 = ControlPaint.Dark(c1, percentage);
		Color color4 = ControlPaint.Dark(c2, percentage);
		if (blnSombraTransparente)
		{
			c1a = Color.FromArgb(128, color3.R, color3.G, color3.B);
			c2a = Color.FromArgb(128, color4.R, color4.G, color4.B);
		}
		else
		{
			c1a = Color.FromArgb(255, color3.R, color3.G, color3.B);
			c2a = Color.FromArgb(255, color4.R, color4.G, color4.B);
		}
	}

	protected void m_CalculateColorRampFromColor(Color color, ref Color c1, ref Color c2, ref Color c1a, ref Color c2a, bool blnSombraTransparente)
	{
		if (m_blnSolidColor)
		{
			c1 = color;
			c2 = c1;
		}
		else
		{
			c1 = ControlPaint.Dark(color, 0.2f);
			c2 = ControlPaint.Light(color, 0.2f);
		}
		Color color2 = ControlPaint.Dark(c1, 0.2f);
		Color color3 = ControlPaint.Dark(c2, 0.2f);
		if (blnSombraTransparente)
		{
			c1a = Color.FromArgb(128, color2.R, color2.G, color2.B);
			c2a = Color.FromArgb(128, color3.R, color3.G, color3.B);
		}
		else
		{
			c1a = Color.FromArgb(255, color2.R, color2.G, color2.B);
			c2a = Color.FromArgb(255, color3.R, color3.G, color3.B);
		}
	}

	private void Super2d3dGraph_MouseClick(object sender, MouseEventArgs e)
	{
		try
		{
			if (!m_blnHotSpots)
			{
				return;
			}
			ValueCaption valueCaption = null;
			if (e.Button != MouseButtons.Left)
			{
				return;
			}
			if (((Control.ModifierKeys & Keys.Control) == 0) & ((Control.ModifierKeys & Keys.Shift) == 0))
			{
				SelectionClear();
			}
			foreach (Super2d3dGraph chart in m_Charts)
			{
				ValueCaptionRenderer vcc = chart.m_vcc;
				if (vcc != null)
				{
					valueCaption = vcc.HitTest(e.X, e.Y, m_HotSpotHitTestPrecision);
					if (valueCaption != null)
					{
						_ = checked(ValueClick?.Invoke(_g, valueCaption.seriesIndex + 1, valueCaption.itemIndex + 1));
						SelectionAddValueCaption(valueCaption, !m_blnValueCaptionClickedWasSelected);
						break;
					}
				}
			}
			if (valueCaption == null)
			{
				if (((Control.ModifierKeys & Keys.Control) == 0) & ((Control.ModifierKeys & Keys.Shift) == 0))
				{
					SelectionClear();
				}
				m_RefreshGraph(blnForce: true);
				Application.DoEvents();
			}
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			ProjectData.ClearProjectError();
		}
	}

	private void Super2d3dGraph_MouseDown(object sender, MouseEventArgs e)
	{
		try
		{
			m_MouseLastX = e.X;
			m_MouseLastY = e.Y;
			if (!m_blnHotSpots || e.Button != MouseButtons.Left)
			{
				return;
			}
			if (((Control.ModifierKeys & Keys.Control) == 0) & ((Control.ModifierKeys & Keys.Shift) == 0))
			{
				SelectionClear();
				return;
			}
			ValueCaption valueCaption = null;
			foreach (Super2d3dGraph chart in m_Charts)
			{
				ValueCaptionRenderer vcc = chart.m_vcc;
				if (vcc != null)
				{
					valueCaption = vcc.HitTest(e.X, e.Y, m_HotSpotHitTestPrecision);
					if (valueCaption != null)
					{
						_ = checked(ValueClick?.Invoke(_g, valueCaption.seriesIndex + 1, valueCaption.itemIndex + 1));
						SelectionAddValueCaption(valueCaption, blnOnlyAdd: true);
						break;
					}
				}
			}
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			ProjectData.ClearProjectError();
		}
	}

	public void SelectionAddItem(int seriesIndex, int itemIndex)
	{
		ValueCaption valueCaption = null;
		if (m_vcc == null)
		{
			m_RefreshGraph(blnForce: true);
		}
		if (m_vcc != null)
		{
			valueCaption = m_vcc.GetByItemIndex(seriesIndex, itemIndex);
			if (valueCaption != null)
			{
				SelectionAddValueCaption(valueCaption, blnOnlyAdd: true);
			}
			m_RefreshGraph(blnForce: true);
		}
	}

	public void SelectionClear()
	{
		m_caption = null;
		m_ItemsSelected = new ArrayList();
		if (m_DataSource == null)
		{
			return;
		}
		try
		{
			m_blnDataSourceUpdating = true;
			m_DataSource.ClearSelection();
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			ProjectData.ClearProjectError();
		}
		finally
		{
			m_blnDataSourceUpdating = false;
		}
	}

	private void SelectionAddValueCaption(ValueCaption hotSpot, bool blnOnlyAdd = false)
	{
		bool flag = false;
		foreach (ValueCaption item in m_ItemsSelected)
		{
			if (!((item.seriesIndex == hotSpot.seriesIndex) & (item.itemIndex == hotSpot.itemIndex)))
			{
				continue;
			}
			if (!blnOnlyAdd)
			{
				m_ItemsSelected.Remove(item);
				if (m_DataSource != null)
				{
					try
					{
						m_blnDataSourceUpdating = true;
						m_DataSource.Rows[item.seriesIndex].Cells[item.itemIndex].Selected = false;
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						ProjectData.ClearProjectError();
					}
					finally
					{
						m_blnDataSourceUpdating = false;
					}
				}
			}
			flag = true;
			break;
		}
		m_blnValueCaptionClickedWasSelected = flag;
		if (!flag)
		{
			m_ItemsSelected.Add(hotSpot);
			if (m_DataSource != null)
			{
				try
				{
					m_blnDataSourceUpdating = true;
					m_DataSource.Rows[hotSpot.seriesIndex].Cells[hotSpot.itemIndex].Selected = true;
				}
				catch (Exception ex3)
				{
					ProjectData.SetProjectError(ex3);
					Exception ex4 = ex3;
					ProjectData.ClearProjectError();
				}
				finally
				{
					m_blnDataSourceUpdating = false;
				}
			}
		}
		m_RefreshGraph(blnForce: true);
	}

	private void Super2D3dGraph_MouseMove(object sender, MouseEventArgs e)
	{
		if (_0024STATIC_0024Super2D3dGraph_MouseMove_002420211C1280B5_0024blnBusy)
		{
			return;
		}
		_0024STATIC_0024Super2D3dGraph_MouseMove_002420211C1280B5_0024blnBusy = true;
		checked
		{
			try
			{
				bool flag = default(bool);
				if (e.Button == MouseButtons.Left)
				{
					if (m_ItemsSelected.Count > 0)
					{
						float dx = (float)((double)(m_MouseLastX - e.X) * m_dblSeriesRangeX / (double)m_rectChart.Width);
						float dy = (float)((double)(m_MouseLastY - e.Y) * m_dblSeriesRangeY / (double)m_rectChart.Height);
						m_ItemsSelected_Add(dx, dy);
					}
					else
					{
						m_XYZ_YAngle = (float)((double)m_XYZ_YAngle - (double)(m_MouseLastX - e.X) * Math.PI / 180.0);
						m_XYZ_XAngle = (float)((double)m_XYZ_XAngle - (double)(m_MouseLastY - e.Y) * Math.PI / 180.0);
						if (m_ZoomEnabled & (m_lngStyle < STYLE2D3D.STYLE3D_XYZ_LINE))
						{
							if ((m_ZoomMode == ZOOM_MODE.BOTH_AXIS) | (m_ZoomMode == ZOOM_MODE.XAXIS_ONLY))
							{
								m_ZoomTargetOffsetX -= m_MouseLastX - e.X;
							}
							if ((m_ZoomMode == ZOOM_MODE.BOTH_AXIS) | (m_ZoomMode == ZOOM_MODE.YAXIS_ONLY))
							{
								m_ZoomTargetOffsetY += m_MouseLastY - e.Y;
							}
						}
						else
						{
							flag = true;
						}
					}
				}
				else if (m_blnHotSpots & !m_ZoomOldChanges)
				{
					foreach (Super2d3dGraph chart in m_Charts)
					{
						ValueCaptionRenderer vcc = chart.m_vcc;
						if (vcc == null)
						{
							continue;
						}
						ValueCaption valueCaption = vcc.HitTest(e.X, e.Y, m_HotSpotHitTestPrecision);
						if (valueCaption != null)
						{
							if ((Control.ModifierKeys & Keys.Shift) != 0)
							{
								SelectionAddValueCaption(valueCaption, blnOnlyAdd: true);
							}
							if (m_blnIsDotty())
							{
								chart.m_caption = valueCaption;
							}
							else if ((m_lngStyle == STYLE2D3D.STYLE2D_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_ACUM) | (m_lngStyle == STYLE2D3D.STYLE2D_ACUM_FIXED) | (m_lngStyle == STYLE2D3D.STYLE2D_PYRAMID) | (m_lngStyle == STYLE2D3D.STYLE2D_PICTURES) | (m_lngStyle == STYLE2D3D.STYLE2D_CYLINDER) | (m_lngStyle == STYLE2D3D.STYLE2D_ROUNDED_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_HORIZONTAL_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_TORNADO))
							{
								chart.m_caption = valueCaption;
								chart.m_caption.X_HotSpot = e.X;
								chart.m_caption.Y_HotSpot = e.Y;
							}
							else if ((m_lngStyle != STYLE2D3D.STYLE2D_PIE) & (m_lngStyle != STYLE2D3D.STYLE3D_PIE) & (m_lngStyle != STYLE2D3D.STYLE2D_DOUGHNUT) & (m_lngStyle != STYLE2D3D.STYLE3D_DOUGHNUT) & (m_lngStyle < STYLE2D3D.STYLE3D_XYZ_SCATTER) & (m_lngStyle != STYLE2D3D.STYLE2D_XY_DATETIME) & (m_lngStyle != STYLE2D3D.STYLE2D_XY_LINE_DATETIME) & (m_lngStyle != STYLE2D3D.STYLE2D_XY))
							{
								int seriesIndex = valueCaption.seriesIndex;
								int itemIndex = valueCaption.itemIndex;
								float sngPosX = e.X;
								float sngPosY = e.Y;
								chart.m_caption = new ValueCaption(ref seriesIndex, ref itemIndex, ref sngPosX, ref sngPosY, valueCaption.ValueNumeric);
							}
							else
							{
								chart.m_caption = valueCaption;
								chart.m_caption.X_HotSpot = e.X;
								chart.m_caption.Y_HotSpot = e.Y;
							}
							SCALEMODE xAxisScaleMode = XAxisScaleMode;
							if (xAxisScaleMode == SCALEMODE.SCALEMODE_FIXED_DATETIME)
							{
								long ticks = m_XAxisScaleMinimumDateTime.Ticks;
								long num = m_XAxisScaleMaximumDateTime.Ticks - ticks;
								float num2 = (float)ticks + (chart.m_caption.X - (float)m_rectChart.Left) * (float)num / (float)m_rectChart.Width;
								DateTime dateTime = new DateTime((long)Math.Round(num2));
								DateTime dateTime2 = dateTime;
								string text = dateTime2.ToString(m_HotSpotDateTimeFormat);
								chart.m_caption.Caption = text + ": " + chart.m_caption.ValueNumeric.ToString(m_HotSpotNumericFormat);
							}
							flag = true;
						}
						else if (m_caption != null)
						{
							chart.m_caption = null;
							flag = true;
						}
					}
				}
				m_MouseLastY = e.Y;
				m_MouseLastX = e.X;
				_0024STATIC_0024Super2D3dGraph_MouseMove_002420211C1280B5_0024blnBusy = false;
				if (flag)
				{
					m_RefreshGraph(blnForce: true);
					Application.DoEvents();
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
			_0024STATIC_0024Super2D3dGraph_MouseMove_002420211C1280B5_0024blnBusy = false;
		}
	}

	private void Super2d3dGraph_MouseWheel(object sender, MouseEventArgs e)
	{
		if (e.Delta < 0)
		{
			m_ZoomTargetFactor -= m_ZoomInterval;
		}
		else
		{
			m_ZoomTargetFactor += m_ZoomInterval;
		}
		Application.DoEvents();
	}

	private void Super2DGraph_Resize(object sender, EventArgs e)
	{
		m_RefreshGraph(blnForce: true);
	}

	public Image CreateAnimatedGIF(int intFrames, int intSpeed, bool blnLoop, STYLEANIMATION style)
	{
		MemoryStream memoryStream = new MemoryStream();
		MemoryStream memoryStream2 = new MemoryStream();
		byte[] buffer = new byte[20]
		{
			33, 255, 11, 78, 69, 84, 83, 67, 65, 80,
			69, 50, 46, 48, 3, 1, 0, 0, 0, 0
		};
		checked
		{
			byte[] buffer2 = new byte[9]
			{
				33,
				249,
				4,
				9,
				(byte)(intSpeed & 0xFF),
				(byte)(intSpeed & 0xFF00),
				255,
				0,
				0
			};
			BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
			bool blnShowValues = m_blnShowValues;
			float num = 0f;
			for (int i = 0; i <= intFrames; i++)
			{
				if (blnShowValues)
				{
					m_blnShowValues = i == intFrames;
				}
				m_AnimateOne(num, num, style, 1f);
				num = (float)((double)num + 100.0 / (double)intFrames);
				OctreeQuantizer octreeQuantizer = new OctreeQuantizer(255, 8);
				octreeQuantizer.Quantize(Image).Save(memoryStream2, ImageFormat.Gif);
				byte[] array = memoryStream2.ToArray();
				if (i == 0)
				{
					array[10] = (byte)(array[10] - 128);
					binaryWriter.Write(array, 0, 13);
					if (blnLoop)
					{
						binaryWriter.Write(buffer, 0, 19);
					}
				}
				binaryWriter.Write(buffer2, 0, 8);
				array[798] = 135;
				binaryWriter.Write(array, 789, 10);
				binaryWriter.Write(array, 13, 768);
				binaryWriter.Write(array, 799, array.Length - 800);
				if (i == intFrames)
				{
					binaryWriter.Write(";");
				}
				memoryStream2.SetLength(0L);
			}
			Image result = System.Drawing.Image.FromStream(memoryStream);
			binaryWriter.Close();
			return result;
		}
	}

	public void SampleData()
	{
		VBMath.Randomize();
		SampleData(checked((int)Math.Round(Conversion.Int(VBMath.Rnd() * 3f) + 1f)), 5, 0.0, 200.0);
	}

	private float y(float x, float z)
	{
		return (float)((double)x * Math.Exp(0.0 - Math.Pow(x, 2.0) - Math.Pow(z, 2.0)));
	}

	public void SampleData(int seriesCount, int serieLength, double dblMinValue, double dblMaxValue)
	{
		VBMath.Randomize();
		if ((m_lngStyle == STYLE2D3D.STYLE2D_ACUM_FIXED) | (m_lngStyle == STYLE2D3D.STYLE2D_CANDLESTICK) | (m_lngStyle == STYLE2D3D.STYLE2D_HIGHLOW) | (m_lngStyle == STYLE2D3D.STYLE2D_HIGHLOWCLOSE) | (m_lngStyle == STYLE2D3D.STYLE2D_RADAR) | (m_lngStyle == STYLE2D3D.STYLE2D_SPLINE_AREA) | (m_lngStyle == STYLE2D3D.STYLE2D_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_SPLINE_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_SPLINE_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_STACKED_AREA) | (m_lngStyle == STYLE2D3D.STYLE3D_STACKED_BAR) | (m_lngStyle == STYLE2D3D.STYLE3D_STACKED_COLUMN) | (m_lngStyle == STYLE2D3D.STYLE2D_TORNADO) | (m_lngStyle == STYLE2D3D.STYLE2D_PICTURES))
		{
			dblMinValue = 0.0;
		}
		checked
		{
			switch (m_lngStyle)
			{
			case STYLE2D3D.STYLE3D_XYZ_MESH:
			case STYLE2D3D.STYLE3D_XYZ_SURFACE:
			{
				m_blnDataTable = false;
				m_blnLegend = false;
				m_YAxisNumericFormat = "0.00";
				m_XAxisNumericFormat = "0.00";
				m_ZAxisNumericFormat = "0.00";
				m_SurfaceBrushStyle = new SolidBrush(Color.LightGreen);
				SeriesFactory seriesFactory = new SeriesFactory();
				SeriesFactory.f_y f_y = y;
				seriesFactory.AddPoints(-2f, 2f, 0.2f, -2f, 2f, 0.2f, ref f_y);
				seriesFactory.ApplyTo(this);
				SetAllSeriesLineStyle(new Pen(Color.Black));
				WallsBackStyle = STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_SOLID;
				WallsBackColorPrincipal = Color.White;
				return;
			}
			case STYLE2D3D.STYLE3D_XYZ_SURFACE_TRIANGLE:
			{
				m_blnDataTable = false;
				m_blnLegend = false;
				m_YAxisNumericFormat = "0";
				m_XAxisNumericFormat = "0";
				m_ZAxisNumericFormat = "0";
				m_SurfaceBrushStyle = new SolidBrush(Color.LightGreen);
				m_SurfaceBrushMinBrightness = 30;
				SeriesFactory seriesFactory2 = new SeriesFactory();
				int num = 0;
				do
				{
					int num2 = 0;
					do
					{
						int num3 = (int)Math.Round(30.0 - Math.Sqrt((num - 50) * (num - 50) + (num2 - 50) * (num2 - 50)) + (double)(VBMath.Rnd() * 5f));
						if (num3 < 0)
						{
							num3 = 0;
						}
						seriesFactory2.AddPoint(num, num3, num2);
						num2 += 5;
					}
					while (num2 <= 100);
					num += 5;
				}
				while (num <= 100);
				seriesFactory2.GenerateMesh();
				seriesFactory2.ApplyTo(this);
				SetAllSeriesLineStyle(new Pen(Color.Black));
				WallsBackStyle = STYLEWALLBACKGROUND.STYLEWALLBACKGROUND_SOLID;
				WallsBackColorPrincipal = Color.White;
				return;
			}
			}
			if (m_lngStyle == STYLE2D3D.STYLE3D_XYZ_MESH)
			{
				m_blnDataTable = false;
				m_blnLegend = false;
			}
			double num4 = dblMaxValue - dblMinValue;
			int num5 = chartDimensions[Array.IndexOf(values, m_lngStyle)];
			ArrayList[] array = new ArrayList[seriesCount - 1 + 1];
			int num6 = seriesCount - 1;
			for (int i = 0; i <= num6; i++)
			{
				array[i] = new ArrayList();
				for (int j = 1; j <= serieLength; j++)
				{
					if ((m_lngStyle == STYLE2D3D.STYLE2D_XY_DATETIME) | (m_lngStyle == STYLE2D3D.STYLE2D_XY_LINE_DATETIME))
					{
						array[i].Add(new object[2]
						{
							DateTime.Now.AddDays(VBMath.Rnd() * 100f),
							(double)VBMath.Rnd() * num4 + dblMinValue
						});
						continue;
					}
					if (m_lngStyle == STYLE2D3D.STYLE2D_XY_SPLINE_DEV)
					{
						array[i].Add(new double[3]
						{
							(double)VBMath.Rnd() * num4 + dblMinValue,
							(double)VBMath.Rnd() * num4 + dblMinValue,
							VBMath.Rnd() * 10f + 5f
						});
						continue;
					}
					switch (num5)
					{
					case 1:
						array[i].Add((double)VBMath.Rnd() * num4 + dblMinValue);
						break;
					case 2:
						array[i].Add(new double[2]
						{
							(double)VBMath.Rnd() * num4 + dblMinValue,
							(double)VBMath.Rnd() * num4 + dblMinValue
						});
						break;
					case 3:
						array[i].Add(new double[3]
						{
							(double)VBMath.Rnd() * num4 + dblMinValue,
							(double)VBMath.Rnd() * num4 + dblMinValue,
							(double)VBMath.Rnd() * num4 + dblMinValue
						});
						break;
					case 4:
						array[i].Add(new double[4]
						{
							(double)VBMath.Rnd() * num4 + dblMinValue,
							(double)VBMath.Rnd() * num4 + dblMinValue,
							(double)VBMath.Rnd() * num4 + dblMinValue,
							(double)VBMath.Rnd() * num4 + dblMinValue
						});
						break;
					}
				}
			}
			Series = array;
		}
	}

	public void SampleData(int seriesCount, int serieLength, DateTime datMinDate, DateTime datMaxDate, double dblMinValue, double dblMaxValue)
	{
		VBMath.Randomize();
		double num = dblMaxValue - dblMinValue;
		checked
		{
			double num2 = datMaxDate.Ticks - datMinDate.Ticks;
			ArrayList[] array = new ArrayList[seriesCount - 1 + 1];
			int num3 = seriesCount - 1;
			for (int i = 0; i <= num3; i++)
			{
				array[i] = new ArrayList();
				for (int j = 1; j <= serieLength; j++)
				{
					ArrayList obj = array[i];
					object[] array2 = new object[2];
					DateTime dateTime = new DateTime((long)Math.Round((double)datMinDate.Ticks + (double)VBMath.Rnd() * num2));
					array2[0] = dateTime;
					array2[1] = (double)VBMath.Rnd() * num + dblMinValue;
					obj.Add(array2);
				}
			}
			Series = array;
		}
	}

	public void SampleChart()
	{
		SampleChart(-1);
	}

	public void SampleChart(int chartStyleIndex)
	{
		bool blnAutoRefresh = m_blnAutoRefresh;
		m_blnAutoRefresh = false;
		switch ((chartStyleIndex >= 0) ? (chartStyleIndex % 20) : checked((int)Math.Round(Conversion.Int(VBMath.Rnd() * 20f))))
		{
		case 0:
			Style = STYLE2D3D.STYLE2D_ACUM;
			break;
		case 1:
			Style = STYLE2D3D.STYLE2D_ACUM_FIXED;
			break;
		case 2:
			Style = STYLE2D3D.STYLE2D_BAR;
			break;
		case 3:
			Style = STYLE2D3D.STYLE2D_CYLINDER;
			break;
		case 4:
			Style = STYLE2D3D.STYLE2D_LINE;
			break;
		case 5:
			Style = STYLE2D3D.STYLE2D_PYRAMID;
			break;
		case 6:
			Style = STYLE2D3D.STYLE2D_ROUNDED_BAR;
			break;
		case 7:
			Style = STYLE2D3D.STYLE2D_STACKED_AREA;
			break;
		case 8:
			Style = STYLE2D3D.STYLE3D_STACKED_BAR;
			break;
		case 9:
			Style = STYLE2D3D.STYLE3D_SPLINE_STACKED_AREA;
			break;
		case 10:
			Style = STYLE2D3D.STYLE3D_STACKED_AREA;
			break;
		case 11:
			Style = STYLE2D3D.STYLE2D_PIE;
			break;
		case 12:
			Style = STYLE2D3D.STYLE2D_DOUGHNUT;
			break;
		case 13:
			Style = STYLE2D3D.STYLE2D_SPLINE_AREA;
			break;
		case 14:
			Style = STYLE2D3D.STYLE3D_STACKED_COLUMN;
			break;
		case 15:
			Style = STYLE2D3D.STYLE2D_RADAR;
			break;
		case 16:
			Style = STYLE2D3D.STYLE2D_POINT;
			break;
		case 17:
			Style = STYLE2D3D.STYLE2D_HORIZONTAL_BAR;
			break;
		case 18:
			Style = STYLE2D3D.STYLE3D_XYZ_SURFACE;
			break;
		case 19:
			Style = STYLE2D3D.STYLE3D_XYZ_SURFACE_TRIANGLE;
			break;
		}
		SampleData();
		checked
		{
			int num = m_arrSeries.Length - 1;
			string[] array = new string[num + 1];
			Color[] array2 = new Color[num + 1];
			int num2 = num;
			for (int i = 0; i <= num2; i++)
			{
				array[i] = "Product " + Conversions.ToString(i);
				ref Color reference = ref array2[i];
				reference = Color.FromArgb(255, (int)Math.Round(VBMath.Rnd() * 255f), (int)Math.Round(VBMath.Rnd() * 255f), (int)Math.Round(VBMath.Rnd() * 255f));
			}
			Title = "Random chart";
			SeriesLegend = array;
			SeriesColor = array2;
			ItemsLegend = new string[5] { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
			ValuesLocationStyle = STYLECAPTIONLOCATION.STYLECAPTIONLOCATION_INSIDE;
			Calculation = CALCULATION.CALCULATION_AVERAGE_SPLINE;
			CastShadows = true;
			ShadowSmooth = true;
			ShadowOffset = 5;
			ShowDataTable = false;
			ShowLegend = false;
			ValuesBackColor = Color.FromArgb(255, (int)Math.Round(VBMath.Rnd() * 64f + 190f), (int)Math.Round(VBMath.Rnd() * 64f + 190f), (int)Math.Round(VBMath.Rnd() * 64f + 190f));
			BackStyle = STYLEBACKGROUND.STYLEBACKGROUND_GRADIENT_TUBULAR;
			int num3 = (int)Math.Round(VBMath.Rnd() * 32f + 223f);
			int num4 = (int)Math.Round(VBMath.Rnd() * 32f + 223f);
			int num5 = (int)Math.Round(VBMath.Rnd() * 32f + 223f);
			BackColor = Color.FromArgb(255, num3, num4, num5);
			BorderColor = Color.FromArgb(128, (int)Math.Round((double)num3 * 0.5), (int)Math.Round((double)num4 * 0.5), (int)Math.Round((double)num5 * 0.5));
			TitleColor = Color.FromArgb(255, (int)Math.Round(VBMath.Rnd() * 64f), (int)Math.Round(VBMath.Rnd() * 64f), (int)Math.Round(VBMath.Rnd() * 64f));
			HotSpotsEnabled = true;
			m_blnAutoRefresh = blnAutoRefresh;
			RefreshChart();
		}
	}

	public void Animate()
	{
		if (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER)
		{
			Animate(0.1f);
		}
		else
		{
			Animate(2f);
		}
	}

	public void Animate(float stepping)
	{
		ValidateParameters();
		if (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER)
		{
			m_AnimateXYZ(stepping);
			return;
		}
		float num = VBMath.Rnd();
		if ((double)num <= 0.5)
		{
			m_AnimateOne(0f, 100f, STYLEANIMATION.STYLEANIMATION_RISE, stepping);
		}
		else
		{
			m_AnimateOne(0f, 100f, STYLEANIMATION.STYLEANIMATION_WAVE, stepping);
		}
	}

	internal void m_AnimateXYZ(float stepping)
	{
		float xYZ_YAngle = m_XYZ_YAngle;
		float limit = (float)((double)m_XYZ_YAngle + Math.PI * 2.0);
		for (float num = xYZ_YAngle; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num, limit, stepping); num += stepping)
		{
			m_XYZ_YAngle = num;
			m_RefreshGraph(blnForce: true);
			Application.DoEvents();
		}
	}

	public void Animate(STYLEANIMATION style, int stepping)
	{
		ValidateParameters();
		m_AnimateOne(0f, 100f, style, stepping);
	}

	private void m_AnimateOne(float intStart, float intEnd, STYLEANIMATION style, float intStep)
	{
		float sngSlantX = m_sngSlantX;
		float sngSlantY = m_sngSlantY;
		m_caption = null;
		m_blnAnimating = true;
		checked
		{
			ArrayList[] array = new ArrayList[Information.UBound(m_arrSeries) + 1];
			ArrayList[] array2 = new ArrayList[Information.UBound(m_arrSeriesAcum) + 1];
			int num = Information.UBound(m_arrSeries);
			for (int i = 0; i <= num; i++)
			{
				array[i] = new ArrayList();
				array2[i] = new ArrayList();
				int num2 = m_arrSeries[i].Count - 1;
				for (int j = 0; j <= num2; j++)
				{
					switch (m_lngStyle)
					{
					case STYLE2D3D.STYLE2D_HIGHLOW:
					case STYLE2D3D.STYLE2D_XY:
					case STYLE2D3D.STYLE2D_XY_SPLINE:
					case STYLE2D3D.STYLE2D_XY_LINE:
						array[i].Add(new double[2]
						{
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null))
						});
						continue;
					case STYLE2D3D.STYLE2D_HIGHLOWCLOSE:
					case STYLE2D3D.STYLE2D_BUBBLE:
					case STYLE2D3D.STYLE2D_XY_SPLINE_DEV:
						array[i].Add(new double[3]
						{
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 2 }, null))
						});
						continue;
					case STYLE2D3D.STYLE2D_CANDLESTICK:
						array[i].Add(new double[4]
						{
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 2 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 3 }, null))
						});
						continue;
					case STYLE2D3D.STYLE2D_GANTT:
						array[i].Add(new object[3]
						{
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null)),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 2 }, null))
						});
						continue;
					case STYLE2D3D.STYLE2D_GAUGE:
						array[i].Add(RuntimeHelpers.GetObjectValue(m_arrSeries[i][j]));
						continue;
					}
					if (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER)
					{
						array[i].Add(new double[3]
						{
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 2 }, null))
						});
					}
					else
					{
						array[i].Add(RuntimeHelpers.GetObjectValue(m_arrSeries[i][j]));
						array2[i].Add(RuntimeHelpers.GetObjectValue(m_arrSeriesAcum[i][j]));
					}
				}
			}
			try
			{
				switch (style)
				{
				case STYLEANIMATION.STYLEANIMATION_RISE:
				{
					for (float num9 = intStart; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num9, intEnd, intStep); num9 += intStep)
					{
						int num10 = m_arrSeries.Length - 1;
						for (int m = 0; m <= num10; m++)
						{
							int num11 = m_arrSeries[m].Count - 1;
							for (int n = 0; n <= num11; n++)
							{
								switch (m_lngStyle)
								{
								case STYLE2D3D.STYLE2D_HIGHLOWCLOSE:
								case STYLE2D3D.STYLE2D_BUBBLE:
								case STYLE2D3D.STYLE2D_XY_SPLINE_DEV:
									m_arrSeries[m][n] = new double[3]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										2,
										Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null))), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								case STYLE2D3D.STYLE2D_XY:
								case STYLE2D3D.STYLE2D_XY_SPLINE:
								case STYLE2D3D.STYLE2D_XY_LINE:
									m_arrSeries[m][n] = new double[2]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										0,
										Operators.AddObject(m_dblSeriesMiddleX, Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null), m_dblSeriesMiddleX)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										1,
										Operators.AddObject(m_dblSeriesMiddleY, Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null), m_dblSeriesMiddleY)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								case STYLE2D3D.STYLE2D_HIGHLOW:
									m_arrSeries[m][n] = new double[2]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										0,
										Operators.AddObject(m_dblSeriesMinY, Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null), m_dblSeriesMinY)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										1,
										Operators.AddObject(m_dblSeriesMinY, Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null), m_dblSeriesMinY)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								case STYLE2D3D.STYLE2D_CANDLESTICK:
									m_arrSeries[m][n] = new double[4]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 3 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										3,
										Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 3 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null))), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								case STYLE2D3D.STYLE2D_GANTT:
								{
									m_arrSeries[m][n] = new object[3]
									{
										RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)),
										RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)),
										RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null))
									};
									object instance3 = m_arrSeries[m][n];
									object[] array3 = new object[2] { 0, null };
									object[] array6 = array3;
									double num12 = m_XAxisMinDateTime.Ticks;
									DateTime dateTime = Conversions.ToDate(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null));
									DateTime dateTime2 = new DateTime((long)Math.Round(num12 + (double)(dateTime.Ticks - m_XAxisMinDateTime.Ticks) * ((double)num9 / 100.0)));
									array6[1] = dateTime2;
									NewLateBinding.LateIndexSetComplex(instance3, array3, null, OptimisticSet: false, RValueBase: true);
									object instance4 = m_arrSeries[m][n];
									array3 = new object[2] { 1, null };
									object[] array7 = array3;
									double num13 = m_XAxisMinDateTime.Ticks;
									dateTime2 = Conversions.ToDate(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null));
									dateTime = new DateTime((long)Math.Round(num13 + (double)(dateTime2.Ticks - m_XAxisMinDateTime.Ticks) * ((double)num9 / 100.0)));
									array7[1] = dateTime;
									NewLateBinding.LateIndexSetComplex(instance4, array3, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										2,
										Operators.DivideObject(Operators.MultiplyObject(num9, NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null)), 100)
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								}
								case STYLE2D3D.STYLE2D_GAUGE:
									m_arrSeries[m][n] = Operators.AddObject(GaugesScaleMinimum[m], Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(array[m][n], GaugesScaleMinimum[m])), 100));
									continue;
								}
								if (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER)
								{
									m_arrSeries[m][n] = new double[3]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										0,
										Operators.AddObject(m_dblSeriesMinX, Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null), m_dblSeriesMinX)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										1,
										Operators.AddObject(m_dblSeriesMinY, Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null), m_dblSeriesMinY)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[m][n], new object[2]
									{
										2,
										Operators.AddObject(m_dblSeriesMinZ, Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null), m_dblSeriesMinZ)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
								}
								else if (array[m][n] != null)
								{
									if (m_dblSeriesMinY >= 0.0)
									{
										m_arrSeries[m][n] = Operators.AddObject(m_dblSeriesMinY, Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(array[m][n], m_dblSeriesMinY)), 100));
										m_arrSeriesAcum[m][n] = Operators.AddObject(m_dblSeriesMinYAcum, Operators.DivideObject(Operators.MultiplyObject(num9, Operators.SubtractObject(array2[m][n], m_dblSeriesMinYAcum)), 100));
									}
									else
									{
										m_arrSeries[m][n] = Operators.DivideObject(Operators.MultiplyObject(num9, array[m][n]), 100);
										m_arrSeriesAcum[m][n] = Operators.DivideObject(Operators.MultiplyObject(num9, array2[m][n]), 100);
									}
								}
								else
								{
									m_arrSeries[m][n] = null;
									m_arrSeriesAcum[m][n] = null;
								}
							}
						}
						if ((m_lngStyle == STYLE2D3D.STYLE2D_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_POINT) | (m_lngStyle == STYLE2D3D.STYLE2D_PICTURES) | (m_lngStyle == STYLE2D3D.STYLE2D_PYRAMID) | (m_lngStyle == STYLE2D3D.STYLE2D_CYLINDER) | (m_lngStyle == STYLE2D3D.STYLE2D_ROUNDED_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_HORIZONTAL_BAR))
						{
							m_DoCalcAdditional();
						}
						m_RefreshGraph(blnForce: true);
						Application.DoEvents();
					}
					break;
				}
				case STYLEANIMATION.STYLEANIMATION_WAVE:
				{
					for (float num3 = intStart; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num3, intEnd, intStep); num3 += intStep)
					{
						float num4 = (float)m_lngNumX * num3 / 100f;
						int num5 = (int)Math.Round(Math.Floor(num4));
						int num6 = m_arrSeries[0].Count - 1;
						for (int k = 0; k <= num6; k++)
						{
							int num7 = ((k <= num5) ? ((k >= num5) ? ((int)Math.Round((double)(num4 - (float)num5) * 100.0)) : 100) : 0);
							int num8 = m_arrSeries.Length - 1;
							for (int l = 0; l <= num8; l++)
							{
								switch (m_lngStyle)
								{
								case STYLE2D3D.STYLE2D_HIGHLOWCLOSE:
								case STYLE2D3D.STYLE2D_BUBBLE:
								case STYLE2D3D.STYLE2D_XY_SPLINE_DEV:
									m_arrSeries[l][k] = new double[3]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										2,
										Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null))), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								case STYLE2D3D.STYLE2D_XY:
								case STYLE2D3D.STYLE2D_XY_SPLINE:
								case STYLE2D3D.STYLE2D_XY_LINE:
									m_arrSeries[l][k] = new double[2]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										0,
										Operators.AddObject(m_dblSeriesMiddleX, Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null), m_dblSeriesMiddleX)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										1,
										Operators.AddObject(m_dblSeriesMiddleY, Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null), m_dblSeriesMiddleY)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								case STYLE2D3D.STYLE2D_HIGHLOW:
									m_arrSeries[l][k] = new double[2]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										0,
										Operators.AddObject(m_dblSeriesMinY, Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null), m_dblSeriesMinY)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										1,
										Operators.AddObject(m_dblSeriesMinY, Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null), m_dblSeriesMinY)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								case STYLE2D3D.STYLE2D_CANDLESTICK:
									m_arrSeries[l][k] = new double[4]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 3 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										3,
										Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 3 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null))), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								case STYLE2D3D.STYLE2D_GANTT:
								{
									m_arrSeries[l][k] = new object[3]
									{
										RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)),
										RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)),
										RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null))
									};
									object instance = m_arrSeries[l][k];
									object[] array3 = new object[2] { 0, null };
									object[] array4 = array3;
									DateTime dateTime = new DateTime((long)Math.Round((double)m_XAxisMinDateTime.Ticks + (double)(Conversions.ToDate(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)).Ticks - m_XAxisMinDateTime.Ticks) * ((double)num7 / 100.0)));
									array4[1] = dateTime;
									NewLateBinding.LateIndexSetComplex(instance, array3, null, OptimisticSet: false, RValueBase: true);
									object instance2 = m_arrSeries[l][k];
									array3 = new object[2] { 1, null };
									object[] array5 = array3;
									dateTime = new DateTime((long)Math.Round((double)m_XAxisMinDateTime.Ticks + (double)(Conversions.ToDate(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)).Ticks - m_XAxisMinDateTime.Ticks) * ((double)num7 / 100.0)));
									array5[1] = dateTime;
									NewLateBinding.LateIndexSetComplex(instance2, array3, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										2,
										Operators.DivideObject(Operators.MultiplyObject(num7, NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null)), 100)
									}, null, OptimisticSet: false, RValueBase: true);
									continue;
								}
								case STYLE2D3D.STYLE2D_GAUGE:
									m_arrSeries[l][k] = Operators.DivideObject(Operators.MultiplyObject(num7, array[l][k]), 100);
									continue;
								}
								if (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER)
								{
									m_arrSeries[l][k] = new double[3]
									{
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)),
										Conversions.ToDouble(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null))
									};
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										0,
										Operators.AddObject(m_dblSeriesMinX, Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null), m_dblSeriesMinX)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										1,
										Operators.AddObject(m_dblSeriesMinY, Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null), m_dblSeriesMinY)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
									NewLateBinding.LateIndexSetComplex(m_arrSeries[l][k], new object[2]
									{
										2,
										Operators.AddObject(m_dblSeriesMinZ, Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null), m_dblSeriesMinZ)), 100))
									}, null, OptimisticSet: false, RValueBase: true);
								}
								else if (array[l][k] != null)
								{
									if (m_dblSeriesMinY >= 0.0)
									{
										m_arrSeries[l][k] = Operators.AddObject(m_dblSeriesMinY, Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(array[l][k], m_dblSeriesMinY)), 100));
										m_arrSeriesAcum[l][k] = Operators.AddObject(m_dblSeriesMinYAcum, Operators.DivideObject(Operators.MultiplyObject(num7, Operators.SubtractObject(array2[l][k], m_dblSeriesMinYAcum)), 100));
									}
									else
									{
										m_arrSeries[l][k] = Operators.DivideObject(Operators.MultiplyObject(num7, array[l][k]), 100);
										m_arrSeriesAcum[l][k] = Operators.DivideObject(Operators.MultiplyObject(num7, array2[l][k]), 100);
									}
								}
								else
								{
									m_arrSeries[l][k] = null;
									m_arrSeriesAcum[l][k] = null;
								}
							}
						}
						if ((m_lngStyle == STYLE2D3D.STYLE2D_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_POINT) | (m_lngStyle == STYLE2D3D.STYLE2D_PICTURES) | (m_lngStyle == STYLE2D3D.STYLE2D_PYRAMID) | (m_lngStyle == STYLE2D3D.STYLE2D_CYLINDER) | (m_lngStyle == STYLE2D3D.STYLE2D_ROUNDED_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_HORIZONTAL_BAR))
						{
							m_DoCalcAdditional();
						}
						m_RefreshGraph(blnForce: true);
						Application.DoEvents();
					}
					break;
				}
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
			m_arrSeries = array;
			m_arrSeriesAcum = array2;
			m_blnAnimating = false;
			m_RefreshGraph(blnForce: true);
		}
	}

	public void AnimateTo(STYLEANIMATION style, int stepping, ArrayList[] targetSeriesData)
	{
		ValidateParameters();
		m_AnimateTo(style, stepping, targetSeriesData);
	}

	private void m_AnimateTo(STYLEANIMATION style, float intStep, ArrayList[] targetSeriesData)
	{
		float sngSlantX = m_sngSlantX;
		float sngSlantY = m_sngSlantY;
		m_caption = null;
		m_blnAnimating = true;
		checked
		{
			ArrayList[] array = new ArrayList[Information.UBound(m_arrSeries) + 1];
			ArrayList[] array2 = new ArrayList[Information.UBound(m_arrSeriesAcum) + 1];
			int num = Information.UBound(m_arrSeries);
			for (int i = 0; i <= num; i++)
			{
				array[i] = new ArrayList();
				array2[i] = new ArrayList();
				int num2 = m_arrSeries[i].Count - 1;
				for (int j = 0; j <= num2; j++)
				{
					switch (m_lngStyle)
					{
					case STYLE2D3D.STYLE2D_HIGHLOW:
					case STYLE2D3D.STYLE2D_XY:
					case STYLE2D3D.STYLE2D_XY_SPLINE:
					case STYLE2D3D.STYLE2D_XY_LINE:
						array[i].Add(new double[2]
						{
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null))
						});
						continue;
					case STYLE2D3D.STYLE2D_HIGHLOWCLOSE:
					case STYLE2D3D.STYLE2D_BUBBLE:
					case STYLE2D3D.STYLE2D_XY_SPLINE_DEV:
						array[i].Add(new double[3]
						{
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 2 }, null))
						});
						continue;
					case STYLE2D3D.STYLE2D_CANDLESTICK:
						array[i].Add(new double[4]
						{
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 2 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 3 }, null))
						});
						continue;
					case STYLE2D3D.STYLE2D_GANTT:
						array[i].Add(new object[3]
						{
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null)),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 2 }, null))
						});
						continue;
					case STYLE2D3D.STYLE2D_GAUGE:
						array[i].Add(RuntimeHelpers.GetObjectValue(m_arrSeries[i][j]));
						continue;
					}
					if (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER)
					{
						array[i].Add(new double[3]
						{
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 0 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 1 }, null)),
							Conversions.ToDouble(NewLateBinding.LateIndexGet(m_arrSeries[i][j], new object[1] { 2 }, null))
						});
					}
					else
					{
						array[i].Add(RuntimeHelpers.GetObjectValue(m_arrSeries[i][j]));
						array2[i].Add(RuntimeHelpers.GetObjectValue(m_arrSeriesAcum[i][j]));
					}
				}
			}
			try
			{
				switch (style)
				{
				case STYLEANIMATION.STYLEANIMATION_RISE:
				{
					for (float num9 = 0f; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num9, 100f, intStep); num9 += intStep)
					{
						int num10 = m_arrSeries.Length - 1;
						for (int m = 0; m <= num10; m++)
						{
							int num11 = m_arrSeries[m].Count - 1;
							for (int n = 0; n <= num11; n++)
							{
								switch (m_lngStyle)
								{
								case STYLE2D3D.STYLE2D_HIGHLOWCLOSE:
								case STYLE2D3D.STYLE2D_BUBBLE:
								case STYLE2D3D.STYLE2D_XY_SPLINE_DEV:
									m_arrSeries[m][n] = new double[3]
									{
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 0 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)), num9), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 1 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)), num9), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null)), num9), 100)))
									};
									break;
								case STYLE2D3D.STYLE2D_HIGHLOW:
								case STYLE2D3D.STYLE2D_XY:
								case STYLE2D3D.STYLE2D_XY_SPLINE:
								case STYLE2D3D.STYLE2D_XY_LINE:
									m_arrSeries[m][n] = new double[2]
									{
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 0 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)), num9), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 1 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)), num9), 100)))
									};
									break;
								case STYLE2D3D.STYLE2D_CANDLESTICK:
									m_arrSeries[m][n] = new double[4]
									{
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 0 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)), num9), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 1 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)), num9), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null)), num9), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 3 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 3 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 3 }, null)), num9), 100)))
									};
									break;
								case STYLE2D3D.STYLE2D_GANTT:
								{
									ArrayList obj2 = m_arrSeries[m];
									int index2 = n;
									object[] array3 = new object[3];
									object[] array6 = array3;
									DateTime dateTime3 = new DateTime((long)Math.Round((float)Conversions.ToDate(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)).Ticks + (float)(Conversions.ToDate(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 0 }, null)).Ticks - Conversions.ToDate(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)).Ticks) * num9 / 100f));
									array6[0] = dateTime3;
									object[] array7 = array3;
									DateTime dateTime4 = new DateTime((long)Math.Round((float)Conversions.ToDate(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)).Ticks + (float)(Conversions.ToDate(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 1 }, null)).Ticks - Conversions.ToDate(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)).Ticks) * num9 / 100f));
									array7[1] = dateTime4;
									array3[2] = Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null)), num9), 100));
									obj2[index2] = array3;
									break;
								}
								default:
									if (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER)
									{
										m_arrSeries[m][n] = new double[3]
										{
											Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 0 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 0 }, null)), num9), 100))),
											Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 1 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 1 }, null)), num9), 100))),
											Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[m][n], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[m][n], new object[1] { 2 }, null)), num9), 100)))
										};
									}
									else if (array[m][n] != null)
									{
										m_arrSeries[m][n] = Operators.AddObject(array[m][n], Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(targetSeriesData[m][n], array[m][n]), num9), 100));
										m_arrSeriesAcum[m][n] = Operators.AddObject(array2[m][n], Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(targetSeriesData[m][n], array2[m][n]), num9), 100));
									}
									else
									{
										m_arrSeries[m][n] = null;
										m_arrSeriesAcum[m][n] = null;
									}
									break;
								}
							}
						}
						m_DoCalc();
						if ((m_lngStyle == STYLE2D3D.STYLE2D_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_POINT) | (m_lngStyle == STYLE2D3D.STYLE2D_PICTURES) | (m_lngStyle == STYLE2D3D.STYLE2D_PYRAMID) | (m_lngStyle == STYLE2D3D.STYLE2D_CYLINDER) | (m_lngStyle == STYLE2D3D.STYLE2D_ROUNDED_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_HORIZONTAL_BAR))
						{
							m_DoCalcAdditional();
						}
						m_RefreshGraph(blnForce: true);
						Application.DoEvents();
					}
					break;
				}
				case STYLEANIMATION.STYLEANIMATION_WAVE:
				{
					for (float num3 = 0f; ObjectFlowControl.ForLoopControl.ForNextCheckR4(num3, 100f, intStep); num3 += intStep)
					{
						float num4 = (float)m_lngNumX * num3 / 100f;
						int num5 = (int)Math.Round(Math.Floor(num4));
						int num6 = m_arrSeries[0].Count - 1;
						for (int k = 0; k <= num6; k++)
						{
							int num7 = ((k <= num5) ? ((k >= num5) ? ((int)Math.Round((double)(num4 - (float)num5) * 100.0)) : 100) : 0);
							int num8 = m_arrSeries.Length - 1;
							for (int l = 0; l <= num8; l++)
							{
								switch (m_lngStyle)
								{
								case STYLE2D3D.STYLE2D_HIGHLOWCLOSE:
								case STYLE2D3D.STYLE2D_BUBBLE:
								case STYLE2D3D.STYLE2D_XY_SPLINE_DEV:
									m_arrSeries[l][k] = new double[3]
									{
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 0 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)), num7), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 1 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)), num7), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null)), num7), 100)))
									};
									break;
								case STYLE2D3D.STYLE2D_HIGHLOW:
								case STYLE2D3D.STYLE2D_XY:
								case STYLE2D3D.STYLE2D_XY_SPLINE:
								case STYLE2D3D.STYLE2D_XY_LINE:
									m_arrSeries[l][k] = new double[2]
									{
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 0 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)), num7), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 1 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)), num7), 100)))
									};
									break;
								case STYLE2D3D.STYLE2D_CANDLESTICK:
									m_arrSeries[l][k] = new double[4]
									{
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 0 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)), num7), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 1 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)), num7), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null)), num7), 100))),
										Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 3 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 3 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 3 }, null)), num7), 100)))
									};
									break;
								case STYLE2D3D.STYLE2D_GANTT:
								{
									ArrayList obj = m_arrSeries[l];
									int index = k;
									object[] array3 = new object[3];
									object[] array4 = array3;
									DateTime dateTime = new DateTime((long)Math.Round((double)Conversions.ToDate(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)).Ticks + (double)((Conversions.ToDate(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 0 }, null)).Ticks - Conversions.ToDate(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)).Ticks) * num7) / 100.0));
									array4[0] = dateTime;
									object[] array5 = array3;
									DateTime dateTime2 = new DateTime((long)Math.Round((double)Conversions.ToDate(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)).Ticks + (double)((Conversions.ToDate(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 1 }, null)).Ticks - Conversions.ToDate(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)).Ticks) * num7) / 100.0));
									array5[1] = dateTime2;
									array3[2] = Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null)), num7), 100));
									obj[index] = array3;
									break;
								}
								default:
									if (m_lngStyle >= STYLE2D3D.STYLE3D_XYZ_SCATTER)
									{
										m_arrSeries[l][k] = new double[3]
										{
											Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 0 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 0 }, null)), num7), 100))),
											Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 1 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 1 }, null)), num7), 100))),
											Conversions.ToDouble(Operators.AddObject(NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null), Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(NewLateBinding.LateIndexGet(targetSeriesData[l][k], new object[1] { 2 }, null), NewLateBinding.LateIndexGet(array[l][k], new object[1] { 2 }, null)), num7), 100)))
										};
									}
									else if (array[l][k] != null)
									{
										m_arrSeries[l][k] = Operators.AddObject(array[l][k], Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(targetSeriesData[l][k], array[l][k]), num7), 100));
										m_arrSeriesAcum[l][k] = Operators.AddObject(array2[l][k], Operators.DivideObject(Operators.MultiplyObject(Operators.SubtractObject(targetSeriesData[l][k], array2[l][k]), num7), 100));
									}
									else
									{
										m_arrSeries[l][k] = null;
										m_arrSeriesAcum[l][k] = null;
									}
									break;
								}
							}
						}
						m_DoCalc();
						if ((m_lngStyle == STYLE2D3D.STYLE2D_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_POINT) | (m_lngStyle == STYLE2D3D.STYLE2D_PICTURES) | (m_lngStyle == STYLE2D3D.STYLE2D_PYRAMID) | (m_lngStyle == STYLE2D3D.STYLE2D_CYLINDER) | (m_lngStyle == STYLE2D3D.STYLE2D_ROUNDED_BAR) | (m_lngStyle == STYLE2D3D.STYLE2D_HORIZONTAL_BAR))
						{
							m_DoCalcAdditional();
						}
						m_RefreshGraph(blnForce: true);
						Application.DoEvents();
					}
					break;
				}
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
			Series = targetSeriesData;
			m_blnAnimating = false;
			m_RefreshGraph(blnForce: true);
		}
	}

	public SettingsFactory Settings()
	{
		return new SettingsFactory(this);
	}

	public void DataSourceReload()
	{
		if (!((m_DataSource == null) | (m_DataSourceMode == DATASOURCE_SCHEME.NONE)))
		{
			SeriesFactory seriesFactory = new SeriesFactory();
			seriesFactory.AddDataFromSource(m_DataSource, m_DataSourceMode);
			if (m_lngStyle == STYLE2D3D.STYLE3D_XYZ_SURFACE_TRIANGLE)
			{
				seriesFactory.GenerateMesh();
			}
			Series = seriesFactory.Series;
			m_DoCalc();
			m_RefreshGraph(blnForce: true);
			seriesFactory = null;
		}
	}

	private void DataSourceShowSelected()
	{
		if ((m_DataSource == null) | (m_DataSourceMode == DATASOURCE_SCHEME.NONE))
		{
			return;
		}
		checked
		{
			try
			{
				m_blnDataSourceUpdating = true;
				m_ItemsSelected = new ArrayList();
				int num = m_DataSource.Rows.Count - 1;
				for (int i = 0; i <= num; i++)
				{
					int num2 = m_DataSource.Columns.Count - 1;
					for (int j = 0; j <= num2; j++)
					{
						if (!m_DataSource.Rows[i].Cells[j].Selected)
						{
							continue;
						}
						foreach (ValueCaption item in (IEnumerable)m_vcc.ValueCaptions)
						{
							if ((item.seriesIndex == i) & (item.itemIndex == j))
							{
								m_ItemsSelected.Add(item);
							}
						}
					}
				}
				m_RefreshGraph(blnForce: true);
				Application.DoEvents();
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
			finally
			{
				m_blnDataSourceUpdating = false;
			}
		}
	}

	private void DataSourceUpdate(int serie, int index, object value)
	{
		if ((m_DataSource == null) | (m_DataSourceMode == DATASOURCE_SCHEME.NONE))
		{
			return;
		}
		try
		{
			m_blnDataSourceUpdating = true;
			DataGridView dataSource = m_DataSource;
			switch (m_DataSourceMode)
			{
			case DATASOURCE_SCHEME.XZ_HEADERS_Y_CELLS:
				dataSource.Rows[serie].Cells[index].Value = Conversion.Val(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(value, new object[1] { 1 }, null))).ToString(m_strValuesFormat);
				break;
			case DATASOURCE_SCHEME.CELL_VALUES:
				dataSource.Rows[serie].Cells[index].Value = Conversion.Val(RuntimeHelpers.GetObjectValue(value)).ToString(m_strValuesFormat);
				break;
			}
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			ProjectData.ClearProjectError();
		}
		finally
		{
			m_blnDataSourceUpdating = false;
		}
	}

	private void m_DataSource_CellValueChanged(object sender, DataGridViewCellEventArgs e)
	{
		Monitor.Enter(_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR_0024Init);
		try
		{
			if (_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR_0024Init.State == 0)
			{
				_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR_0024Init.State = 2;
				_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR = 0;
			}
			else if (_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR_0024Init.State == 2)
			{
				throw new IncompleteInitialization();
			}
		}
		finally
		{
			_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR_0024Init.State = 1;
			Monitor.Exit(_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR_0024Init);
		}
		Monitor.Enter(_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC_0024Init);
		try
		{
			if (_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC_0024Init.State == 0)
			{
				_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC_0024Init.State = 2;
				_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC = 0;
			}
			else if (_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC_0024Init.State == 2)
			{
				throw new IncompleteInitialization();
			}
		}
		finally
		{
			_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC_0024Init.State = 1;
			Monitor.Exit(_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC_0024Init);
		}
		Monitor.Enter(_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue_0024Init);
		try
		{
			if (_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue_0024Init.State == 0)
			{
				_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue_0024Init.State = 2;
				_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue = float.MinValue;
			}
			else if (_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue_0024Init.State == 2)
			{
				throw new IncompleteInitialization();
			}
		}
		finally
		{
			_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue_0024Init.State = 1;
			Monitor.Exit(_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue_0024Init);
		}
		try
		{
			if (m_blnDataSourceUpdating)
			{
				return;
			}
			bool flag;
			float num = default(float);
			if (m_DataSource.CurrentCell == null)
			{
				flag = true;
			}
			else
			{
				num = (Versioned.IsNumeric(RuntimeHelpers.GetObjectValue(m_DataSource.CurrentCell.Value)) ? Conversions.ToSingle(m_DataSource.CurrentCell.Value) : 0f);
				flag = Conversions.ToBoolean(Operators.OrObject(Operators.CompareObjectNotEqual(m_DataSource.CurrentCell.RowIndex, _0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR, TextCompare: false), Operators.CompareObjectNotEqual(m_DataSource.CurrentCell.ColumnIndex, _0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC, TextCompare: false)));
				if (!flag)
				{
					flag = num != _0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue;
				}
			}
			if (flag)
			{
				_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastR = m_DataSource.CurrentCell.RowIndex;
				_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastC = m_DataSource.CurrentCell.ColumnIndex;
				_0024STATIC_0024m_DataSource_CellValueChanged_002420211C1280B9_0024lastValue = num;
				DataSourceReload();
			}
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			ProjectData.ClearProjectError();
		}
	}

	private void m_DataSource_MouseClick(object sender, MouseEventArgs e)
	{
		if ((e.Button == MouseButtons.Right) & (m_DataSource != null) & (ContextMenu != null))
		{
			ContextMenu.Show(m_DataSource, e.Location);
		}
	}

	private void m_DataSource_SelectionChanged(object sender, EventArgs e)
	{
		Monitor.Enter(_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR_0024Init);
		try
		{
			if (_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR_0024Init.State == 0)
			{
				_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR_0024Init.State = 2;
				_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR = 0;
			}
			else if (_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR_0024Init.State == 2)
			{
				throw new IncompleteInitialization();
			}
		}
		finally
		{
			_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR_0024Init.State = 1;
			Monitor.Exit(_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR_0024Init);
		}
		Monitor.Enter(_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC_0024Init);
		try
		{
			if (_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC_0024Init.State == 0)
			{
				_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC_0024Init.State = 2;
				_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC = 0;
			}
			else if (_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC_0024Init.State == 2)
			{
				throw new IncompleteInitialization();
			}
		}
		finally
		{
			_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC_0024Init.State = 1;
			Monitor.Exit(_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC_0024Init);
		}
		try
		{
			if (!m_blnDataSourceUpdating && (m_DataSource.CurrentCell == null || Conversions.ToBoolean(Operators.OrObject(Operators.CompareObjectNotEqual(m_DataSource.CurrentCell.RowIndex, _0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR, TextCompare: false), Operators.CompareObjectNotEqual(m_DataSource.CurrentCell.ColumnIndex, _0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC, TextCompare: false)))))
			{
				_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastR = m_DataSource.CurrentCell.RowIndex;
				_0024STATIC_0024m_DataSource_SelectionChanged_002420211C126D_0024lastC = m_DataSource.CurrentCell.ColumnIndex;
				DataSourceShowSelected();
			}
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			ProjectData.ClearProjectError();
		}
	}

	private void m_ItemsSelected_MultiplyBy(float dx, float dy)
	{
		try
		{
			m_blnDataSourceUpdating = true;
			foreach (ValueCaption item in m_ItemsSelected)
			{
				int seriesIndex = item.seriesIndex;
				int itemIndex = item.itemIndex;
				if (Information.IsArray(RuntimeHelpers.GetObjectValue(m_arrSeries[seriesIndex][itemIndex])))
				{
					switch (m_lngStyle)
					{
					case STYLE2D3D.STYLE2D_BUBBLE:
					case STYLE2D3D.STYLE2D_XY_SPLINE_DEV:
						m_arrSeries[seriesIndex][itemIndex] = new object[3]
						{
							Operators.MultiplyObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null), dx),
							Operators.MultiplyObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 2 }, null))
						};
						break;
					case STYLE2D3D.STYLE2D_XY:
					case STYLE2D3D.STYLE2D_XY_SPLINE:
					case STYLE2D3D.STYLE2D_XY_LINE:
						m_arrSeries[seriesIndex][itemIndex] = new object[2]
						{
							Operators.MultiplyObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null), dx),
							Operators.MultiplyObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy)
						};
						break;
					case STYLE2D3D.STYLE3D_XYZ_MESH:
					case STYLE2D3D.STYLE3D_XYZ_SURFACE:
						m_arrSeries[seriesIndex][itemIndex] = new object[3]
						{
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null)),
							Operators.MultiplyObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 2 }, null))
						};
						break;
					case STYLE2D3D.STYLE2D_XY_DATETIME:
					case STYLE2D3D.STYLE2D_XY_LINE_DATETIME:
						m_arrSeries[seriesIndex][itemIndex] = new object[2]
						{
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null)),
							Operators.MultiplyObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy)
						};
						break;
					case STYLE2D3D.STYLE3D_XYZ_SCATTER:
					case STYLE2D3D.STYLE3D_XYZ_LINE:
						m_arrSeries[seriesIndex][itemIndex] = new object[3]
						{
							Operators.MultiplyObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null), dx),
							Operators.MultiplyObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 2 }, null))
						};
						break;
					}
				}
				else
				{
					ArrayList[] arrSeries = m_arrSeries;
					int num = seriesIndex;
					ArrayList obj = arrSeries[num];
					int index = itemIndex;
					obj[index] = Operators.MultiplyObject(arrSeries[num][index], dy);
				}
				DataSourceUpdate(seriesIndex, itemIndex, RuntimeHelpers.GetObjectValue(m_arrSeries[seriesIndex][itemIndex]));
			}
			m_caption = null;
			m_DoCalc();
			m_RefreshGraph(blnForce: true);
			Application.DoEvents();
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			ProjectData.ClearProjectError();
		}
		finally
		{
			m_blnDataSourceUpdating = false;
		}
	}

	private void m_ItemsSelected_Add(float dx, float dy)
	{
		try
		{
			m_blnDataSourceUpdating = true;
			foreach (ValueCaption item in m_ItemsSelected)
			{
				int seriesIndex = item.seriesIndex;
				int itemIndex = item.itemIndex;
				if (Information.IsArray(RuntimeHelpers.GetObjectValue(m_arrSeries[seriesIndex][itemIndex])))
				{
					switch (m_lngStyle)
					{
					case STYLE2D3D.STYLE2D_BUBBLE:
					case STYLE2D3D.STYLE2D_XY_SPLINE_DEV:
						m_arrSeries[seriesIndex][itemIndex] = new object[3]
						{
							Operators.SubtractObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null), dx),
							Operators.AddObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 2 }, null))
						};
						break;
					case STYLE2D3D.STYLE2D_XY:
					case STYLE2D3D.STYLE2D_XY_SPLINE:
					case STYLE2D3D.STYLE2D_XY_LINE:
						m_arrSeries[seriesIndex][itemIndex] = new object[2]
						{
							Operators.SubtractObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null), dx),
							Operators.AddObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy)
						};
						break;
					case STYLE2D3D.STYLE3D_XYZ_MESH:
					case STYLE2D3D.STYLE3D_XYZ_SURFACE:
						m_arrSeries[seriesIndex][itemIndex] = new object[3]
						{
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null)),
							Operators.AddObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 2 }, null))
						};
						break;
					case STYLE2D3D.STYLE2D_XY_DATETIME:
					case STYLE2D3D.STYLE2D_XY_LINE_DATETIME:
						m_arrSeries[seriesIndex][itemIndex] = new object[2]
						{
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null)),
							Operators.AddObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy)
						};
						break;
					case STYLE2D3D.STYLE3D_XYZ_SCATTER:
					case STYLE2D3D.STYLE3D_XYZ_LINE:
						m_arrSeries[seriesIndex][itemIndex] = new object[3]
						{
							Operators.SubtractObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 0 }, null), dx),
							Operators.AddObject(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 1 }, null), dy),
							RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(m_arrSeries[seriesIndex][itemIndex], new object[1] { 2 }, null))
						};
						break;
					}
				}
				else
				{
					ArrayList[] arrSeries = m_arrSeries;
					int num = seriesIndex;
					ArrayList obj = arrSeries[num];
					int index = itemIndex;
					obj[index] = Operators.AddObject(arrSeries[num][index], dy);
				}
				DataSourceUpdate(seriesIndex, itemIndex, RuntimeHelpers.GetObjectValue(m_arrSeries[seriesIndex][itemIndex]));
			}
			m_caption = null;
			m_DoCalc();
			m_RefreshGraph(blnForce: true);
			Application.DoEvents();
		}
		catch (Exception ex)
		{
			ProjectData.SetProjectError(ex);
			Exception ex2 = ex;
			ProjectData.ClearProjectError();
		}
		finally
		{
			m_blnDataSourceUpdating = false;
		}
	}
}
