⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graph.cs

📁 C#自定义查询控件
💻 CS
📖 第 1 页 / 共 5 页
字号:
		/// <summary>
		/// 
		/// </summary>
		public float BottomSpacing
		{
			get{return this.m_fBottomSpacing;}
			set{this.m_fBottomSpacing = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public float IslandSpacing
		{
			get{return this.m_fIslandSpacing;}
			set{this.m_fIslandSpacing = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		internal float LeftOverHeight
		{
			get{return this.m_fLeftOverHeight;}
			set{this.m_fLeftOverHeight = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		internal float LeftOverWidth
		{
			get{return this.m_fLeftOverWidth;}
			set{this.m_fLeftOverWidth = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public BackgroundType Background
		{
			get{return this.m_BackgroundType;}
			set{this.m_BackgroundType = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public string BackgroundImage
		{
			get{return this.m_strBgImagePath;}
			set{this.m_strBgImagePath = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public short BackgroundGradientFactor
		{
			get{return this.m_sBgGradientFactor;}
			set{this.m_sBgGradientFactor = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public short GraphGradientFactor
		{
			get{return this.m_sGraphGradientFactor;}
			set{this.m_sGraphGradientFactor = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public LGradientType LinearGradientType
		{
			get{return this.m_LGradientType;}
			set{this.m_LGradientType = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public CGradientType CircularGradientType
		{
			get{return this.m_CGradientType;}
			set{this.m_CGradientType = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public HatchType BackgroundHatchType
		{
			get{return this.m_HatchType;}
			set{this.m_HatchType = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public LegendLocationType LegendLocation
		{
			get{return this.m_LegendLocation;}
			set{this.m_LegendLocation = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public LegendAlignmentType LegendAlignment
		{
			get{return this.m_LegendAlignment;}
			set{this.m_LegendAlignment = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public PositionType LegendPosition
		{
			get{return this.m_LegendPosition;}
			set{this.m_LegendPosition = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public string Title
		{
			get{return this.m_strTitle;}
			set{this.m_strTitle = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public bool HasCompanyLogo
		{
			get{return m_bDrawLogo;}
			set{m_bDrawLogo = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public string LogoImageFile
		{
			get{return m_strLogoImageFile;}
			set{m_strLogoImageFile = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public PositionType LogoPosition
		{
			get{return m_LogoPosition;}
			set{m_LogoPosition = value;}
		}

		public bool UseGradientColors
		{
			get{return this.m_bUseGradientColors;}
			set{this.m_bUseGradientColors = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public short SubGridLines
		{
			get{return this.m_sSubGridLines;}
			set{this.m_sSubGridLines = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public bool HasLegends
		{
			get{return this.m_bHasLegends;}
			set{this.m_bHasLegends = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public bool HasBorder
		{
			get{return this.m_bHasBorder;}
			set{this.m_bHasBorder = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public bool HasTickers
		{
			get{return this.m_bHasTickers;}
			set{this.m_bHasTickers = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public bool DrawIslandLegend
		{
			get{return m_bDrawIslandLegend;}
			set{m_bDrawIslandLegend = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public int Width
		{
			get{return this.m_iWidth;}
			set{this.m_iWidth = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public int Height
		{
			get{return this.m_iHeight;}
			set{this.m_iHeight = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public double TitlePaddingFromTop
		{
			get{return this.m_dTitlePaddingFromTop;}
			set{this.m_dTitlePaddingFromTop = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public Font TitleFont
		{
			get{return this.m_TitleFont;}
			set{this.m_TitleFont = (Font)value.Clone();}
		}

		/// <summary>
		/// 
		/// </summary>
		public Font XAxisLabelFont
		{
			get{return this.m_XAxisLabelFont;}
			set{this.m_XAxisLabelFont = (Font)value.Clone();}
		}

		/// <summary>
		/// 
		/// </summary>
		public Font YAxisLabelFont
		{
			get{return this.m_YAxisLabelFont;}
			set{this.m_YAxisLabelFont = (Font)value.Clone();}
		}

		/// <summary>
		/// 
		/// </summary>
		public Font XTickFont
		{
			get{return this.m_XTickFont;}
			set{this.m_XTickFont = (Font)value.Clone();}
		}

		/// <summary>
		/// 
		/// </summary>
		public int TickStep
		{
			get{return this.m_iTickStep;}
			set{this.m_iTickStep = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public Font YTickFont
		{
			get{return this.m_YTickFont;}
			set{this.m_YTickFont = (Font)value.Clone();}
		}

		/// <summary>
		/// 
		/// </summary>
		public Font LegendFont
		{
			get{return this.m_LegendFont;}
			set{this.m_LegendFont = (Font)value.Clone();}
		}
		
		/// <summary>
		/// 
		/// </summary>
		public Color BackgroundColor
		{
			get{return this.m_BgColor;}
			set{this.m_BgColor = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public Color GridColor
		{
			get{return this.m_GridColor;}
			set{this.m_GridColor = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public Color SubGridColor
		{
			get{return this.m_SubGridColor;}
			set{this.m_SubGridColor = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public Color HatchColor
		{
			get{return this.m_HatchColor;}
			set{this.m_HatchColor = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public Color TitleColor
		{
			get{return this.m_TitleColor;}
			set{this.m_TitleColor = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		public Font IslandLegendFont
		{
			get{return this.m_IslandLegendFont;}
			set{this.m_IslandLegendFont = (Font)((Font)value).Clone();}
		}

		/// <summary>
		/// 
		/// </summary>
		internal float MinXDataValue
		{
			get{return this.m_fMinXDataValue;}
			set{this.m_fMinXDataValue = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		internal float MaxXDataValue
		{
			get{return this.m_fMaxXDataValue;}
			set{this.m_fMinXDataValue = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		internal float MinYDataValue
		{
			get{return this.m_fMinYDataValue;}
			set{this.m_fMinYDataValue = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		internal float MaxYDataValue
		{
			get{return this.m_fMaxYDataValue;}
			set{this.m_fMaxYDataValue = value;}
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="obXmlData"></param>
		/// <returns></returns>
		public bool SetGraphData(XmlDocument obXmlData)
		{
			//TODO: Implement cloning of XmlDocument information to local variable.
			XmlNode node;
			try
			{
				node = obXmlData.CloneNode(true);
				if (node is XmlDocument)
				{
					this.m_obGraphData = (XmlDocument)node;
				}
			}
			catch (Exception ex)
			{
				Trace.WriteLine(ex.Message);
				throw ex;
			}
			return true;
		}
		
		public bool SetGraphData(DataSet dsData)
		{
			//TODO: Implement cloning of XmlDocument information to local variable.
			
			if(dsData==null||dsData.Tables.Count==0)
				return false;

			XmlDocument obXmlData = (XmlDocument)new XmlDataDocument(dsData);
		    return SetGraphData(obXmlData);
		}


		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		protected bool CreateGraphics()
		{
			try
			{
				this.m_obBitmap = new Bitmap(this.m_iWidth, this.m_iHeight);
				this.m_obGraphics = Graphics.FromImage(this.m_obBitmap);
				this.m_obGraphics.SmoothingMode = SmoothingMode.HighQuality;
				this.m_obGraphics.CompositingMode = CompositingMode.SourceCopy;
			}
			catch (Exception ex)
			{
				Trace.WriteLine(ex.Message);
				throw ex;
			}
			return true;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		protected bool SetBackgroundColor()
		{
			try
			{
				this.m_obGraphics.FillRectangle(new SolidBrush(this.m_BgColor),
					0, 0, this.m_iWidth, this.m_iHeight);
			}
			catch (Exception ex)
			{
				Trace.WriteLine(ex.Message);
				return false;
			}
			return true;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		virtual protected bool ProcessChartData()
		{
			return false;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -