上传用户: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      =   2475
  9.    ClientTop       =   645
  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            =   7125
  19.       TabIndex        =   4
  20.       Top             =   600
  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":0442
  63.             Key             =   "area"
  64.          EndProperty
  65.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  66.             Picture         =   "系统_图形分析窗体.frx":2926
  67.             Key             =   "bar"
  68.          EndProperty
  69.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  70.             Picture         =   "系统_图形分析窗体.frx":4D56
  71.             Key             =   "line"
  72.          EndProperty
  73.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  74.             Picture         =   "系统_图形分析窗体.frx":7186
  75.             Key             =   "step"
  76.          EndProperty
  77.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  78.             Picture         =   "系统_图形分析窗体.frx":94EA
  79.             Key             =   "combination"
  80.          EndProperty
  81.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  82.             Picture         =   "系统_图形分析窗体.frx":B84E
  83.             Key             =   "pie"
  84.          EndProperty
  85.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  86.             Picture         =   "系统_图形分析窗体.frx":DD12
  87.             Key             =   "horzbar"
  88.          EndProperty
  89.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  90.             Picture         =   "系统_图形分析窗体.frx":10076
  91.             Key             =   "hilo"
  92.          EndProperty
  93.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  94.             Picture         =   "系统_图形分析窗体.frx":1262A
  95.             Key             =   "gantt"
  96.          EndProperty
  97.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  98.             Picture         =   "系统_图形分析窗体.frx":149A6
  99.             Key             =   "bubble"
  100.          EndProperty
  101.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  102.             Picture         =   "系统_图形分析窗体.frx":16DBE
  103.             Key             =   "contour"
  104.          EndProperty
  105.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  106.             Picture         =   "系统_图形分析窗体.frx":18D02
  107.             Key             =   "xy"
  108.          EndProperty
  109.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  110.             Picture         =   "系统_图形分析窗体.frx":1AE66
  111.             Key             =   "polar"
  112.          EndProperty
  113.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  114.             Picture         =   "系统_图形分析窗体.frx":1CCFA
  115.             Key             =   "radar"
  116.          EndProperty
  117.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  118.             Picture         =   "系统_图形分析窗体.frx":1EB8E
  119.             Key             =   "lt"
  120.          EndProperty
  121.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  122.             Picture         =   "系统_图形分析窗体.frx":1EFE6
  123.             Key             =   "bz"
  124.          EndProperty
  125.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  126.             Picture         =   "系统_图形分析窗体.frx":1F0FA
  127.             Key             =   "dyj1"
  128.          EndProperty
  129.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  130.             Picture         =   "系统_图形分析窗体.frx":1F776
  131.             Key             =   "dy"
  132.          EndProperty
  133.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  134.             Picture         =   "系统_图形分析窗体.frx":1F896
  135.             Key             =   "tc"
  136.          EndProperty
  137.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  138.             Picture         =   "系统_图形分析窗体.frx":1FBBA
  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          =   6465
  284.       Left            =   450
  285.       OleObjectBlob   =   "系统_图形分析窗体.frx":20012
  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.     
  313. End Sub
  314. Private Sub Command2_Click()
  315.     
  316. End Sub
  317. Private Sub Form_Load()
  318.     
  319.     TeeCommander1.Chart = Txfxchart
  320.     Tx3d = False
  321.     Dqtxlx = "bar"
  322.     'Call Xzsctxlx(Dqtxlx)
  323.     
  324.     StatusBar1.Panels(1).Text = "图形类型:" + Dqtxlx
  325.     StatusBar1.Panels(2).Text = "二维效果"
  326.     
  327. End Sub
  328. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)           '选择分析图类型
  329.     
  330.     Call Xzsctxlx(Button.Key)
  331.     Dqtxlx = Button.Key
  332.     
  333. End Sub
  334. Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button)           '菜 单 选 项
  335.     Select Case Button.Key
  336.     Case "lt"                               '视觉效果
  337.         If Tx3d Then
  338.             Tx3d = False
  339.             Txfxchart.Aspect.View3D = False
  340.             Button.Caption = "3D效果"
  341.             StatusBar1.Panels(2).Text = "二维效果"
  342.             With Toolbar1.Buttons
  343.                 .Item("bubble").Enabled = True
  344.                 .Item("contour").Enabled = True
  345.                 .Item("xy").Enabled = True
  346.                 .Item("polar").Enabled = True
  347.                 .Item("radar").Enabled = True
  348.             End With
  349.         Else
  350.             Tx3d = True
  351.             Button.Caption = "2D效果"
  352.             Txfxchart.Aspect.View3D = True
  353.             StatusBar1.Panels(2).Text = "三维效果"
  354.             With Toolbar1.Buttons
  355.                 .Item("bubble").Enabled = False
  356.                 .Item("contour").Enabled = False
  357.                 .Item("xy").Enabled = False
  358.                 .Item("polar").Enabled = False
  359.                 .Item("radar").Enabled = False
  360.             End With
  361.         End If
  362.         ' Call Xzsctxlx(Dqtxlx)
  363.     Case "dy"                                    '打 印
  364.         With Txfxchart
  365.             CommonDialog1.CancelError = True
  366.             
  367.             On Error GoTo Cwcl2:
  368.             
  369.             CommonDialog1.ShowPrinter
  370.             .PrintInformation.Orientation = VtPrintOrientationLandscape '横向打印
  371.             .PrintInformation.PrintCopies (CommonDialog1.Copies)
  372.         End With
  373. Cwcl2:
  374.         Exit Sub
  375.     Case "tc"
  376.         Unload Me
  377.     End Select
  378.     
  379. End Sub
  380. Private Sub Xzsctxlx(Txlx As String)                           '选择分析图类型
  381.     
  382.     Dim I As Integer
  383.     With Txfxchart
  384.         'If Not Tx3d Then
  385.         'Select Case Txlx
  386.         'Case "area"
  387.         '.charttype = VtChChartType2dArea
  388.         'Case "bar"
  389.         '.charttype = VtChChartType2dBar
  390.         'Case "line"
  391.         '.charttype = VtChChartType2dLine
  392.         'Case "step"
  393.         '.charttype = VtChChartType2dStep
  394.         'Case "combination"
  395.         '.charttype = VtChChartType2dCombination
  396.         'Case "pie"
  397.         '.charttype = VtChChartType2dPie
  398.         'Case "horzbar"
  399.         '.charttype = VtChChartType2dHorizontalBar
  400.         'Case "hilo"
  401.         '.charttype = VtChChartType2dHiLo
  402.         'Case "gantt"
  403.         '.charttype = VtChChartType2dGantt
  404.         'Case "bubble"
  405.         '.charttype = VtChChartType2dBubble
  406.         'Case "contour"
  407.         '.charttype = VtChChartType2dContour
  408.         'Case "xy"
  409.         '.charttype = VtChChartType2dXY
  410.         'Case "polar"
  411.         '.charttype = VtChChartType2dPolar
  412.         'Case "radar"
  413.         '.charttype = VtChChartType2dRadar
  414.         'End Select
  415.         'Else
  416.         Select Case Txlx
  417.         Case "area"
  418.             For I = 0 To .SeriesCount - 1
  419.                 .ChangeSeriesType I, scArea
  420.             Next I
  421.         Case "bar"
  422.             For I = 0 To .SeriesCount - 1
  423.                 .ChangeSeriesType I, scBar
  424.             Next I
  425.         Case "line"
  426.             For I = 0 To .SeriesCount - 1
  427.                 .ChangeSeriesType I, scLine
  428.             Next I
  429.         Case "step"
  430.             'For i = 0 To .SeriesCount - 1
  431.             '.ChangeSeriesType i, scShape
  432.             'Next i
  433.         Case "combination"
  434.             'For i = 0 To .SeriesCount - 1
  435.             '   .ChangeSeriesType i, scContour
  436.             'Next i
  437.         Case "pie"
  438.             For I = 0 To .SeriesCount - 1
  439.                 .ChangeSeriesType I, scPie
  440.             Next I
  441.         Case "horzbar"
  442.             For I = 0 To .SeriesCount - 1
  443.                 .ChangeSeriesType I, scHorizBar
  444.             Next I
  445.         Case "hilo"
  446.             For I = 0 To .SeriesCount - 1
  447.                 .ChangeSeriesType I, scPoint
  448.             Next I
  449.         Case "gantt"
  450.             For I = 0 To .SeriesCount - 1
  451.                 .ChangeSeriesType I, scFastLine
  452.             Next I
  453.         End Select
  454.         'End If
  455.         'StatusBar1.Panels(1).Text = "图形类型:" + Dqtxlx
  456.     End With
  457.     
  458. End Sub
  459. Private Sub Txfxchart_OnSeriesBeforeDrawValues(ByVal SeriesIndex As Long)
  460.     
  461.     With Txfxchart
  462.         If .Series(SeriesIndex).SeriesType = scPie Then
  463.             Select Case SeriesIndex
  464.             Case 0: .ChartRect 0, 0, .Canvas.Width * 6 / 16, .Canvas.Height / 2
  465.             Case 1: .ChartRect .Canvas.Width * 5 / 16, 0, .Canvas.Width * 11 / 16, .Canvas.Height / 2
  466.             Case 2: .ChartRect 0, .Canvas.Height / 2, .Canvas.Width * 6 / 16, .Canvas.Height
  467.             Case 3: .ChartRect .Canvas.Width * 5 / 16, .Canvas.Height / 2, .Canvas.Width * 11 / 16, .Canvas.Height
  468.             Case 4: .ChartRect .Canvas.Width * 9 / 16, .Canvas.Height / 5, .Canvas.Width, .Canvas.Height * 4 / 5
  469.             End Select
  470.         End If
  471.     End With
  472.     
  473. End Sub