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