2024年终活动

DevExpress控件使用交流,DevExpress中国社区Dev联系电话 联系电话:023-68661681

DevExpress DXCharts入门手册一:创建一个简单的图表

来源:本站原创   发布时间:2012-09-07   浏览:4237次

本文主要演示如何利用DXCharts创建一个简单的图表,并用数据填充该图表以及调整其常用设置。

C#
<Window x:Class="DXCharts_Lesson1.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="350" Width="525" >
<Grid>
<dxc:ChartControl Name="chartControl1" >
<dxc:XYDiagram2D>
<dxc:BarSideBySideSeries2D DisplayName="MySeries1" LabelsVisibility="True">
<dxc:BarSideBySideSeries2D.Model>
<dxc:Quasi3DBar2DModel />
</dxc:BarSideBySideSeries2D.Model>
<dxc:SeriesPoint Argument="A" Value="1" />
<dxc:SeriesPoint Argument="B" Value="2" />
<dxc:SeriesPoint Argument="C" Value="3" />
<dxc:SeriesPoint Argument="D" Value="4" />
</dxc:BarSideBySideSeries2D>
<dxc:BarSideBySideSeries2D DisplayName="MySeries2" LabelsVisibility="True">
<dxc:BarSideBySideSeries2D.Model>
<dxc:Quasi3DBar2DModel />
</dxc:BarSideBySideSeries2D.Model>
<dxc:SeriesPoint Argument="A" Value="4" />
<dxc:SeriesPoint Argument="B" Value="3" />
<dxc:SeriesPoint Argument="C" Value="2" />
<dxc:SeriesPoint Argument="D" Value="1" />
</dxc:BarSideBySideSeries2D>
</dxc:XYDiagram2D>
<dxc:ChartControl.CrosshairOptions>
<dxc:CrosshairOptions ShowArgumentLine="True" ShowValueLabels="True"
ShowValueLine="True" ShowArgumentLabels="True" />
</dxc:ChartControl.CrosshairOptions>
<dxc:ChartControl.Legend>
<dxc:Legend Margin="10,0,0,0" />
</dxc:ChartControl.Legend>
</dxc:ChartControl>
</Grid>
</Window>
VB.NET
<Window x:Class="DXCharts_Lesson1.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="350" Width="525" >
<Grid>
<dxc:ChartControl Name="chartControl1" >
<dxc:XYDiagram2D>
<dxc:BarSideBySideSeries2D DisplayName="MySeries1" LabelsVisibility="True">
<dxc:BarSideBySideSeries2D.Model>
<dxc:Quasi3DBar2DModel />
</dxc:BarSideBySideSeries2D.Model>
<dxc:SeriesPoint Argument="A" Value="1" />
<dxc:SeriesPoint Argument="B" Value="2" />
<dxc:SeriesPoint Argument="C" Value="3" />
<dxc:SeriesPoint Argument="D" Value="4" />
</dxc:BarSideBySideSeries2D>
<dxc:BarSideBySideSeries2D DisplayName="MySeries2" LabelsVisibility="True">
<dxc:BarSideBySideSeries2D.Model>
<dxc:Quasi3DBar2DModel />
</dxc:BarSideBySideSeries2D.Model>
<dxc:SeriesPoint Argument="A" Value="4" />
<dxc:SeriesPoint Argument="B" Value="3" />
<dxc:SeriesPoint Argument="C" Value="2" />
<dxc:SeriesPoint Argument="D" Value="1" />
</dxc:BarSideBySideSeries2D>
</dxc:XYDiagram2D>
<dxc:ChartControl.CrosshairOptions>
<dxc:CrosshairOptions ShowArgumentLine="True" ShowValueLabels="True"
ShowValueLine="True" ShowArgumentLabels="True" />
</dxc:ChartControl.CrosshairOptions>
<dxc:ChartControl.Legend>
<dxc:Legend Margin="10,0,0,0" />
</dxc:ChartControl.Legend>
</dxc:ChartControl>
</Grid>
</Window>
本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [https://www.devexpresscn.com/]
本文地址:https://www.devexpresscn.com/post/327.html
扫码咨询
电话咨询
023-68661681
返回
顶部