⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chart.vb

📁 This ASP.NET (VB.NET) sample demonstrates how to create chart.
💻 VB
字号:
Imports System
Imports System.Drawing
Imports System.Collections

Namespace ComponenteGrafico

    '*********************************************************************
    ' http://www.asp.net 
    ' StartKIT
    ' Chart Class
    '
    ' Base class implementation for BarChart and PieChart
    '
    '*********************************************************************

    Public MustInherit Class Chart
        Private _colorLimit As Integer = 12

        Private _color As Color() = {Color.Chocolate, Color.YellowGreen, Color.Olive, Color.DarkKhaki, Color.Sienna, Color.PaleGoldenrod, Color.Peru, Color.Tan, Color.Khaki, Color.DarkGoldenrod, Color.Maroon, Color.OliveDrab}

        ' Represent collection of all data points for the chart
        Private _dataPoints As New ChartItemsCollection

        ' The implementation of this method is provided by derived classes
        Public MustOverride Function Draw() As Bitmap

        Public Property DataPoints() As ChartItemsCollection
            Get
                Return _dataPoints
            End Get
            Set(ByVal Value As ChartItemsCollection)
                _dataPoints = Value
            End Set
        End Property

        Public Sub SetColor(ByVal index As Integer, ByVal NewColor As Color)
            If index < _colorLimit Then
                _color(index) = NewColor
            Else
                Throw New Exception("Color Limit is " + _colorLimit)
            End If
        End Sub 'SetColor

        Public Function GetColor(ByVal index As Integer) As Color
            If index < _colorLimit Then
                Return _color(index)
            Else
                Throw New Exception("Color Limit is " + _colorLimit)
            End If
        End Function 'GetColor
    End Class 'Chart
End Namespace

⌨️ 快捷键说明

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