Strips

  • 3 minutes to read

A strip is an area limited by two fixed values (minimal and maximal limits) on a corresponding axis.

WPF_Strip

This document contains the following sections:

How to Add a Strip

The Chart control enables you to add an unlimited number of strips to an x- or y-axis. To add a strip, you need to add a Strip object to the Axis2D.Strips collection and define the strip's minimum and maximum limits. A strip does not display if the minimum limit is not less than the maximum limit, and it would occupy all available space in a diagram if these limits are not specified.

SimpleStripExample

The XAML below shows how to add a strip to a chart:

<dxc:XYDiagram2D.AxisX>
     <dxc:AxisX2D>
          <dxc:AxisX2D.Strips>
               <dxc:Strip MinLimit="05/01/2015"  
                          MaxLimit="08/01/2015"/>
          </dxc:AxisX2D.Strips>
     </dxc:AxisX2D>
     <!--...-->
</dxc:XYDiagram2D.AxisX>

The example above applies the following classes and properties:

Class or Property Description
Strip A strip.
Axis2D.Strips A collection that stores all strips of an axis.
Strip.MinLimit A value specifying the strip's minimum axis value.
Strip.MaxLimit A value specifying the strip's maximum axis value.

How to Show a Strip in a Legend

You can display a marker with text that identifies a strip in a chart legend.

WPF_StripLegendText

The following code example demonstrates how to show a strip marker with the specified text in the required legend:

<dxc:ChartControl.Legends>
      <dxc:Legend Name="seriesLegend"/>
      <dxc:Legend Name="stripLegend" 
                  VerticalPosition="Bottom"/>
</dxc:ChartControl.Legends>
<!--...-->
<dxc:XYDiagram2D>
      <dxc:XYDiagram2D.AxisX>
            <dxc:AxisX2D>
                  <dxc:AxisX2D.Strips>
                        <dxc:Strip LegendText="May - August" 
                                   Legend="{Binding ElementName=stripLegend}"
                                   MinLimit="05/01/2015" 
                                   MaxLimit="08/31/2015"/>
                  </dxc:AxisX2D.Strips>
            </dxc:AxisX2D>
            <!--...-->
      </dxc:XYDiagram2D.AxisX>
</dxc:XYDiagram2D>

The markup above utilize the following properties:

Property

Description

Strip.LegendText

Text that shows with a strip marker in a chart legend.

If this property is not specified, a strip identifier does not show in the legend.

Strip.Legend

A legend that shows a strip identifier.

How to Show a Specific Axis Label for a Strip

You can add a custom axis label for a strip as the following image shows:

WPF_AxisLabelText

The Strip.AxisLabelText property allows you to specify axis label text for a strip:

<dxc:AxisX2D>
      <dxc:AxisX2D.Strips>
            <dxc:Strip AxisLabelText="May - August" 
                       MinLimit="05/01/2015" 
                       MaxLimit="08/31/2015"/>
      </dxc:AxisX2D.Strips>
</dxc:AxisX2D>
TIP

To simultaneously show auto-generated and custom axis labels, set the Axis2D.LabelVisibilityMode property to AutoGeneratedAndCustom.

How to Customize Strip Appearance

You can modify the default strip appearance to fulfill your requirements.

WPF_StripAppearance

Using the following markup, you can configure a strip brush and its outline:

<dxc:AxisY2D>
      <dxc:AxisY2D.Strips>
            <dxc:Strip Brush="LightGray" 
                       BorderColor="Transparent" 
                       MinLimit="1150" 
                       MaxLimit="1250"/>
      </dxc:AxisY2D.Strips>
      <!--...-->
</dxc:AxisY2D>

The example uses the following API members to configure strip appearance:

Property Description
Strip.Brush A brush used to paint the strip.
Strip.BorderColor A strip border color.
See Also