上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:18k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
  4. Begin VB.Form XT_TxfxFrm 
  5.    Caption         =   "图形分析"
  6.    ClientHeight    =   7590
  7.    ClientLeft      =   315
  8.    ClientTop       =   495
  9.    ClientWidth     =   10875
  10.    Icon            =   "系统_图形分析窗体.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   7590
  13.    ScaleWidth      =   10875
  14.    StartUpPosition =   1  '所有者中心
  15.    Begin VB.CommandButton Command1 
  16.       Caption         =   "Command1"
  17.       Height          =   495
  18.       Left            =   2010
  19.       TabIndex        =   3
  20.       Top             =   930
  21.       Width           =   1065
  22.    End
  23.    Begin MSComctlLib.StatusBar StatusBar1 
  24.       Align           =   2  'Align Bottom
  25.       Height          =   405
  26.       Left            =   0
  27.       TabIndex        =   1
  28.       Top             =   7185
  29.       Width           =   10875
  30.       _ExtentX        =   19182
  31.       _ExtentY        =   714
  32.       _Version        =   393216
  33.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  34.          NumPanels       =   2
  35.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  36.             AutoSize        =   1
  37.             Object.Width           =   9313
  38.             Text            =   "图形类型:直方图"
  39.             TextSave        =   "图形类型:直方图"
  40.          EndProperty
  41.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  42.             AutoSize        =   1
  43.             Object.Width           =   9313
  44.             Text            =   "3D效果"
  45.             TextSave        =   "3D效果"
  46.          EndProperty
  47.       EndProperty
  48.    End
  49.    Begin MSComctlLib.ImageList ImageList1 
  50.       Left            =   8880
  51.       Top             =   30
  52.       _ExtentX        =   1005
  53.       _ExtentY        =   1005
  54.       BackColor       =   -2147483643
  55.       ImageWidth      =   16
  56.       ImageHeight     =   16
  57.       MaskColor       =   12632256
  58.       _Version        =   393216
  59.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  60.          NumListImages   =   20
  61.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  62.             Picture         =   "系统_图形分析窗体.frx":0442
  63.             Key             =   "area"
  64.          EndProperty
  65.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  66.             Picture         =   "系统_图形分析窗体.frx":2926
  67.             Key             =   "bar"
  68.          EndProperty
  69.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  70.             Picture         =   "系统_图形分析窗体.frx":4D56
  71.             Key             =   "line"
  72.          EndProperty
  73.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  74.             Picture         =   "系统_图形分析窗体.frx":7186
  75.             Key             =   "step"
  76.          EndProperty
  77.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  78.             Picture         =   "系统_图形分析窗体.frx":94EA
  79.             Key             =   "combination"
  80.          EndProperty
  81.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  82.             Picture         =   "系统_图形分析窗体.frx":B84E
  83.             Key             =   "pie"
  84.          EndProperty
  85.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  86.             Picture         =   "系统_图形分析窗体.frx":DD12
  87.             Key             =   "horzbar"
  88.          EndProperty
  89.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  90.             Picture         =   "系统_图形分析窗体.frx":10076
  91.             Key             =   "hilo"
  92.          EndProperty
  93.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  94.             Picture         =   "系统_图形分析窗体.frx":1262A
  95.             Key             =   "gantt"
  96.          EndProperty
  97.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  98.             Picture         =   "系统_图形分析窗体.frx":149A6
  99.             Key             =   "bubble"
  100.          EndProperty
  101.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  102.             Picture         =   "系统_图形分析窗体.frx":16DBE
  103.             Key             =   "contour"
  104.          EndProperty
  105.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  106.             Picture         =   "系统_图形分析窗体.frx":18D02
  107.             Key             =   "xy"
  108.          EndProperty
  109.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  110.             Picture         =   "系统_图形分析窗体.frx":1AE66
  111.             Key             =   "polar"
  112.          EndProperty
  113.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  114.             Picture         =   "系统_图形分析窗体.frx":1CCFA
  115.             Key             =   "radar"
  116.          EndProperty
  117.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  118.             Picture         =   "系统_图形分析窗体.frx":1EB8E
  119.             Key             =   "lt"
  120.          EndProperty
  121.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  122.             Picture         =   "系统_图形分析窗体.frx":1EFE6
  123.             Key             =   "bz"
  124.          EndProperty
  125.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  126.             Picture         =   "系统_图形分析窗体.frx":1F0FA
  127.             Key             =   "dyj1"
  128.          EndProperty
  129.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  130.             Picture         =   "系统_图形分析窗体.frx":1F776
  131.             Key             =   "dy"
  132.          EndProperty
  133.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  134.             Picture         =   "系统_图形分析窗体.frx":1F896
  135.             Key             =   "tc"
  136.          EndProperty
  137.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  138.             Picture         =   "系统_图形分析窗体.frx":1FBBA
  139.             Key             =   "bj"
  140.          EndProperty
  141.       EndProperty
  142.    End
  143.    Begin MSComctlLib.Toolbar Toolbar1 
  144.       Align           =   3  'Align Left
  145.       Height          =   6630
  146.       Left            =   0
  147.       TabIndex        =   0
  148.       Top             =   555
  149.       Width           =   420
  150.       _ExtentX        =   741
  151.       _ExtentY        =   11695
  152.       ButtonWidth     =   1138
  153.       ButtonHeight    =   582
  154.       Appearance      =   1
  155.       TextAlignment   =   1
  156.       ImageList       =   "ImageList1"
  157.       DisabledImageList=   "ImageList1"
  158.       HotImageList    =   "ImageList1"
  159.       _Version        =   393216
  160.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  161.          NumButtons      =   17
  162.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  163.             Key             =   "area"
  164.             ImageKey        =   "area"
  165.          EndProperty
  166.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  167.             Key             =   "bar"
  168.             ImageKey        =   "bar"
  169.          EndProperty
  170.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  171.             Key             =   "line"
  172.             ImageKey        =   "line"
  173.          EndProperty
  174.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  175.             Key             =   "step"
  176.             ImageKey        =   "step"
  177.          EndProperty
  178.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  179.             Style           =   3
  180.          EndProperty
  181.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  182.             Key             =   "combination"
  183.             ImageKey        =   "combination"
  184.          EndProperty
  185.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  186.             Key             =   "pie"
  187.             ImageKey        =   "pie"
  188.          EndProperty
  189.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  190.             Key             =   "horzbar"
  191.             ImageKey        =   "horzbar"
  192.          EndProperty
  193.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  194.             Key             =   "hilo"
  195.             ImageKey        =   "hilo"
  196.          EndProperty
  197.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  198.             Style           =   3
  199.          EndProperty
  200.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  201.             Key             =   "gantt"
  202.             ImageKey        =   "gantt"
  203.          EndProperty
  204.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  205.             Key             =   "bubble"
  206.             ImageKey        =   "bubble"
  207.          EndProperty
  208.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  209.             Key             =   "contour"
  210.             ImageKey        =   "contour"
  211.          EndProperty
  212.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  213.             Key             =   "xy"
  214.             ImageKey        =   "xy"
  215.          EndProperty
  216.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  217.             Style           =   3
  218.          EndProperty
  219.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  220.             Key             =   "polar"
  221.             ImageKey        =   "polar"
  222.          EndProperty
  223.          BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  224.             Key             =   "radar"
  225.             ImageKey        =   "radar"
  226.          EndProperty
  227.       EndProperty
  228.    End
  229.    Begin MSComctlLib.Toolbar Toolbar2 
  230.       Align           =   1  'Align Top
  231.       Height          =   555
  232.       Left            =   0
  233.       TabIndex        =   2
  234.       Top             =   0
  235.       Width           =   10875
  236.       _ExtentX        =   19182
  237.       _ExtentY        =   979
  238.       ButtonWidth     =   1138
  239.       ButtonHeight    =   926
  240.       Appearance      =   1
  241.       Style           =   1
  242.       ImageList       =   "ImageList1"
  243.       _Version        =   393216
  244.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  245.          NumButtons      =   6
  246.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  247.             Caption         =   "3D效果"
  248.             Key             =   "lt"
  249.             ImageKey        =   "lt"
  250.          EndProperty
  251.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  252.             Style           =   3
  253.          EndProperty
  254.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  255.             Caption         =   "打印"
  256.             Key             =   "dy"
  257.             ImageKey        =   "dy"
  258.          EndProperty
  259.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  260.             Style           =   3
  261.          EndProperty
  262.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  263.             Caption         =   "帮助"
  264.             Key             =   "bz"
  265.             ImageKey        =   "bz"
  266.          EndProperty
  267.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  268.             Caption         =   "退出"
  269.             Key             =   "tc"
  270.             ImageKey        =   "tc"
  271.          EndProperty
  272.       EndProperty
  273.       BorderStyle     =   1
  274.       Begin MSComDlg.CommonDialog CommonDialog1 
  275.          Left            =   8310
  276.          Top             =   90
  277.          _ExtentX        =   847
  278.          _ExtentY        =   847
  279.          _Version        =   393216
  280.       End
  281.    End
  282. End
  283. Attribute VB_Name = "XT_TxfxFrm"
  284. Attribute VB_GlobalNameSpace = False
  285. Attribute VB_Creatable = False
  286. Attribute VB_PredeclaredId = True
  287. Attribute VB_Exposed = False
  288. Dim Tx3d As Boolean                   '图形3D设置
  289. Dim Dqtxlx As String                  '当前分析图类型
  290. Private Sub Command1_Click()
  291.     
  292.     With Txfxchart.Aspect
  293.         If .View3D = True Then
  294.             .Zoom = 100
  295.             .Rotation = 345
  296.             .Elevation = 345
  297.             .HorizOffset = 0
  298.             .VertOffset = 0
  299.             .Perspective = 15
  300.             .Orthogonal = True
  301.             .Chart3DPercent = 15
  302.         End If
  303.     End With
  304. End Sub
  305. Private Sub Command2_Click()
  306. End Sub
  307. Private Sub Form_Load()
  308.     
  309.     TeeCommander1.Chart = Txfxchart
  310.     Tx3d = False
  311.     Dqtxlx = "bar"
  312.     'Call Xzsctxlx(Dqtxlx)
  313.    
  314.     StatusBar1.Panels(1).Text = "图形类型:" + Dqtxlx
  315.     StatusBar1.Panels(2).Text = "二维效果"
  316.   
  317. End Sub
  318. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)           '选择分析图类型
  319.    
  320.     Call Xzsctxlx(Button.Key)
  321.     Dqtxlx = Button.Key
  322. End Sub
  323. Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button)           '菜 单 选 项
  324.     Select Case Button.Key
  325.         Case "lt"                               '视觉效果
  326.             If Tx3d Then
  327.                 Tx3d = False
  328.                 Txfxchart.Aspect.View3D = False
  329.                 Button.Caption = "3D效果"
  330.                 StatusBar1.Panels(2).Text = "二维效果"
  331.                 With Toolbar1.Buttons
  332.                     .Item("bubble").Enabled = True
  333.                     .Item("contour").Enabled = True
  334.                     .Item("xy").Enabled = True
  335.                     .Item("polar").Enabled = True
  336.                     .Item("radar").Enabled = True
  337.                 End With
  338.             Else
  339.                 Tx3d = True
  340.                 Button.Caption = "2D效果"
  341.                 Txfxchart.Aspect.View3D = True
  342.                 StatusBar1.Panels(2).Text = "三维效果"
  343.                 With Toolbar1.Buttons
  344.                     .Item("bubble").Enabled = False
  345.                     .Item("contour").Enabled = False
  346.                     .Item("xy").Enabled = False
  347.                     .Item("polar").Enabled = False
  348.                     .Item("radar").Enabled = False
  349.                 End With
  350.             End If
  351.             ' Call Xzsctxlx(Dqtxlx)
  352.         Case "dy"                                    '打 印
  353.             With Txfxchart
  354.                 CommonDialog1.CancelError = True
  355.                 
  356.                 On Error GoTo Cwcl2:
  357.                 
  358.                 CommonDialog1.ShowPrinter
  359.                 .PrintInformation.Orientation = VtPrintOrientationLandscape '横向打印
  360.                 .PrintInformation.PrintCopies (CommonDialog1.Copies)
  361.             End With
  362. Cwcl2:
  363.             Exit Sub
  364.         Case "tc"
  365.             Unload Me
  366.     End Select
  367. End Sub
  368. Private Sub Xzsctxlx(Txlx As String)                           '选择分析图类型
  369.     
  370.     Dim i As Integer
  371.     With Txfxchart
  372.         'If Not Tx3d Then
  373.             'Select Case Txlx
  374.                 'Case "area"
  375.                     '.charttype = VtChChartType2dArea
  376.                 'Case "bar"
  377.                     '.charttype = VtChChartType2dBar
  378.                 'Case "line"
  379.                     '.charttype = VtChChartType2dLine
  380.                 'Case "step"
  381.                     '.charttype = VtChChartType2dStep
  382.                 'Case "combination"
  383.                     '.charttype = VtChChartType2dCombination
  384.                 'Case "pie"
  385.                     '.charttype = VtChChartType2dPie
  386.                 'Case "horzbar"
  387.                     '.charttype = VtChChartType2dHorizontalBar
  388.                 'Case "hilo"
  389.                     '.charttype = VtChChartType2dHiLo
  390.                 'Case "gantt"
  391.                     '.charttype = VtChChartType2dGantt
  392.                 'Case "bubble"
  393.                     '.charttype = VtChChartType2dBubble
  394.                 'Case "contour"
  395.                     '.charttype = VtChChartType2dContour
  396.                 'Case "xy"
  397.                     '.charttype = VtChChartType2dXY
  398.                 'Case "polar"
  399.                     '.charttype = VtChChartType2dPolar
  400.                 'Case "radar"
  401.                     '.charttype = VtChChartType2dRadar
  402.             'End Select
  403.         'Else
  404.             Select Case Txlx
  405.                 Case "area"
  406.                     For i = 0 To .SeriesCount - 1
  407.                         .ChangeSeriesType i, scArea
  408.                     Next i
  409.                 Case "bar"
  410.                     For i = 0 To .SeriesCount - 1
  411.                         .ChangeSeriesType i, scBar
  412.                     Next i
  413.                 Case "line"
  414.                     For i = 0 To .SeriesCount - 1
  415.                         .ChangeSeriesType i, scLine
  416.                     Next i
  417.                 Case "step"
  418.                     'For i = 0 To .SeriesCount - 1
  419.                         '.ChangeSeriesType i, scShape
  420.                     'Next i
  421.                 Case "combination"
  422.                     'For i = 0 To .SeriesCount - 1
  423.                     '   .ChangeSeriesType i, scContour
  424.                     'Next i
  425.                 Case "pie"
  426.                     For i = 0 To .SeriesCount - 1
  427.                         .ChangeSeriesType i, scPie
  428.                     Next i
  429.                 Case "horzbar"
  430.                     For i = 0 To .SeriesCount - 1
  431.                         .ChangeSeriesType i, scHorizBar
  432.                     Next i
  433.                 Case "hilo"
  434.                     For i = 0 To .SeriesCount - 1
  435.                         .ChangeSeriesType i, scPoint
  436.                     Next i
  437.                 Case "gantt"
  438.                     For i = 0 To .SeriesCount - 1
  439.                         .ChangeSeriesType i, scFastLine
  440.                     Next i
  441.             End Select
  442.         'End If
  443.         'StatusBar1.Panels(1).Text = "图形类型:" + Dqtxlx
  444.     End With
  445. End Sub
  446. Private Sub Txfxchart_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)
  447.     
  448.     With Txfxchart
  449.         If .Series(SeriesIndex).SeriesType = scPie Then
  450.             Select Case SeriesIndex
  451.                 Case 0: .ChartRect 0, 0, .Canvas.Width * 6 / 16, .Canvas.Height / 2
  452.                 Case 1: .ChartRect .Canvas.Width * 5 / 16, 0, .Canvas.Width * 11 / 16, .Canvas.Height / 2
  453.                 Case 2: .ChartRect 0, .Canvas.Height / 2, .Canvas.Width * 6 / 16, .Canvas.Height
  454.                 Case 3: .ChartRect .Canvas.Width * 5 / 16, .Canvas.Height / 2, .Canvas.Width * 11 / 16, .Canvas.Height
  455.                 Case 4: .ChartRect .Canvas.Width * 9 / 16, .Canvas.Height / 5, .Canvas.Width, .Canvas.Height * 4 / 5
  456.             End Select
  457.         End If
  458.     End With
  459. End Sub