DevExpress控件使用交流,DevExpress中国社区 售前咨询
当前位置: 首页 > 开发资源 » 使用教程 » DevExpress DXCharts应用教程六:2D重叠范围条形图

DevExpress DXCharts应用教程六:2D重叠范围条形图

作者:mayz   来源:本站原创   浏览:Loading...次   发布时间:2013-01-28   评论:0条

本文演示如何用 DevExpress WPF控件的 DXCharts 创建2D重叠范围条形图。首先将 ChartControl.Diagram 属性部署到XYDiagram2D下,然后添加两个RangeBarOverlappedSeries2D对象到图像的 Diagram.Series集合。下面的示例同时显示了如何添加图表标题,如何隐藏标记和标签以改进图表外观。

请参考下面示例:


<Window x:Class="_2DOverlappedRangeBarChart.MainWindow"
        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"
        Title="MainWindow" Height="480" Width="640" >
    <Grid>
        <dxc:ChartControl Name="chartControl1">
            <dxc:ChartControl.Diagram>
                <dxc:XYDiagram2D>
                    <dxc:XYDiagram2D.Series>
                        <dxc:RangeBarOverlappedSeries2D ArgumentScaleType="DateTime" 
                                                        MaxMarkerVisible="False" MinMarkerVisible="False">
                            <dxc:RangeBarOverlappedSeries2D.Points>
                                <dxc:SeriesPoint Argument="01/01/2010" Value="73.39" dxc:RangeBarSeries2D.Value2="84.68"/>
                                <dxc:SeriesPoint Argument="02/01/2010" Value="71.19" dxc:RangeBarSeries2D.Value2="80.16"/>
                                <dxc:SeriesPoint Argument="03/01/2010" Value="77.1" dxc:RangeBarSeries2D.Value2="81.18"/>
                                <dxc:SeriesPoint Argument="04/01/2010" Value="78.2" dxc:RangeBarSeries2D.Value2="83.59"/>
                                <dxc:SeriesPoint Argument="05/01/2010" Value="64.91" dxc:RangeBarSeries2D.Value2="85.14"/>
                                <dxc:SeriesPoint Argument="06/01/2010" Value="70.94" dxc:RangeBarSeries2D.Value2="78.86"/>
                                <dxc:SeriesPoint Argument="07/01/2010" Value="72.33" dxc:RangeBarSeries2D.Value2="79.53"/>
                                <dxc:SeriesPoint Argument="08/01/2010" Value="70.2" dxc:RangeBarSeries2D.Value2="81.7"/>
                                <dxc:SeriesPoint Argument="09/01/2010" Value="72.51" dxc:RangeBarSeries2D.Value2="80.22"/>
                                <dxc:SeriesPoint Argument="10/01/2010" Value="79.74" dxc:RangeBarSeries2D.Value2="83.48"/>
                            </dxc:RangeBarOverlappedSeries2D.Points>
                            <dxc:RangeBarOverlappedSeries2D.Label>
                                <dxc:SeriesLabel Visible="False" />
                            </dxc:RangeBarOverlappedSeries2D.Label>
                        </dxc:RangeBarOverlappedSeries2D>
                        <dxc:RangeBarOverlappedSeries2D  ArgumentScaleType="DateTime" BarWidth="0.2"
                                                         MaxMarkerVisible="False" MinMarkerVisible="False">
                            <dxc:RangeBarOverlappedSeries2D.Points>
                                <dxc:SeriesPoint Argument="01/01/2010" Value="72.89" dxc:RangeBarSeries2D.Value2="83.18"/>
                                <dxc:SeriesPoint Argument="02/01/2010" Value="71.19" dxc:RangeBarSeries2D.Value2="80.16"/>
                                <dxc:SeriesPoint Argument="03/01/2010" Value="78.7" dxc:RangeBarSeries2D.Value2="83.76"/>
                                <dxc:SeriesPoint Argument="04/01/2010" Value="81.45" dxc:RangeBarSeries2D.Value2="86.84"/>
                                <dxc:SeriesPoint Argument="05/01/2010" Value="65.96" dxc:RangeBarSeries2D.Value2="86.19"/>
                                <dxc:SeriesPoint Argument="06/01/2010" Value="71.44" dxc:RangeBarSeries2D.Value2="79.79"/>
                                <dxc:SeriesPoint Argument="07/01/2010" Value="71.98" dxc:RangeBarSeries2D.Value2="79.03"/>
                                <dxc:SeriesPoint Argument="08/01/2010" Value="71.2" dxc:RangeBarSeries2D.Value2="82.55"/>
                                <dxc:SeriesPoint Argument="09/01/2010" Value="72.41" dxc:RangeBarSeries2D.Value2="79.97"/>
                                <dxc:SeriesPoint Argument="10/01/2010" Value="79.49" dxc:RangeBarSeries2D.Value2="83.23"/>
                            </dxc:RangeBarOverlappedSeries2D.Points>
                            <dxc:RangeBarOverlappedSeries2D.Label>
                                <dxc:SeriesLabel Visible="False"/>
                            </dxc:RangeBarOverlappedSeries2D.Label>
                        </dxc:RangeBarOverlappedSeries2D>
                    </dxc:XYDiagram2D.Series>
                    <dxc:XYDiagram2D.AxisX>
                        <dxc:AxisX2D GridLinesVisible="True" DateTimeGridAlignment="Month">
                            <dxc:AxisX2D.DateTimeOptions>
                                <dxc:DateTimeOptions Format="Custom" FormatString="MMMM" />
                            </dxc:AxisX2D.DateTimeOptions>
                        </dxc:AxisX2D>
                    </dxc:XYDiagram2D.AxisX>
                    <dxc:XYDiagram2D.AxisY>
                        <dxc:AxisY2D>
                            <dxc:AxisY2D.Title>
                                <dxc:AxisTitle Content="$ per barrel" />
                            </dxc:AxisY2D.Title>
                            <dxc:AxisY2D.Range>
                                <dxc:AxisRange dxc:AxisY2D.AlwaysShowZeroLevel="False" />
                            </dxc:AxisY2D.Range>
                        </dxc:AxisY2D>
                    </dxc:XYDiagram2D.AxisY>
                </dxc:XYDiagram2D>
            </dxc:ChartControl.Diagram>
            <dxc:ChartControl.Titles>
                <dxc:Title Dock="Top" HorizontalAlignment="Center">Crude Oil Prices in 2010</dxc:Title>
            </dxc:ChartControl.Titles>
        </dxc:ChartControl>
    </Grid>
</Window>
效果图:


范围条形图.2D重叠范围条形图,DevExpress

本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [http://www.devexpresscn.com/]
本文地址:http://www.devexpresscn.com/Resources/Documentation-365.html

评论列表

暂无评论

请谈谈你的看法 请使用IE或者Firefox浏览器,暂不支持Chrome!

昵称 不填则默认为游客评论

DevExpress DXperience DXv2 v12

DevExpress DXperience 下载 download

DevExpress购买、价格、授权

慧都控件网为DevExpress界面控件的中国地区唯一正式授权经销商,正版控件销售公司,授权代理商,经销商及合作伙伴。

电话:400-700-1020
        023-66090381

邮箱:sales@evget.com

>>如何选择正规控件购买渠道