上传用户: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. Object = "{008BBE7B-C096-11D0-B4E3-00A0C901D681}#1.0#0"; "teechart.ocx"
  5. Begin VB.Form XT_TxfxFrm 
  6.    Caption         =   "图形分析"
  7.    ClientHeight    =   7590
  8.    ClientLeft      =   1890
  9.    ClientTop       =   1245
  10.    ClientWidth     =   10875
  11.    Icon            =   "系统_图形分析窗体.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   7590
  14.    ScaleWidth      =   10875
  15.    Begin TeeChart.TChart Txfxchart 
  16.       Height          =   6540
  17.       Left            =   450
  18.       OleObjectBlob   =   "系统_图形分析窗体.frx":1042
  19.       TabIndex        =   6
  20.       Top             =   600
  21.       Width           =   10365
  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":10F4
  71.             Key             =   "area"
  72.          EndProperty
  73.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  74.             Picture         =   "系统_图形分析窗体.frx":35D8
  75.             Key             =   "bar"
  76.          EndProperty
  77.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  78.             Picture         =   "系统_图形分析窗体.frx":5A08
  79.             Key             =   "line"
  80.          EndProperty
  81.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  82.             Picture         =   "系统_图形分析窗体.frx":7E38
  83.             Key             =   "step"
  84.          EndProperty
  85.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  86.             Picture         =   "系统_图形分析窗体.frx":A19C
  87.             Key             =   "combination"
  88.          EndProperty
  89.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  90.             Picture         =   "系统_图形分析窗体.frx":C500
  91.             Key             =   "pie"
  92.          EndProperty
  93.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  94.             Picture         =   "系统_图形分析窗体.frx":E9C4
  95.             Key             =   "horzbar"
  96.          EndProperty
  97.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  98.             Picture         =   "系统_图形分析窗体.frx":10D28
  99.             Key             =   "hilo"
  100.          EndProperty
  101.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  102.             Picture         =   "系统_图形分析窗体.frx":132DC
  103.             Key             =   "gantt"
  104.          EndProperty
  105.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  106.             Picture         =   "系统_图形分析窗体.frx":15658
  107.             Key             =   "bubble"
  108.          EndProperty
  109.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  110.             Picture         =   "系统_图形分析窗体.frx":17A70
  111.             Key             =   "contour"
  112.          EndProperty
  113.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  114.             Picture         =   "系统_图形分析窗体.frx":199B4
  115.             Key             =   "xy"
  116.          EndProperty
  117.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  118.             Picture         =   "系统_图形分析窗体.frx":1BB18
  119.             Key             =   "polar"
  120.          EndProperty
  121.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  122.             Picture         =   "系统_图形分析窗体.frx":1D9AC
  123.             Key             =   "radar"
  124.          EndProperty
  125.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  126.             Picture         =   "系统_图形分析窗体.frx":1F840
  127.             Key             =   "lt"
  128.          EndProperty
  129.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  130.             Picture         =   "系统_图形分析窗体.frx":1FC98
  131.             Key             =   "bz"
  132.          EndProperty
  133.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  134.             Picture         =   "系统_图形分析窗体.frx":1FDAC
  135.             Key             =   "dyj1"
  136.          EndProperty
  137.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  138.             Picture         =   "系统_图形分析窗体.frx":20428
  139.             Key             =   "dy"
  140.          EndProperty
  141.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  142.             Picture         =   "系统_图形分析窗体.frx":20548
  143.             Key             =   "tc"
  144.          EndProperty
  145.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  146.             Picture         =   "系统_图形分析窗体.frx":2086C
  147.             Key             =   "bj"
  148.          EndProperty
  149.       EndProperty
  150.    End
  151.    Begin MSComctlLib.Toolbar Toolbar1 
  152.       Align           =   3  'Align Left
  153.       Height          =   6630
  154.       Left            =   0
  155.       TabIndex        =   0
  156.       Top             =   555
  157.       Width           =   420
  158.       _ExtentX        =   741
  159.       _ExtentY        =   11695
  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          =   555
  240.       Left            =   0
  241.       TabIndex        =   2
  242.       Top             =   0
  243.       Width           =   10875
  244.       _ExtentX        =   19182
  245.       _ExtentY        =   979
  246.       ButtonWidth     =   1138
  247.       ButtonHeight    =   926
  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 MSComDlg.CommonDialog CommonDialog1 
  283.          Left            =   8310
  284.          Top             =   90
  285.          _ExtentX        =   847
  286.          _ExtentY        =   847
  287.          _Version        =   393216
  288.       End
  289.    End
  290. End
  291. Attribute VB_Name = "XT_TxfxFrm"
  292. Attribute VB_GlobalNameSpace = False
  293. Attribute VB_Creatable = False
  294. Attribute VB_PredeclaredId = True
  295. Attribute VB_Exposed = False
  296. Dim Tx3d As Boolean                   '图形3D设置
  297. Dim Dqtxlx As String                  '当前分析图类型
  298. Private Sub Command1_Click()
  299.     
  300.     With Txfxchart.Aspect
  301.         If .View3D = True Then
  302.             .Zoom = 100
  303.             .Rotation = 345
  304.             .Elevation = 345
  305.             .HorizOffset = 0
  306.             .VertOffset = 0
  307.             .Perspective = 15
  308.             .Orthogonal = True
  309.             .Chart3DPercent = 15
  310.         End If
  311.     End With
  312. End Sub
  313. Private Sub Command2_Click()
  314. End Sub
  315. Private Sub Form_Load()
  316.     
  317.     TeeCommander1.Chart = Txfxchart
  318.     Tx3d = False
  319.     Dqtxlx = "bar"
  320.     'Call Xzsctxlx(Dqtxlx)
  321.    
  322.     StatusBar1.Panels(1).Text = "图形类型:" + Dqtxlx
  323.     StatusBar1.Panels(2).Text = "二维效果"
  324.   
  325. End Sub
  326. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)           '选择分析图类型
  327.    
  328.     Call Xzsctxlx(Button.Key)
  329.     Dqtxlx = Button.Key
  330. End Sub
  331. Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button)           '菜 单 选 项
  332.     Select Case Button.Key
  333.         Case "lt"                               '视觉效果
  334.             If Tx3d Then
  335.                 Tx3d = False
  336.                 Txfxchart.Aspect.View3D = False
  337.                 Button.Caption = "3D效果"
  338.                 StatusBar1.Panels(2).Text = "二维效果"
  339.                 With Toolbar1.Buttons
  340.                     .Item("bubble").Enabled = True
  341.                     .Item("contour").Enabled = True
  342.                     .Item("xy").Enabled = True
  343.                     .Item("polar").Enabled = True
  344.                     .Item("radar").Enabled = True
  345.                 End With
  346.             Else
  347.                 Tx3d = True
  348.                 Button.Caption = "2D效果"
  349.                 Txfxchart.Aspect.View3D = True
  350.                 StatusBar1.Panels(2).Text = "三维效果"
  351.                 With Toolbar1.Buttons
  352.                     .Item("bubble").Enabled = False
  353.                     .Item("contour").Enabled = False
  354.                     .Item("xy").Enabled = False
  355.                     .Item("polar").Enabled = False
  356.                     .Item("radar").Enabled = False
  357.                 End With
  358.             End If
  359.             ' Call Xzsctxlx(Dqtxlx)
  360.         Case "dy"                                    '打 印
  361.             With Txfxchart
  362.                 CommonDialog1.CancelError = True
  363.                 
  364.                 On Error GoTo Cwcl2:
  365.                 
  366.                 CommonDialog1.ShowPrinter
  367.                 .PrintInformation.Orientation = VtPrintOrientationLandscape '横向打印
  368.                 .PrintInformation.PrintCopies (CommonDialog1.Copies)
  369.             End With
  370. Cwcl2:
  371.             Exit Sub
  372.         Case "tc"
  373.             Unload Me
  374.     End Select
  375. End Sub
  376. Private Sub Xzsctxlx(Txlx As String)                           '选择分析图类型
  377.     
  378.     Dim i As Integer
  379.     With Txfxchart
  380.         'If Not Tx3d Then
  381.             'Select Case Txlx
  382.                 'Case "area"
  383.                     '.charttype = VtChChartType2dArea
  384.                 'Case "bar"
  385.                     '.charttype = VtChChartType2dBar
  386.                 'Case "line"
  387.                     '.charttype = VtChChartType2dLine
  388.                 'Case "step"
  389.                     '.charttype = VtChChartType2dStep
  390.                 'Case "combination"
  391.                     '.charttype = VtChChartType2dCombination
  392.                 'Case "pie"
  393.                     '.charttype = VtChChartType2dPie
  394.                 'Case "horzbar"
  395.                     '.charttype = VtChChartType2dHorizontalBar
  396.                 'Case "hilo"
  397.                     '.charttype = VtChChartType2dHiLo
  398.                 'Case "gantt"
  399.                     '.charttype = VtChChartType2dGantt
  400.                 'Case "bubble"
  401.                     '.charttype = VtChChartType2dBubble
  402.                 'Case "contour"
  403.                     '.charttype = VtChChartType2dContour
  404.                 'Case "xy"
  405.                     '.charttype = VtChChartType2dXY
  406.                 'Case "polar"
  407.                     '.charttype = VtChChartType2dPolar
  408.                 'Case "radar"
  409.                     '.charttype = VtChChartType2dRadar
  410.             'End Select
  411.         'Else
  412.             Select Case Txlx
  413.                 Case "area"
  414.                     For i = 0 To .SeriesCount - 1
  415.                         .ChangeSeriesType i, scArea
  416.                     Next i
  417.                 Case "bar"
  418.                     For i = 0 To .SeriesCount - 1
  419.                         .ChangeSeriesType i, scBar
  420.                     Next i
  421.                 Case "line"
  422.                     For i = 0 To .SeriesCount - 1
  423.                         .ChangeSeriesType i, scLine
  424.                     Next i
  425.                 Case "step"
  426.                     'For i = 0 To .SeriesCount - 1
  427.                         '.ChangeSeriesType i, scShape
  428.                     'Next i
  429.                 Case "combination"
  430.                     'For i = 0 To .SeriesCount - 1
  431.                     '   .ChangeSeriesType i, scContour
  432.                     'Next i
  433.                 Case "pie"
  434.                     For i = 0 To .SeriesCount - 1
  435.                         .ChangeSeriesType i, scPie
  436.                     Next i
  437.                 Case "horzbar"
  438.                     For i = 0 To .SeriesCount - 1
  439.                         .ChangeSeriesType i, scHorizBar
  440.                     Next i
  441.                 Case "hilo"
  442.                     For i = 0 To .SeriesCount - 1
  443.                         .ChangeSeriesType i, scPoint
  444.                     Next i
  445.                 Case "gantt"
  446.                     For i = 0 To .SeriesCount - 1
  447.                         .ChangeSeriesType i, scFastLine
  448.                     Next i
  449.             End Select
  450.         'End If
  451.         'StatusBar1.Panels(1).Text = "图形类型:" + Dqtxlx
  452.     End With
  453. End Sub
  454. Private Sub Txfxchart_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)
  455.     
  456.     With Txfxchart
  457.         If .Series(SeriesIndex).SeriesType = scPie Then
  458.             Select Case SeriesIndex
  459.                 Case 0: .ChartRect 0, 0, .Canvas.Width * 6 / 16, .Canvas.Height / 2
  460.                 Case 1: .ChartRect .Canvas.Width * 5 / 16, 0, .Canvas.Width * 11 / 16, .Canvas.Height / 2
  461.                 Case 2: .ChartRect 0, .Canvas.Height / 2, .Canvas.Width * 6 / 16, .Canvas.Height
  462.                 Case 3: .ChartRect .Canvas.Width * 5 / 16, .Canvas.Height / 2, .Canvas.Width * 11 / 16, .Canvas.Height
  463.                 Case 4: .ChartRect .Canvas.Width * 9 / 16, .Canvas.Height / 5, .Canvas.Width, .Canvas.Height * 4 / 5
  464.             End Select
  465.         End If
  466.     End With
  467. End Sub