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

企业管理

开发平台:

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