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

📄 xchart.vb

📁 chart图片,统计,网上下来的源代码
💻 VB
📖 第 1 页 / 共 5 页
字号:
		Set(ByVal Value As System.Drawing.Color)
			If System.Drawing.ColorTranslator.ToOle(Value) <> uChartSubTitleColor Then
				uChartSubTitleColor = System.Drawing.ColorTranslator.ToOle(Value)
				DrawChart()
				RaiseEvent ChartSubTitleColorChange()
			End If
		End Set
	End Property
	
	Public Property BarColor() As System.Drawing.Color
		Get
			BarColor = System.Drawing.ColorTranslator.FromOle(uBarColor)
		End Get
		Set(ByVal Value As System.Drawing.Color)
			If System.Drawing.ColorTranslator.ToOle(Value) <> uBarColor Then
				uBarColor = System.Drawing.ColorTranslator.ToOle(Value)
				DrawChart()
				RaiseEvent BarColorChange()
			End If
		End Set
	End Property
	
	Public Property InfoBackColor() As System.Drawing.Color
		Get
			InfoBackColor = System.Drawing.ColorTranslator.FromOle(uInfoBackColor)
		End Get
		Set(ByVal Value As System.Drawing.Color)
			If System.Drawing.ColorTranslator.ToOle(Value) <> uInfoBackColor Then
				uInfoBackColor = System.Drawing.ColorTranslator.ToOle(Value)
				DrawChart()
				RaiseEvent InfoBackColorChange()
			End If
		End Set
	End Property
	
	Public Property InfoForeColor() As System.Drawing.Color
		Get
			InfoForeColor = System.Drawing.ColorTranslator.FromOle(uInfoForeColor)
		End Get
		Set(ByVal Value As System.Drawing.Color)
			If System.Drawing.ColorTranslator.ToOle(Value) <> uInfoForeColor Then
				uInfoForeColor = System.Drawing.ColorTranslator.ToOle(Value)
				DrawChart()
				RaiseEvent InfoForeColorChange()
			End If
		End Set
	End Property
	
	
	Public Property SelectedBarColor() As System.Drawing.Color
		Get
			SelectedBarColor = System.Drawing.ColorTranslator.FromOle(uSelectedBarColor)
		End Get
		Set(ByVal Value As System.Drawing.Color)
			If System.Drawing.ColorTranslator.ToOle(Value) <> uSelectedBarColor Then
				uSelectedBarColor = System.Drawing.ColorTranslator.ToOle(Value)
				RaiseEvent SelectedBarColorChange()
			End If
		End Set
	End Property
	
	
	
	Public Property LineColor() As System.Drawing.Color
		Get
			LineColor = System.Drawing.ColorTranslator.FromOle(uLineColor)
		End Get
		Set(ByVal Value As System.Drawing.Color)
			If System.Drawing.ColorTranslator.ToOle(Value) <> uLineColor Then
				uLineColor = System.Drawing.ColorTranslator.ToOle(Value)
				DrawChart()
				RaiseEvent LineColorChange()
			End If
		End Set
	End Property
	
	
	
	Private Sub FixData() '2222
		
		If uMinYValue < 0 And uMaxYValue < 0 Then
			uDataType = DT_NEG
			uRangeY = (System.Math.Abs(uMinYValue) - System.Math.Abs(uMaxYValue))
		ElseIf uMinYValue >= 0 And uMaxYValue >= 0 Then 
			uDataType = DT_POS
			uRangeY = (System.Math.Abs(uMaxYValue) - System.Math.Abs(uMinYValue))
		Else
			uDataType = DT_BOTH
			uRangeY = (System.Math.Abs(uMaxYValue) + System.Math.Abs(uMinYValue))
		End If
		
		If uRangeY = 0 Then uRangeY = 1
		If uIntersectMajor = 0 Then uIntersectMajor = uRangeY / 10
		If uIntersectMinor = 0 Then uIntersectMinor = uIntersectMajor / 5
		
	End Sub
	
	
	
	Private Sub FixCustomMenu() '55555555555555
		
		On Error Resume Next
		
		Dim ctl As System.Windows.Forms.Control
		Dim intIdx As Short
		Dim stgItem As String
		Dim varItems As Object
		Dim intItemCnt As Short
		
		For	Each ctl In mnuMainCustomItems
			ctl.Visible = False
		Next ctl
		'UPGRADE_WARNING: IsEmpty 已升级到 IsNothing 并具有新行为。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"”
		If Not IsNothing(Trim(uCustomMenuItems)) Then
			'UPGRADE_WARNING: 未能解析对象 varItems 的默认属性。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"”
			varItems = Split(uCustomMenuItems, "|")
			intItemCnt = 0
			For intIdx = 0 To UBound(varItems)
				'UPGRADE_WARNING: 未能解析对象 varItems() 的默认属性。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"”
				stgItem = Trim(CStr(varItems(intIdx)))
				'UPGRADE_WARNING: IsEmpty 已升级到 IsNothing 并具有新行为。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"”
				If Not IsNothing(stgItem) Then
					If intItemCnt > 7 Then Exit For
					mnuMainCustomItems(intItemCnt).Text = stgItem
					mnuMainCustomItems(intItemCnt).Visible = True
					intItemCnt = intItemCnt + 1
				End If
			Next 
		End If
		mnuMainCustomItemsSeparator.Visible = (mnuMainCustomItems(0).Visible)
		
	End Sub
	
	
	Private Function InColumn(ByRef X As Single, ByRef Y As Single) As Short '655525
		
		Dim sngY As Single
		Dim sngY1 As Single
		Dim sngY2 As Single
		Dim intCol As Short
		Dim intSelectedCol As Short
		
		intSelectedCol = -1
		If (uChartType And XC_BAR) = XC_BAR Or (uChartType And XC_OVAL) = XC_OVAL Or (uChartType And XC_RHOMBUS) = XC_RHOMBUS Or (uChartType And XC_TRAPEZIUM) = XC_TRAPEZIUM Or (uChartType And XC_TRIANGLE) = XC_TRIANGLE Then
			If (Y <= VB6.PixelsToTwipsY(MyBase.ClientRectangle.Height) - uBottomMargin) And (Y >= uTopMargin) And (uSelectable = True) Then
				intCol = (X - uLeftMargin) \ (uColWidth)
				sngY1 = uColumns(intCol, 0)
				sngY2 = uColumns(intCol, 1)
				If sngY1 > sngY2 Then
					sngY = sngY1
					sngY1 = sngY2
					sngY2 = sngY
				End If
				If (Y >= sngY1 And Y <= sngY2) Then
					intSelectedCol = intCol
				End If
			End If
		End If
		InColumn = intSelectedCol
		
	End Function
	
	
	
	
	Private Sub UserControl_Initialize() '1
		cItems = New Collection
	End Sub
	Private Sub XChart_MouseDown(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
		Dim Button As Short = eventArgs.Button \ &H100000
		Dim Shift As Short = System.Windows.Forms.Control.ModifierKeys \ &H10000
		Dim X As Single = VB6.PixelsToTwipsX(eventArgs.X)
		Dim Y As Single = VB6.PixelsToTwipsY(eventArgs.Y) '56555565
		
		Dim oItem As ChartItem
		Dim intSelectedCol As Short
		
		If Button = VB6.MouseButtonConstants.LeftButton Then
			
			On Error GoTo TrackExit
			
			intSelectedCol = InColumn(X, Y)
			If intSelectedCol >= 0 Then
				If Not bProcessingOver Then
					bProcessingOver = True
					uSelectedColumn = intSelectedCol
					If Not uSelectedColumn = uOldSelection Then
						DrawChart()
						uOldSelection = uSelectedColumn
						If (uMeanOn = True) And (uSelectedColumn = cItems.Count() - 1) Then
						Else
							'UPGRADE_WARNING: 未能解析对象 cItems() 的默认属性。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"”
							'UPGRADE_WARNING: 未能解析对象 oItem 的默认属性。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"”
							oItem = cItems.Item(uSelectedColumn + 1)
							RaiseEvent ItemClick(Me, New ItemClickEventArgs(oItem))
						End If
					End If
					bProcessingOver = False
				End If
			End If
		ElseIf Button = VB6.MouseButtonConstants.RightButton Then 
			
		End If
		RaiseEvent MouseDown(Me, New MouseDownEventArgs(Button, Shift, X, Y))
		
TrackExit: 
		Exit Sub
		
	End Sub
	
	Private Sub XChart_MouseMove(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
		Dim Button As Short = eventArgs.Button \ &H100000
		Dim Shift As Short = System.Windows.Forms.Control.ModifierKeys \ &H10000
		Dim X As Single = VB6.PixelsToTwipsX(eventArgs.X)
		Dim Y As Single = VB6.PixelsToTwipsY(eventArgs.Y) '3533232
		
		If (uHotTracking = True) Or (Button = VB6.MouseButtonConstants.LeftButton) Then
			Call XChart_MouseDown(Me, New System.Windows.Forms.MouseEventArgs(VB6.MouseButtonConstants.LeftButton * &H100000, 0, VB6.TwipsToPixelsX(X), VB6.TwipsToPixelsY(Y), 0))
		End If
		
	End Sub
	
	
	
	Public Sub Clear() '5
		'UPGRADE_NOTE: 在对对象 cItems 进行垃圾回收前,不可以将其销毁。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"”
		cItems = Nothing

⌨️ 快捷键说明

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