上传用户: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      =   1770
  9.    ClientTop       =   1110
  10.    ClientWidth     =   10875
  11.    Icon            =   "系统_图形分析窗体.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   7590
  14.    ScaleWidth      =   10875
  15.    Begin VB.CommandButton Command1 
  16.       Caption         =   "Command1"
  17.       Height          =   495
  18.       Left            =   2010
  19.       TabIndex        =   4
  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":1042
  63.             Key             =   "area"
  64.          EndProperty
  65.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  66.             Picture         =   "系统_图形分析窗体.frx":3526
  67.             Key             =   "bar"
  68.          EndProperty
  69.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  70.             Picture         =   "系统_图形分析窗体.frx":5956
  71.             Key             =   "line"
  72.          EndProperty
  73.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  74.             Picture         =   "系统_图形分析窗体.frx":7D86
  75.             Key             =   "step"
  76.          EndProperty
  77.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  78.             Picture         =   "系统_图形分析窗体.frx":A0EA
  79.             Key             =   "combination"
  80.          EndProperty
  81.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  82.             Picture         =   "系统_图形分析窗体.frx":C44E
  83.             Key             =   "pie"
  84.          EndProperty
  85.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  86.             Picture         =   "系统_图形分析窗体.frx":E912
  87.             Key             =   "horzbar"
  88.          EndProperty
  89.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  90.             Picture         =   "系统_图形分析窗体.frx":10C76
  91.             Key             =   "hilo"
  92.          EndProperty
  93.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  94.             Picture         =   "系统_图形分析窗体.frx":1322A
  95.             Key             =   "gantt"
  96.          EndProperty
  97.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  98.             Picture         =   "系统_图形分析窗体.frx":155A6
  99.             Key             =   "bubble"
  100.          EndProperty
  101.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  102.             Picture         =   "系统_图形分析窗体.frx":179BE
  103.             Key             =   "contour"
  104.          EndProperty
  105.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  106.             Picture         =   "系统_图形分析窗体.frx":19902
  107.             Key             =   "xy"
  108.          EndProperty
  109.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  110.             Picture         =   "系统_图形分析窗体.frx":1BA66
  111.             Key             =   "polar"
  112.          EndProperty
  113.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  114.             Picture         =   "系统_图形分析窗体.frx":1D8FA
  115.             Key             =   "radar"
  116.          EndProperty
  117.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  118.             Picture         =   "系统_图形分析窗体.frx":1F78E
  119.             Key             =   "lt"
  120.          EndProperty
  121.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  122.             Picture         =   "系统_图形分析窗体.frx":1FBE6
  123.             Key             =   "bz"
  124.          EndProperty
  125.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  126.             Picture         =   "系统_图形分析窗体.frx":1FCFA
  127.             Key             =   "dyj1"
  128.          EndProperty
  129.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  130.             Picture         =   "系统_图形分析窗体.frx":20376
  131.             Key             =   "dy"
  132.          EndProperty
  133.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  134.             Picture         =   "系统_图形分析窗体.frx":20496
  135.             Key             =   "tc"
  136.          EndProperty
  137.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  138.             Picture         =   "系统_图形分析窗体.frx":207BA
  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.    Begin TeeChart.TChart Txfxchart 
  283.       Height          =   6540
  284.       Left            =   450
  285.       OleObjectBlob   =   "系统_图形分析窗体.frx":20C12
  286.       TabIndex        =   6
  287.       Top             =   600
  288.       Width           =   10365
  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