xquadrant.ctl

来自「多种图表的绘制及其运用」· CTL 代码 · 共 1,927 行 · 第 1/5 页

CTL
1,927
字号

        If uInfoItems = Empty Then uInfoItems = INFO_ITEMS
        varItems = Split(uInfoItems, "|")
        
        Printer.FontBold = True
        'dump chart title
        Printer.FontSize = UserControl.FontSize
        sngX = (Printer.ScaleWidth - Printer.TextWidth(uChartTitle)) / 2
        Printer.CurrentX = sngX
        Printer.Print uChartTitle
        
        'dump chart subtitle
        Printer.FontSize = Printer.FontSize - 2
        sngX = (Printer.ScaleWidth - Printer.TextWidth(uChartSubTitle)) / 2
        Printer.CurrentX = sngX
        Printer.Print uChartSubTitle
        Printer.FontSize = Printer.FontSize + 2
        Printer.Print
        
        Printer.FontBold = False
        For intIdx = 1 To cItems.Count
            With cItems(intIdx)
                stg = .LegendDescription & " (" & Format(.XValue, uDataFormat) & "/" & Format(.YValue, uDataFormat)
            End With
            Printer.Print stg
        Next
        
        Printer.EndDoc
    End If
    Exit Sub

Printlegend_error:
    uInfoItems = INFO_ITEMS
    Resume Next

End Sub


Public Property Get LegendCaption() As String
    LegendCaption = uLegendCaption
End Property

Public Property Let ChartTitle(stgVal As String)
    If stgVal <> uChartTitle Then
        uChartTitle = stgVal
        DrawChart
        PropertyChanged "ChartTitle"
    End If
End Property

Public Property Let ChartAsQuadrant(blnVal As Boolean)
    If blnVal <> uChartAsQuadrant Then
        uChartAsQuadrant = blnVal
        DrawChart
        PropertyChanged "ChartAsQuadrant"
    End If
End Property
Public Property Get ChartAsQuadrant() As Boolean
    ChartAsQuadrant = uChartAsQuadrant
End Property
Public Property Get QuadrantColorsOverridePicture() As Boolean
    QuadrantColorsOverridePicture = uQuadrantColorsOverridePicture
End Property



Public Property Get ChartTitle() As String
Attribute ChartTitle.VB_Description = "Determines the title of the chart."
    ChartTitle = uChartTitle
End Property

Public Property Let MenuItems(stgVal As String)
    uMenuItems = stgVal
    FixMenu
    PropertyChanged "MenuItems"
End Property

Public Property Let CustomMenuItems(stgVal As String)
    uCustomMenuItems = stgVal
    FixCustomMenu
    PropertyChanged "CustomMenuItems"
End Property


Public Property Let InfoItems(stgVal As String)
    uInfoItems = stgVal
    PropertyChanged "InfoItems"
End Property
Public Property Let InfoQuadrantItems(stgVal As String)
    uInfoQuadrantItems = stgVal
    PropertyChanged "InfoQuadrantItems"
End Property
Public Property Get InfoItems() As String
Attribute InfoItems.VB_Description = "Determines the string values displayed when selection information is enabled (separated by |)."
    InfoItems = uInfoItems
End Property
Public Property Get InfoQuadrantItems() As String
    InfoQuadrantItems = uInfoQuadrantItems
End Property


Public Property Get MenuItems() As String
Attribute MenuItems.VB_Description = "Determines the string values displayed when popup menu is enabled (separated by |)."
    MenuItems = uMenuItems
End Property
Public Property Get CustomMenuItems() As String
    CustomMenuItems = uCustomMenuItems
End Property


Public Property Let ChartSubTitle(stgVal As String)
    If stgVal <> uChartSubTitle Then
        uChartSubTitle = stgVal
        DrawChart
        PropertyChanged "ChartSubTitle"
    End If
End Property

Public Property Get ChartSubTitle() As String
Attribute ChartSubTitle.VB_Description = "Determines the subtitle of the chart."
    ChartSubTitle = uChartSubTitle
End Property

Public Property Let IntersectMajorY(sngVal As Single)
    If sngVal <> uIntersectMajorY Then
        uIntersectMajorY = sngVal
        DrawChart
        PropertyChanged "IntersectMajorY"
    End If
End Property

Public Property Let IntersectMajorX(sngVal As Single)
    If sngVal <> uIntersectMajorX Then
        uIntersectMajorX = sngVal
        DrawChart
        PropertyChanged "IntersectMajorX"
    End If
End Property


Public Property Get IntersectMajorY() As Single
Attribute IntersectMajorY.VB_Description = "Determines the value which the major intersection line is displayed for."
    IntersectMajorY = uIntersectMajorY
End Property

Public Property Get IntersectMajorX() As Single
    IntersectMajorX = uIntersectMajorX
End Property

Public Property Let IntersectMinorY(sngVal As Single)
    If sngVal <> uIntersectMinorY Then
        uIntersectMinorY = sngVal
        DrawChart
        PropertyChanged "IntersectMinorY"
    End If
End Property

Public Property Let IntersectMinorX(sngVal As Single)
    If sngVal <> uIntersectMinorX Then
        uIntersectMinorX = sngVal
        DrawChart
        PropertyChanged "IntersectMinorX"
    End If
End Property


Public Property Get IntersectMinorY() As Single
Attribute IntersectMinorY.VB_Description = "Determines the value which the minor intersection line is displayed for."
    IntersectMinorY = uIntersectMinorY
End Property

Public Property Get IntersectMinorX() As Single
    IntersectMinorX = uIntersectMinorX
End Property


Public Property Let AxisYOn(blnVal As Boolean)
Attribute AxisYOn.VB_Description = "Returns/sets the value that determines if the Y-axis items must be displayed."
    If blnVal <> uAxisYOn Then
        uAxisYOn = blnVal
        DrawChart
        PropertyChanged "AxisYOn"
    End If
End Property
Public Property Get AxisYOn() As Boolean
    AxisYOn = uAxisYOn
End Property

Public Property Let AxisXOn(blnVal As Boolean)
Attribute AxisXOn.VB_Description = "Returns/sets the value that determines if the X-axis items must be displayed."
    If blnVal <> uAxisXOn Then
        uAxisXOn = blnVal
        DrawChart
        PropertyChanged "AxisXOn"
    End If
End Property
Public Property Get AxisXOn() As Boolean
    AxisXOn = uAxisXOn
End Property

Public Property Let MaxY(dblMax As Double)
Attribute MaxY.VB_Description = "Returns/sets the maximum Y value."
    If dblMax > uMinYValue Then
        uMaxYValue = dblMax
        DrawChart
        PropertyChanged "MaxY"
    End If
End Property
Public Property Let MaxX(dblMax As Double)
    If dblMax > uMinXValue Then
        uMaxXValue = dblMax
        DrawChart
        PropertyChanged "MaxX"
    End If
End Property

Public Property Let MarkerLabelAngle(intValue As Integer)
    
    If intValue >= 0 And intValue <= 360 Then
        uMarkerLabelAngle = intValue
        DrawChart
        PropertyChanged "MarkerLabelAngle"
    End If

End Property
Public Property Let MarkerLabelDirection(intValue As MarkerDirectionConstants)
    
    uMarkerLabelDirection = intValue
    DrawChart
    PropertyChanged "MarkerLabelDirection"

End Property



Public Property Let MinY(dblMin As Double)
Attribute MinY.VB_Description = "Returns/sets the minimum Y value."
    If dblMin < uMaxYValue Then
        uMinYValue = dblMin
        DrawChart
        PropertyChanged "MinY"
    End If
End Property

Public Property Let MinX(dblMin As Double)
    If dblMin < uMaxXValue Then
        uMinXValue = dblMin
        DrawChart
        PropertyChanged "MinX"
    End If
End Property


Public Property Get MinY() As Double
    MinY = uMinYValue
End Property
Public Property Get MinX() As Double
    MinX = uMinXValue
End Property

Public Property Get MaxY() As Double
    MaxY = uMaxYValue
End Property
Public Property Get MaxX() As Double
    MaxX = uMaxXValue
End Property

Public Property Let QuadrantColors(stgVal As String)
    uQuadrantColors = stgVal
    DrawChart
    PropertyChanged "QuadrantColors"
End Property
Public Property Let QuadrantColorsOverridePicture(blnVal As Boolean)
    If blnVal <> QuadrantColorsOverridePicture Then
        uQuadrantColorsOverridePicture = blnVal
        DrawChart
        PropertyChanged "QuadrantColorsOverridePicture"
    End If
End Property

Public Property Get QuadrantColors() As String
    QuadrantColors = uQuadrantColors
End Property









Public Property Let SelectionInformation(blnVal As Boolean)
Attribute SelectionInformation.VB_Description = "Determines if the information box about the selected bar must be visible or hidden."
    If blnVal <> uDisplayDescript Then
        uDisplayDescript = blnVal
        DrawChart
        PropertyChanged "SelectionInformation"
    End If
End Property
Public Property Let QuadrantInformation(blnVal As Boolean)
    If blnVal <> uDisplayQuadrantDescript Then
        uDisplayQuadrantDescript = blnVal
        DrawChart
        PropertyChanged "QuadrantInformation"
    End If
End Property

Public Property Get SelectionInformation() As Boolean
    SelectionInformation = uDisplayDescript
End Property

Public Property Get QuadrantInformation() As Boolean
    QuadrantInformation = uDisplayQuadrantDescript
End Property
Public Property Let AxisLabelY(stgCaption As String)
Attribute AxisLabelY.VB_Description = "Returns/sets the Y-axis label."
    If stgCaption <> uYAxisLabel Then
        uYAxisLabel = stgCaption
        DrawChart
        PropertyChanged "AxisLabelY"
    End If
End Property
Public Property Get AxisLabelY() As String
    AxisLabelY = uYAxisLabel
End Property

Public Property Let AxisLabelX(stgCaption As String)
Attribute AxisLabelX.VB_Description = "Returns/sets the  X-axis label."
    If stgCaption <> uXAxisLabel Then
        uXAxisLabel = stgCaption
        DrawChart
        PropertyChanged "AxisLabelX"
    End If
End Property
Public Property Let AxisLabelXColor(lngVal As OLE_COLOR)
Attribute AxisLabelXColor.VB_Description = "Returns/sets the color used to display the X-axis label."
    If lngVal <> uXAxisLabelColor Then
        uXAxisLabelColor = lngVal
        DrawChart
        PropertyChanged "AxisLabelXColor"
    End If
End Property

Public Property Let AxisLabelYColor(lngVal As OLE_COLOR)
Attribute AxisLabelYColor.VB_Description = "Returns/sets the color used to display the Y-axis label."
    If lngVal <> uYAxisLabelColor Then
        uYAxisLabelColor = lngVal
        DrawChart
        PropertyChanged "AxisLabelYColor"
    End If
End Property


Public Property Let AxisItemsYColor(lngVal As OLE_COLOR)
Attribute AxisItemsYColor.VB_Description = "Returns/sets the color used to display the Y-axis items."
    If lngVal <> uYAxisItemsColor Then
        uYAxisItemsColor = lngVal
        DrawChart
        PropertyChanged "AxisItemsYColor"
    End If
End Property
Public Property Let QuadrantDividerColor(lngVal As OLE_COLOR)
    If lngVal <> uQuadrantDividerColor Then
        uQuadrantDividerColor = lngVal
        DrawChart
        PropertyChanged "QuadrantDividerColor"
    End If
End Property
Public Property Let MarkerLabelColor(lngVal As OLE_COLOR)
    If lngVal <> uMarkerLabelColor Then
        uMarkerLabelColor = lngVal
        DrawChart
        PropertyChanged "MarkerLabelColor"
    End If
End Property

Public Property Let AxisItemsXColor(lngVal As OLE_COLOR)
Attribute AxisItemsXColor.VB_Description = "Returns/sets the color used to display the X-axis items."
    If lngVal <> uXAxisItemsColor Then
        uXAxisItemsColor = lngVal
        DrawChart
        PropertyChanged "AxisIte

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?