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