Skip to main content

LineStyle Class

Defines line style settings for various chart elements.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public class LineStyle :
    ChartDependencyObject,
    IXtraSupportDeserializeCollection,
    ICloneable

Remarks

The LineStyle class contains settings that define the line style of various elements within a chart control (such as ConstantLine or LineSeries2D).

An object of the LineStyle type can be accessed via the ConstantLine.LineStyle or LineSeries2D.LineStyle property of the corresponding element.

Example

This example shows how to configure a line’s drawing style using the LineStyle class options.

You can use the following properties to modify a line:

Property Description
LineStyle.Thickness Gets or sets the line’s thickness.
LineStyle.DashCap Specifies the line end’s shape.
LineStyle.LineJoin Gets or sets how line segments are joined.
LineStyle.MiterLimit Specifies the limit on the ratio of the miter length to half this line’s thickness.
LineStyle.DashStyle Gets or sets a sequence of dashes and gaps that is used to draw a line.

The following code shows how to apply line style settings to a line series:

<dxc:LineSeries2D>
    <dxc:LineSeries2D.LineStyle>
        <dxc:LineStyle Thickness="2"
                       DashCap="Flat" 
                       LineJoin="Miter"
                       MiterLimit="10">
            <dxc:LineStyle.DashStyle>
                <DashStyle Dashes="2 1 5 1"/>
            </dxc:LineStyle.DashStyle>
        </dxc:LineStyle>
    </dxc:LineSeries2D.LineStyle>
    <!-- Other series settings. -->
</dxc:LineSeries2D>
See Also