Skip to main content
A newer version of this page is available. .

CandleStickSeries2D Class

Represents the 2D Candle Stick series.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v18.2.dll

Declaration

public class CandleStickSeries2D :
    FinancialSeries2D

Example

The following example demonstrates how to create a 2D Candle Stick chart. To do this, it is necessary to assign the ChartControl.Diagram property to XYDiagram2D, and then add a CandleStickSeries2D object with points to the diagram’s Diagram.Series collection.

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts" 
        x:Class="CandleStick2DChart.Window1" 
        Title="Window1" 
        Height="350" Width="620">
    <Grid>
        <dxc:ChartControl Name="chartControl1">
            <dxc:XYDiagram2D>
                <dxc:CandleStickSeries2D ArgumentScaleType="DateTime" 
                                         LabelsVisibility="True">
                    <!--region #FinancialSeriesPoint-->
                    <dxc:SeriesPoint Argument="1/1/2017" 
                                     dxc:FinancialSeries2D.CloseValue="27" 
                                     dxc:FinancialSeries2D.HighValue="28" 
                                     dxc:FinancialSeries2D.LowValue="24" 
                                     dxc:FinancialSeries2D.OpenValue="25"/>
                    <!--endregion #FinancialSeriesPoint-->
                    <dxc:SeriesPoint Argument="1/2/2017" 
                                     dxc:FinancialSeries2D.CloseValue="32" 
                                     dxc:FinancialSeries2D.HighValue="35" 
                                     dxc:FinancialSeries2D.LowValue="26" 
                                     dxc:FinancialSeries2D.OpenValue="27"/>
                    <dxc:SeriesPoint Argument="1/3/2017" 
                                     dxc:FinancialSeries2D.CloseValue="29" 
                                     dxc:FinancialSeries2D.HighValue="35" 
                                     dxc:FinancialSeries2D.LowValue="27" 
                                     dxc:FinancialSeries2D.OpenValue="32"/>
                    <dxc:SeriesPoint Argument="1/4/2017" 
                                     dxc:FinancialSeries2D.CloseValue="36" 
                                     dxc:FinancialSeries2D.HighValue="37" 
                                     dxc:FinancialSeries2D.LowValue="29" 
                                     dxc:FinancialSeries2D.OpenValue="29"/>
                    <dxc:SeriesPoint Argument="1/5/2017" 
                                     dxc:FinancialSeries2D.CloseValue="33" 
                                     dxc:FinancialSeries2D.HighValue="37" 
                                     dxc:FinancialSeries2D.LowValue="32" 
                                     dxc:FinancialSeries2D.OpenValue="36"/>
                    <!--region #ValueToDisplay-->
                    <dxc:CandleStickSeries2D.Label>
                        <dxc:SeriesLabel TextPattern="{}{HV}"/>
                    </dxc:CandleStickSeries2D.Label>
                    <!--endregion #ValueToDisplay-->
                    <!--region #ReductionOptions-->
                    <dxc:CandleStickSeries2D.ReductionOptions>
                        <dxc:ReductionStockOptions ColorMode="OpenToCloseValue" 
                                                   dxc:CandleStickSeries2D.FillMode="FilledOnReduction"/>
                    </dxc:CandleStickSeries2D.ReductionOptions>
                    <!--endregion #ReductionOptions-->
                    <!--region #Model-->
                    <dxc:CandleStickSeries2D.Model>
                        <dxc:ThinCandleStick2DModel />
                    </dxc:CandleStickSeries2D.Model>
                    <!--endregion #Model-->
                </dxc:CandleStickSeries2D>
                <!--region #AxisX-->
                <dxc:XYDiagram2D.AxisX>
                    <dxc:AxisX2D>
                        <dxc:AxisX2D.Label>
                            <dxc:AxisLabel TextPattern="{}{A:MMMM d}"/>
                        </dxc:AxisX2D.Label>
                    </dxc:AxisX2D>
                </dxc:XYDiagram2D.AxisX>
                <!--endregion #AxisX-->
                <!--region #AxisY-->
                <dxc:XYDiagram2D.AxisY>
                    <dxc:AxisY2D>
                        <dxc:AxisY2D.WholeRange>
                            <dxc:Range dxc:AxisY2D.AlwaysShowZeroLevel="False" />
                        </dxc:AxisY2D.WholeRange>
                    </dxc:AxisY2D>
                </dxc:XYDiagram2D.AxisY>
                <!--endregion #AxisY-->
            </dxc:XYDiagram2D>
        </dxc:ChartControl>
    </Grid>
</Window>

The following code snippets (auto-collected from DevExpress Examples) contain references to the CandleStickSeries2D class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Implements

See Also