-
大小: 93KB文件類(lèi)型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-06-01
- 語(yǔ)言: C#
- 標(biāo)簽: C#??畫(huà)??多條??二維曲線(xiàn)??
資源簡(jiǎn)介
C#畫(huà)多條二維曲線(xiàn) 同一個(gè)X軸不同Y軸,數(shù)據(jù)有數(shù)組提供 C#語(yǔ)言實(shí)現(xiàn)

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Drawing.Drawing2D;
using?System.Drawing.Imaging;
using?System.Drawing.Text;
using?System.IO;
namespace?Text1
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????Draw1();
????????}
????????public?void?Draw1()
????????{
????????????//確定圖象顯示大小
????????????int?width?=?640;
????????????int?height?=?500;
????????????Bitmap?img?=?new?Bitmap(width?height);
??????????//??string?title?=?“圖表測(cè)試數(shù)據(jù)圖表“;
????????????//生成繪圖對(duì)像
????????????Graphics?g?=?Graphics.FromImage(img);
????????????Pen?bluePen?=?new?Pen(Color.Azure?2);
????????????//定義畫(huà)筆??
????????????Pen?blackPen?=?new?Pen(Color.Black?2);
????????????Pen?redPen?=?new?Pen(Color.Red?2);
????????????Pen?orangePen?=?new?Pen(Color.Orange?2);
????????????Pen?BlueVioletPen?=?new?Pen(Color.BlueViolet?2);
????????????//定義畫(huà)刷
????????????Brush?blackBrush?=?new?SolidBrush(Color.Black);
????????????//定義字體?
????????????Font?axesFont?=?new?Font(“arial“?10);
????????????//填充畫(huà)板??
????????????g.FillRectangle(new?SolidBrush(Color.Silver)?0?0?width?height);
????????????const?int?num?=?10;
????????????float[]?initX?=?{?0.5f?2f?3f?4f?5f?6f?7f?8f?9f?12.2f?};
????????????float[]?initY?=?{?1.5f?2f?4f?4f?4f?6f?7f?9.4f?13.8f?28.4f?};
????????????float[]?initZ?=?{?20.5f18f?14f?11f?10f?9f?6f?5f?8f?2.4f?};
????????????//分別取得X和Y最大值最小值
????????????float?maxX?=?initX[0];
????????????float?minX?=?initX[0];
????????????float?maxY?=?initY[0];
????????????float?minY?=?initY[0];
????????????float?maxZ?=?initY[0];
????????????float?minZ?=?initY[0];
????????????for?(int?i?=?0;?i?????????????{
????????????????if?(initX[i]?>?maxX)
????????????????????maxX?=?initX[i];
????????????????if?(initX[i]?????????????????????minX?=?initX[i];
????????????????if?(initY[i]?>?maxY)
????????????????????maxY?=?initY[i];
????????????????if?(initY[i]?????????????????????minY?=?initY[i];
????????????????if?(initZ[i]?>?maxZ)
????????????????????maxZ?=?initZ[i];
????????????????if?(initZ[i]?????????????????????minZ?=?initZ[i];
????????????}
????????????//如果原點(diǎn)必須在X軸上,加上下面2行,否則注釋掉
?????????????if?(minX?>?0)
??????????????minX?=0;
????????????//如果原點(diǎn)必須在Y軸上,加上下面2行,否則注釋掉
????????????if?(minY?>?0)
?????????????minY?=?0;
????????????if?(minZ?>?0)
????????????????minZ?=?0;
????????????//確定坐標(biāo)圖四周預(yù)留的空白大小
????????????const?int?mytop?=?80;
????????????const?int?mybottom?=?80;
????????????const?int?myleft?=?80;
????????????const?int?myright?=80;
????????????//確定X,Y軸每單位顯示寬度
????????????float?intervalX?=?(width?-?myleft?-?myright)?/?(maxX?-?minX);
????????????float?inte
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件??????13824??2010-11-14?15:07??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Debug\Text1.exe
?????文件??????32256??2010-11-14?15:07??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Debug\Text1.pdb
?????文件??????14328??2010-11-14?15:08??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Debug\Text1.vshost.exe
?????文件????????490??2007-07-21?01:33??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Debug\Text1.vshost.exe.manifest
?????文件???????1763??2011-01-06?15:25??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Release\Text1.application
?????文件??????15360??2011-01-06?15:25??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Release\Text1.exe
?????文件???????2946??2011-01-06?15:25??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Release\Text1.exe.manifest
?????文件??????40448??2011-01-06?15:25??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Release\Text1.pdb
?????文件???????1763??2011-01-06?15:25??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Release\Text1.vshost.application
?????文件??????14328??2011-01-06?15:27??C#畫(huà)多條二維曲線(xiàn)\Text1\bin\Release\Text1.vshost.exe
?????文件???????6895??2010-11-15?14:20??C#畫(huà)多條二維曲線(xiàn)\Text1\Form1.cs
?????文件???????3407??2010-11-14?11:15??C#畫(huà)多條二維曲線(xiàn)\Text1\Form1.Designer.cs
?????文件???????5814??2010-11-14?11:15??C#畫(huà)多條二維曲線(xiàn)\Text1\Form1.resx
?????文件???????5814??2011-01-06?15:05??C#畫(huà)多條二維曲線(xiàn)\Text1\Form2.resx
?????文件??????10424??2011-01-06?15:25??C#畫(huà)多條二維曲線(xiàn)\Text1\Form2.cs
?????文件????????436??2010-11-18?07:37??C#畫(huà)多條二維曲線(xiàn)\Text1\Form3.cs
?????文件???????3429??2010-11-16?07:55??C#畫(huà)多條二維曲線(xiàn)\Text1\Form3.Designer.cs
?????文件???????5814??2010-11-16?07:55??C#畫(huà)多條二維曲線(xiàn)\Text1\Form3.resx
?????文件????????485??2010-11-14?15:08??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Debug\Text1.csproj.FileListAbsolute.txt
?????文件????????905??2010-11-14?11:15??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Debug\Text1.csproj.GenerateResource.Cache
?????文件??????13824??2010-11-14?15:07??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Debug\Text1.exe
?????文件????????180??2010-11-14?11:15??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Debug\Text1.Form1.resources
?????文件????????180??2010-11-14?11:08??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Debug\Text1.Form2.resources
?????文件??????32256??2010-11-14?15:07??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Debug\Text1.pdb
?????文件????????180??2010-11-14?11:08??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Debug\Text1.Properties.Resources.resources
?????文件???????1763??2011-01-06?15:25??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Release\Text1.application
?????文件???????3442??2011-01-06?15:27??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Release\Text1.csproj.FileListAbsolute.txt
?????文件??????15360??2011-01-06?15:25??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Release\Text1.exe
?????文件???????2946??2011-01-06?15:25??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Release\Text1.exe.manifest
?????文件????????180??2010-11-16?07:56??C#畫(huà)多條二維曲線(xiàn)\Text1\obj\Release\Text1.Form1.resources
............此處省略32個(gè)文件信息
- 上一篇:WCF雙工通信代碼(C#)
- 下一篇:C#寫(xiě)的130行圍棋
評(píng)論
共有 條評(píng)論