資源簡(jiǎn)介
代碼是自己編寫測(cè)試的,保證可用,環(huán)境為vs2012,chartControl繪制,其中包括繪制直方圖的窗體,曲線圖導(dǎo)出圖片,曲線圖導(dǎo)出pdf,數(shù)據(jù)導(dǎo)出Excel文檔,

代碼片段和文件信息
using?DevExpress.XtraCharts;
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?System.Threading;
using?System.Drawing.Drawing2D;
using?DevExpress.XtraCharts.Printing;
namespace?Chart
{
????public?enum?RotationDirectionEnum
????{
????????Longitude
????????Dimensionality
????}
????public?partial?class?ChartPag?:?Form
????{
????????ChartControl?spineChart;
????????ListLightDateConllection?listLightDateConllection;
????????List?viewLine?=?new?List();
????????Label?showLable?=?new?Label();
????????public?ChartPag(ListLightDateConllection?listLightDateConllection)
????????{
????????????InitializeComponent();
????????????this.listLightDateConllection?=?listLightDateConllection;
????????????this.panel1.Controls.Add(showLable);??????????
????????????showLable.Visible?=?false;
????????}
????????private?void?ShowSpineChart()
????????{
????????????spineChart?=?new?ChartControl();
????????????AddLine(listLightDateConllection[0]?listLightDateConllection.RotationDirection);
????????????XYDiagram?diagram?=?(XYDiagram)spineChart.Diagram;
????????????diagram.AxisX.title.Visibility?=?DevExpress.Utils.DefaultBoolean.True;
????????????diagram.AxisX.title.Alignment?=?StringAlignment.Center;
????????????diagram.AxisX.title.Text?=?“角度“;
????????????diagram.AxisX.title.EnableAntialiasing?=?DevExpress.Utils.DefaultBoolean.True;
????????????diagram.AxisX.title.Font?=?new?Font(“Tahoma“?12?Fontstyle.Bold);
????????????diagram.AxisY.title.Visibility?=?DevExpress.Utils.DefaultBoolean.True;
????????????diagram.AxisY.title.Alignment?=?StringAlignment.Center;
????????????diagram.AxisY.title.Text?=?“能量(單位mw/sr)“;
????????????diagram.AxisY.title.EnableAntialiasing?=?DevExpress.Utils.DefaultBoolean.True;
????????????diagram.AxisY.title.Font?=?new?Font(“Tahoma“?12?Fontstyle.Bold);
????????????((XYDiagram)spineChart.Diagram).EnableAxisXZooming?=?true;
????????????((XYDiagram)spineChart.Diagram).EnableAxisXScrolling?=?true;
????????????((XYDiagram)spineChart.Diagram).EnableAxisYZooming?=?true;
????????????((XYDiagram)spineChart.Diagram).EnableAxisYScrolling?=?true;
????????????spineChart.titles.Add(new?Charttitle());
????????????spineChart.titles[0].Text?=?“角度能量圖“;
????????????spineChart.titles[0].Font?=?new?Font(“Tahoma“?14?Fontstyle.Bold);
????????????spineChart.Dock?=?Dockstyle.Fill;
????????????this.panel1.Controls.Add(spineChart);
????????}
????????private?void?AddLine(ListLightDate?ArrLightDate?RotationDirectionEnum?rotationDirection)
????????{
????????????if?(spineChart?!=?null?&&?(ArrLightDate.Count?!=?0))
????????????{
????????????????Series?series?=?MakeLineSerie(ArrLightDate?rotationDirection);
????????????????//((LineSeriesView)series.View).LineMarkerOptions.BorderVisible?=?true;
????????????????//((Line
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????33792??2018-11-22?10:39??Chart\bin\Debug\Chart.dll
?????文件??????52736??2018-11-22?10:39??Chart\bin\Debug\Chart.pdb
?????文件???????4790??2018-11-21?00:23??Chart\Chart.csproj
?????文件???????9129??2018-11-21?09:12??Chart\ChartPag.cs
?????文件???????7963??2018-11-21?00:10??Chart\ChartPag.Designer.cs
?????文件??????26378??2018-11-21?00:10??Chart\ChartPag.resx
?????文件???????3793??2018-11-21?10:32??Chart\ExcelOperate.cs
?????文件???????1165??2018-11-19?20:51??Chart\LightDate.cs
?????文件???????2652??2018-11-21?13:36??Chart\ListLightDate.cs
?????文件???????1087??2018-11-20?11:08??Chart\ListLightDateConllection.cs
?????文件??????14547??2018-11-21?09:13??Chart\obj\Debug\Chart.ChartPag.resources
?????文件???????1698??2018-11-22?10:39??Chart\obj\Debug\Chart.csproj.FileListAbsolute.txt
?????文件????????978??2018-11-21?09:13??Chart\obj\Debug\Chart.csproj.GenerateResource.Cache
?????文件?????202470??2018-11-21?09:13??Chart\obj\Debug\Chart.csprojResolveAssemblyReference.cache
?????文件??????33792??2018-11-22?10:39??Chart\obj\Debug\Chart.dll
?????文件????????417??2018-11-22?10:39??Chart\obj\Debug\chart.dll.licenses
?????文件??????52736??2018-11-22?10:39??Chart\obj\Debug\Chart.pdb
?????文件????????180??2018-11-21?09:13??Chart\obj\Debug\Chart.Properties.Resources.resources
?????文件?????201953??2018-11-21?09:08??Chart\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????7878??2018-11-22?09:31??Chart\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件??????????0??2018-11-19?20:11??Chart\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2018-11-19?20:11??Chart\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2018-11-19?20:11??Chart\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件???????4096??2018-11-20?10:21??Chart\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件???????1330??2018-11-19?20:11??Chart\Properties\AssemblyInfo.cs
?????文件????????260??2018-11-22?10:39??Chart\Properties\licenses.licx
?????文件???????2850??2018-11-20?10:21??Chart\Properties\Resources.Designer.cs
?????文件???????5817??2018-11-20?10:21??Chart\Properties\Resources.resx
?????目錄??????????0??2018-11-20?10:21??Chart\obj\Debug\TempPE
?????目錄??????????0??2018-11-20?22:57??Chart\bin\Debug
............此處省略9個(gè)文件信息
評(píng)論
共有 條評(píng)論