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