Xceed Chart for WinForms v4.4 Documentation
Xceed.Chart.Standard.v4.4 Assembly / Xceed.Chart.Standard Namespace / LineProperties Class / Pattern Property
Example


In This Topic
    Pattern Property
    In This Topic
    Defines the line pattern.
    Syntax
    'Declaration
     
    Public Property Pattern As LinePattern
    'Usage
     
    Dim instance As LineProperties
    Dim value As LinePattern
     
    instance.Pattern = value
     
    value = instance.Pattern
    public LinePattern Pattern {get; set;}
    Remarks
    The Pattern and Factor properties define the line by working together to define whether a certain pixel from the line should be drawn or not. The values of the LinePattern enumeration actually represent 16-bit integers whose bit pattern determines which fragments of a line will be drawn when the line is rasterized. Bit zero is used first. For example the value of SolidLine is all ones (0xFFFF). You can create you own patterns by simply setting the bits of the short integer value that you want the line to draw. Suppose for example that you want to draw a line having three empty pixels, then one black then three empty and so forth. The value you should pass to the LinePattern in this case is 0x8888 or in binary 1000100010001000. You must also set the Factor property to 1.
    Example
    The following example shows how to accomplish this:
    Dim chart As Chart =  ChartControl.Charts.GetAt(0) 
    Dim bar As BarSeries = CType(chart.Series.Add(SeriesType.Bar), BarSeries)
    
    bar.Add(10, "Apples")
    bar.Add(20, "Oranges")
    bar.Add(30, "Bananas")
    bar.Add(25, "Tomatoes")
    bar.Add(29, "Cucumbers")
    
    bar.Appearance.LineMode = AppearanceLineMode.Series
    bar.BarBorder.Color = System.Drawing.Color.Black
    bar.BarBorder.Pattern = CType(0x8888, LinePattern)
    bar.BarBorder.Factor = 1
    Chart chart = ChartControl.Charts.GetAt(0);
    BarSeries bar = (BarSeries)chart.Series.Add(SeriesType.Bar);
    
    bar.Add(10, "Apples");
    bar.Add(20, "Oranges");
    bar.Add(30, "Bananas");
    bar.Add(25, "Tomatoes");
    bar.Add(29, "Cucumbers");
    
    bar.Appearance.LineMode = AppearanceLineMode.Series;
    bar.BarBorder.Color = System.Drawing.Color.Black;
    bar.BarBorder.Pattern = (LinePattern)0x8888;
    bar.BarBorder.Factor = 1;
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also