|
<html><head><link rel=stylesheet href=style.css></head><body><div class=SourcePanel style='font-size:12'><pre style='background-color:white'>
<font color= "blue">Imports</font> System
<font color= "blue">Imports</font> System.Drawing
<font color= "blue">Imports</font> System.Collections
<font color= "blue"></font>
<font color= "blue">Namespace</font> ASPNET.StarterKit.Chart
<font color= "blue"></font>
<font color= "green"> '*********************************************************************</font>
<font color= "green"> '</font>
<font color= "green"> ' Chart Class</font>
<font color= "green"> '</font>
<font color= "green"> ' Base class implementation for BarChart and PieChart</font>
<font color= "green"> '</font>
<font color= "green"> '*********************************************************************</font>
<font color= "blue"></font>
<font color= "blue"> Public </font>MustInherit <font color= "blue"></font>Class Chart
<font color= "blue"> Private </font>_colorLimit <font color= "blue">As </font>Integer = 12
<font color= "blue"></font>
<font color= "blue"> Private </font>_color <font color= "blue">As </font>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}
<font color= "blue"></font>
<font color= "green"> ' Represent collection of all data points for the chart</font>
<font color= "blue"> Private </font>_dataPoints <font color= "blue">As </font>New ChartItemsCollection()
<font color= "blue"></font>
<font color= "green"> ' The implementation of this method is provided by derived classes</font>
<font color= "blue"> Public </font>MustOverride <font color= "blue"></font>Function Draw() As Bitmap
<font color= "blue"></font>
<font color= "blue"> Public Property</font> DataPoints() As ChartItemsCollection
<font color= "blue"> Get</font>
<font color= "blue"> </font>Return <font color= "blue"></font>_dataPoints
<font color= "blue"> End Get</font>
<font color= "blue"> </font>Set(ByVal Value As ChartItemsCollection)
<font color= "blue"> </font>_dataPoints <font color= "blue"></font>= Value
<font color= "blue"> End Set</font>
<font color= "blue"> End Property</font>
<font color= "blue"></font>
<font color= "blue"> Public Sub</font> SetColor(ByVal index As Integer, ByVal NewColor As Color)
<font color= "blue"></font><font color= "blue"> If </font>index < _colorLimit <font color= "blue">Then</font>
<font color= "blue"> </font>_color(index) = NewColor
<font color= "blue"></font><font color= "blue"> Else</font><font color= "blue"></font>
<font color= "blue"> </font>Throw <font color= "blue"></font>New Exception("Color Limit is " + _colorLimit)
<font color= "blue"></font><font color= "blue"> End If</font><font color= "blue"></font>
<font color= "blue"> End Sub</font><font color= "green"> 'SetColor</font>
<font color= "blue"></font>
<font color= "blue"> Public Function</font> GetColor(ByVal index As Integer) As Color
<font color= "blue"></font><font color= "blue"> If </font>index < _colorLimit <font color= "blue">Then</font>
<font color= "blue"> </font>Return <font color= "blue"></font>_color(index)
<font color= "blue"></font><font color= "blue"> Else</font><font color= "blue"></font>
<font color= "blue"> </font>Throw <font color= "blue"></font>New Exception("Color Limit is " + _colorLimit)
<font color= "blue"></font><font color= "blue"> End If</font><font color= "blue"></font>
<font color= "blue"></font><font color= "blue"> End Function</font><font color= "blue"></font><font color= "green"> 'GetColor</font>
<font color= "blue"></font><font color= "blue"> End Class</font><font color= "blue"></font><font color= "green"> 'Chart</font>
<font color= "blue"></font><font color= "blue">End Namespace</font><font color= "blue"></font><font color= "green"> 'ASPNET.StarterKit.Chart</font>
</pre>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here