上传用户: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. 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.PictureBox Txfxchart 
  16.       Height          =   6465
  17.       Left            =   630
  18.       ScaleHeight     =   6405
  19.       ScaleWidth      =   10005
  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":1042
  72.             Key             =   "area"
  73.          EndProperty
  74.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  75.             Picture         =   "系统_图形分析窗体.frx":3526
  76.             Key             =   "bar"
  77.          EndProperty
  78.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  79.             Picture         =   "系统_图形分析窗体.frx":5956
  80.             Key             =   "line"
  81.          EndProperty
  82.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  83.             Picture         =   "系统_图形分析窗体.frx":7D86
  84.             Key             =   "step"
  85.          EndProperty
  86.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  87.             Picture         =   "系统_图形分析窗体.frx":A0EA
  88.             Key             =   "combination"
  89.          EndProperty
  90.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  91.             Picture         =   "系统_图形分析窗体.frx":C44E
  92.             Key             =   "pie"
  93.          EndProperty
  94.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  95.             Picture         =   "系统_图形分析窗体.frx":E912
  96.             Key             =   "horzbar"
  97.          EndProperty
  98.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  99.             Picture         =   "系统_图形分析窗体.frx":10C76
  100.             Key             =   "hilo"
  101.          EndProperty
  102.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  103.             Picture         =   "系统_图形分析窗体.frx":1322A
  104.             Key             =   "gantt"
  105.          EndProperty
  106.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  107.             Picture         =   "系统_图形分析窗体.frx":155A6
  108.             Key             =   "bubble"
  109.          EndProperty
  110.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  111.             Picture         =   "系统_图形分析窗体.frx":179BE
  112.             Key             =   "contour"
  113.          EndProperty
  114.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  115.             Picture         =   "系统_图形分析窗体.frx":19902
  116.             Key             =   "xy"
  117.          EndProperty
  118.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  119.             Picture         =   "系统_图形分析窗体.frx":1BA66
  120.             Key             =   "polar"
  121.          EndProperty
  122.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  123.             Picture         =   "系统_图形分析窗体.frx":1D8FA
  124.             Key             =   "radar"
  125.          EndProperty
  126.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  127.             Picture         =   "系统_图形分析窗体.frx":1F78E
  128.             Key             =   "lt"
  129.          EndProperty
  130.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  131.             Picture         =   "系统_图形分析窗体.frx":1FBE6
  132.             Key             =   "bz"
  133.          EndProperty
  134.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  135.             Picture         =   "系统_图形分析窗体.frx":1FCFA
  136.             Key             =   "dyj1"
  137.          EndProperty
  138.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  139.             Picture         =   "系统_图形分析窗体.frx":20376
  140.             Key             =   "dy"
  141.          EndProperty
  142.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  143.             Picture         =   "系统_图形分析窗体.frx":20496
  144.             Key             =   "tc"
  145.          EndProperty
  146.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  147.             Picture         =   "系统_图形分析窗体.frx":207BA
  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 VB.PictureBox TeeCommander1 
  284.          Height          =   495
  285.          Left            =   3210
  286.          ScaleHeight     =   435
  287.          ScaleWidth      =   6945
  288.          TabIndex        =   3
  289.          Top             =   30
  290.          Width           =   7005
  291.       End
  292.       Begin MSComDlg.CommonDialog CommonDialog1 
  293.          Left            =   8310
  294.          Top             =   90
  295.          _ExtentX        =   847
  296.          _ExtentY        =   847
  297.          _Version        =   393216
  298.       End
  299.    End
  300. End
  301. Attribute VB_Name = "XT_TxfxFrm"
  302. Attribute VB_GlobalNameSpace = False
  303. Attribute VB_Creatable = False
  304. Attribute VB_PredeclaredId = True
  305. Attribute VB_Exposed = False
  306. Dim Tx3d As Boolean                   '图形3D设置
  307. Dim Dqtxlx As String                  '当前分析图类型
  308. Private Sub Command1_Click()
  309.     
  310.     With Txfxchart.Aspect
  311.         If .View3d = True Then
  312.             .Zoom = 100
  313.             .Rotation = 345
  314.             .Elevation = 345
  315.             .HorizOffset = 0
  316.             .VertOffset = 0
  317.             .Perspective = 15
  318.             .Orthogonal = True
  319.             .Chart3DPercent = 15
  320.         End If
  321.     End With
  322. End Sub
  323. Private Sub Command2_Click()
  324. End Sub
  325. Private Sub Form_Load()
  326.     
  327.     TeeCommander1.Chart = Txfxchart
  328.     Tx3d = False
  329.     Dqtxlx = "bar"
  330.     'Call Xzsctxlx(Dqtxlx)
  331.    
  332.     StatusBar1.Panels(1).Text = "图形类型:" + Dqtxlx
  333.     StatusBar1.Panels(2).Text = "二维效果"
  334.   
  335. End Sub
  336. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)           '选择分析图类型
  337.    
  338.     Call Xzsctxlx(Button.Key)
  339.     Dqtxlx = Button.Key
  340. End Sub
  341. Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button)           '菜 单 选 项
  342.     Select Case Button.Key
  343.         Case "lt"                               '视觉效果
  344.             If Tx3d Then
  345.                 Tx3d = False
  346.                 Txfxchart.Aspect.View3d = False
  347.                 Button.Caption = "3D效果"
  348.                 StatusBar1.Panels(2).Text = "二维效果"
  349.                 With Toolbar1.Buttons
  350.                     .Item("bubble").Enabled = True
  351.                     .Item("contour").Enabled = True
  352.                     .Item("xy").Enabled = True
  353.                     .Item("polar").Enabled = True
  354.                     .Item("radar").Enabled = True
  355.                 End With
  356.             Else
  357.                 Tx3d = True
  358.                 Button.Caption = "2D效果"
  359.                 Txfxchart.Aspect.View3d = True
  360.                 StatusBar1.Panels(2).Text = "三维效果"
  361.                 With Toolbar1.Buttons
  362.                     .Item("bubble").Enabled = False
  363.                     .Item("contour").Enabled = False
  364.                     .Item("xy").Enabled = False
  365.                     .Item("polar").Enabled = False
  366.                     .Item("radar").Enabled = False
  367.                 End With
  368.             End If
  369.             ' Call Xzsctxlx(Dqtxlx)
  370.         Case "dy"                                    '打 印
  371.             With Txfxchart
  372.                 CommonDialog1.CancelError = True
  373.                 
  374.                 On Error GoTo Cwcl2:
  375.                 
  376.                 CommonDialog1.ShowPrinter
  377.                 .PrintInformation.Orientation = VtPrintOrientationLandscape '横向打印
  378.                 .PrintInformation.PrintCopies (CommonDialog1.Copies)
  379.             End With
  380. Cwcl2:
  381.             Exit Sub
  382.         Case "tc"
  383.             Unload Me
  384.     End Select
  385. End Sub
  386. Private Sub Xzsctxlx(Txlx As String)                           '选择分析图类型
  387.     
  388.     Dim i As Integer
  389.     With Txfxchart
  390.         'If Not Tx3d Then
  391.             'Select Case Txlx
  392.                 'Case "area"
  393.                     '.charttype = VtChChartType2dArea
  394.                 'Case "bar"
  395.                     '.charttype = VtChChartType2dBar
  396.                 'Case "line"
  397.                     '.charttype = VtChChartType2dLine
  398.                 'Case "step"
  399.                     '.charttype = VtChChartType2dStep
  400.                 'Case "combination"
  401.                     '.charttype = VtChChartType2dCombination
  402.                 'Case "pie"
  403.                     '.charttype = VtChChartType2dPie
  404.                 'Case "horzbar"
  405.                     '.charttype = VtChChartType2dHorizontalBar
  406.                 'Case "hilo"
  407.                     '.charttype = VtChChartType2dHiLo
  408.                 'Case "gantt"
  409.                     '.charttype = VtChChartType2dGantt
  410.                 'Case "bubble"
  411.                     '.charttype = VtChChartType2dBubble
  412.                 'Case "contour"
  413.                     '.charttype = VtChChartType2dContour
  414.                 'Case "xy"
  415.                     '.charttype = VtChChartType2dXY
  416.                 'Case "polar"
  417.                     '.charttype = VtChChartType2dPolar
  418.                 'Case "radar"
  419.                     '.charttype = VtChChartType2dRadar
  420.             'End Select
  421.         'Else
  422.             Select Case Txlx
  423.                 Case "area"
  424.                     For i = 0 To .SeriesCount - 1
  425.                         .ChangeSeriesType i, scArea
  426.                     Next i
  427.                 Case "bar"
  428.                     For i = 0 To .SeriesCount - 1
  429.                         .ChangeSeriesType i, scBar
  430.                     Next i
  431.                 Case "line"
  432.                     For i = 0 To .SeriesCount - 1
  433.                         .ChangeSeriesType i, scLine
  434.                     Next i
  435.                 Case "step"
  436.                     'For i = 0 To .SeriesCount - 1
  437.                         '.ChangeSeriesType i, scShape
  438.                     'Next i
  439.                 Case "combination"
  440.                     'For i = 0 To .SeriesCount - 1
  441.                     '   .ChangeSeriesType i, scContour
  442.                     'Next i
  443.                 Case "pie"
  444.                     For i = 0 To .SeriesCount - 1
  445.                         .ChangeSeriesType i, scPie
  446.                     Next i
  447.                 Case "horzbar"
  448.                     For i = 0 To .SeriesCount - 1
  449.                         .ChangeSeriesType i, scHorizBar
  450.                     Next i
  451.                 Case "hilo"
  452.                     For i = 0 To .SeriesCount - 1
  453.                         .ChangeSeriesType i, scPoint
  454.                     Next i
  455.                 Case "gantt"
  456.                     For i = 0 To .SeriesCount - 1
  457.                         .ChangeSeriesType i, scFastLine
  458.                     Next i
  459.             End Select
  460.         'End If
  461.         'StatusBar1.Panels(1).Text = "图形类型:" + Dqtxlx
  462.     End With
  463. End Sub
  464. Private Sub Txfxchart_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)
  465.     
  466.     With Txfxchart
  467.         If .Series(SeriesIndex).SeriesType = scPie Then
  468.             Select Case SeriesIndex
  469.                 Case 0: .ChartRect 0, 0, .Canvas.Width * 6 / 16, .Canvas.Height / 2
  470.                 Case 1: .ChartRect .Canvas.Width * 5 / 16, 0, .Canvas.Width * 11 / 16, .Canvas.Height / 2
  471.                 Case 2: .ChartRect 0, .Canvas.Height / 2, .Canvas.Width * 6 / 16, .Canvas.Height
  472.                 Case 3: .ChartRect .Canvas.Width * 5 / 16, .Canvas.Height / 2, .Canvas.Width * 11 / 16, .Canvas.Height
  473.                 Case 4: .ChartRect .Canvas.Width * 9 / 16, .Canvas.Height / 5, .Canvas.Width, .Canvas.Height * 4 / 5
  474.             End Select
  475.         End If
  476.     End With
  477. End Sub