本文整理汇总了C#中System.Windows.Forms.DataVisualization.Charting.Chart.ResetAutoValues方法的典型用法代码示例。如果您正苦于以下问题:C# Chart.ResetAutoValues方法的具体用法?C# Chart.ResetAutoValues怎么用?C# Chart.ResetAutoValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataVisualization.Charting.Chart
的用法示例。
在下文中一共展示了Chart.ResetAutoValues方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResetSMatChart
/// <summary>
/// 反射、透過係数周波数特性グラフの初期化
/// </summary>
/// <param name="chart1"></param>
public void ResetSMatChart(Chart chart1, bool dataClearFlg = true)
{
double normalizedFreq1 = FemSolver.GetNormalizedFreq(FirstWaveLength, WaveguideWidth);
normalizedFreq1 = Math.Round(normalizedFreq1, 2);
double normalizedFreq2 = FemSolver.GetNormalizedFreq(LastWaveLength, WaveguideWidth);
normalizedFreq2 = Math.Round(normalizedFreq2, 2);
// チャート初期化
setupChartColor(chart1);
chart1.Titles[0].Text = "散乱係数周波数特性";
chart1.ChartAreas[0].Axes[0].Title = "2W/λ";
chart1.ChartAreas[0].Axes[1].Title = string.Format("|Si{0}|", IncidentPortNo);
SetChartFreqRange(chart1, normalizedFreq1, normalizedFreq2);
//chart1.ChartAreas[0].Axes[1].Minimum = 0.0;
//chart1.ChartAreas[0].Axes[1].Maximum = 1.0;
//chart1.ChartAreas[0].Axes[1].Interval = 0.2;
chart1.Series.Clear();
if (dataClearFlg)
{
SMatChartXValueList.Clear();
SMatChartYValuesList.Clear();
}
if (!isInputDataReady())
{
//MessageBox.Show("入力データがセットされていません", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// 表示するモード数をデータから判定する
int portCnt = Ports.Count;
int[] portModeCntAry = getPortModeCntFromSMatData();
for (int portIndex = 0; portIndex < portCnt; portIndex++)
{
int portModeCnt = portModeCntAry[portIndex];
if (portModeCnt <= 1)
{
Series series = new Series();
series.Name = string.Format("|S{0}{1}|", portIndex + 1, IncidentPortNo);
series.ChartType = SeriesChartType.Line;
series.BorderDashStyle = ChartDashStyle.Solid;
chart1.Series.Add(series);
}
else
{
for (int iMode = 0; iMode < portModeCnt; iMode++)
{
Series series = new Series();
series.Name = string.Format("|S{0}({1}){2}|", portIndex + 1, (iMode + 1), IncidentPortNo);
series.ChartType = SeriesChartType.Line;
series.BorderDashStyle = ChartDashStyle.Solid;
chart1.Series.Add(series);
}
}
}
// 基本モード以外への電力損失のルート値
{
Series series = new Series();
series.Name = "√|loss|";
series.ChartType = SeriesChartType.Line;
series.BorderDashStyle = ChartDashStyle.Dash;
series.Color = chart1.ChartAreas[0].AxisX.LineColor;//chart1.Parent.ForeColor;
chart1.Series.Add(series);
}
// 計算されたグラフのプロパティ値をAutoに設定
chart1.ResetAutoValues();
}
示例2: SetEigenVecToChart
public void SetEigenVecToChart(Chart chart1)
{
// 波数
double k0 = 2.0 * Constants.pi / WaveLength;
// 角周波数
double omega = k0 * Constants.c0;
int[] portModeCntAry = getPortModeCntFromBetaData();
// チャート初期化
setupChartColor(chart1);
chart1.Titles[0].Text = "固有モードEz実部、虚部の分布 (2W/λ = " + (isInputDataReady()? string.Format("{0:F2}", GetNormalizedFrequency()) : "---") + ")";
chart1.ChartAreas[0].Axes[0].Title = "x / W";
chart1.ChartAreas[0].Axes[1].Title = "Ez";
chart1.ChartAreas[0].Axes[0].Minimum = 0.0;
chart1.ChartAreas[0].Axes[0].Maximum = 1.0;
chart1.ChartAreas[0].Axes[0].Interval = 0.2;
chart1.ChartAreas[0].Axes[1].Minimum = -1.0;
chart1.ChartAreas[0].Axes[1].Maximum = 1.0;
chart1.ChartAreas[0].Axes[1].Interval = 0.2;
chart1.Series.Clear();
if (!isInputDataReady())
{
//MessageBox.Show("入力データがセットされていません", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
for (int portIndex = 0; portIndex < Ports.Count; portIndex++)
{
for (int iMode = 0; iMode < portModeCntAry[portIndex]; iMode++)
{
string modeDescr = "---モード";
if (isOutputDataReady())
{
Complex beta = 0.0;
if (iMode < EigenValuesList[portIndex].Length)
{
beta = EigenValuesList[portIndex][iMode];
}
if (Math.Abs(beta.Imaginary / k0) >= Constants.PrecisionLowerLimit)
{
modeDescr = "減衰モード";
}
else if (Math.Abs(beta.Real / k0) >= Constants.PrecisionLowerLimit)
{
modeDescr = "伝搬モード";
}
}
Series series;
series = new Series();
series.Name = string.Format(((WaveModeDv == FemSolver.WaveModeDV.TM) ? "TM({0}) 実部 at {1}" : "TE({0}) 実部 at {1}")
+ Environment.NewLine + modeDescr, iMode + 1, portIndex + 1);
series.ChartType = SeriesChartType.Line;
//series.MarkerStyle = MarkerStyle.Square;
series.BorderDashStyle = ChartDashStyle.Solid;
chart1.Series.Add(series);
series = new Series();
series.Name = string.Format(((WaveModeDv == FemSolver.WaveModeDV.TM) ? "TM({0}) 虚部 at {1}" : "TE({0}) 虚部 at {1}")
+ Environment.NewLine + modeDescr, iMode + 1, portIndex + 1);
series.ChartType = SeriesChartType.Line;
//series.MarkerStyle = MarkerStyle.Cross;
series.BorderDashStyle = ChartDashStyle.Dash;
chart1.Series.Add(series);
}
}
// 計算されたグラフのプロパティ値をAutoに設定
chart1.ResetAutoValues();
if (!isInputDataReady())
{
//MessageBox.Show("入力データがセットされていません", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (!isOutputDataReady())
{
//MessageBox.Show("出力データがセットされていません", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
int dataIndex = 0;
for (int portIndex = 0; portIndex < Ports.Count; portIndex++)
{
IList<int> portNodes = Ports[portIndex];
Complex[,] eigenVecs = EigenVecsList[portIndex];
int nodeCnt = eigenVecs.GetLength(1);
for (int iMode = 0; iMode < portModeCntAry[portIndex]; iMode++)
{
Complex beta = 0.0;
if (iMode < EigenValuesList[portIndex].Length)
{
beta = EigenValuesList[portIndex][iMode];
}
/*
if (Math.Abs(beta.Imaginary/k0) >= Constants.PrecisionLowerLimit)
{
// 減衰モードは除外
continue;
}
*/
double maxValue = 0.0;
//.........这里部分代码省略.........
示例3: ParseStreamIntoChart
public static void ParseStreamIntoChart( NetworkStream NetworkStream, Chart NetworkChart, string ActorFilter, string PropertyFilter, string RPCFilter )
{
var StartTime = DateTime.UtcNow;
NetworkChart.BeginInit();
// Reset existing data.
foreach( var Series in NetworkChart.Series )
{
Series.Points.Clear();
}
NetworkChart.ResetAutoValues();
NetworkChart.Invalidate();
int FrameCounter = 0;
foreach( PartialNetworkStream RawFrame in NetworkStream.Frames )
{
PartialNetworkStream Frame = RawFrame.Filter(ActorFilter,PropertyFilter,RPCFilter);
if( Frame.EndTime == Frame.StartTime )
{
throw new InvalidOperationException();
}
float OneOverDeltaTime = 1 / (Frame.EndTime - Frame.StartTime);
NetworkChart.Series["ActorCount"].Points.AddXY( FrameCounter, Frame.ActorCount );
NetworkChart.Series["ActorCountSec"].Points.AddXY(FrameCounter, Frame.ActorCount * OneOverDeltaTime);
NetworkChart.Series["PropertyCount"].Points.AddXY( FrameCounter, Frame.PropertyCount );
NetworkChart.Series["PropertyCountSec"].Points.AddXY( FrameCounter, Frame.PropertyCount * OneOverDeltaTime );
NetworkChart.Series["PropertySize"].Points.AddXY( FrameCounter, Frame.ReplicatedSizeBits / 8 );
NetworkChart.Series["PropertySizeSec"].Points.AddXY( FrameCounter, Frame.ReplicatedSizeBits / 8 * OneOverDeltaTime );
NetworkChart.Series["RPCCount"].Points.AddXY( FrameCounter, Frame.RPCCount );
NetworkChart.Series["RPCCountSec"].Points.AddXY( FrameCounter, Frame.RPCCount * OneOverDeltaTime );
NetworkChart.Series["RPCSize"].Points.AddXY( FrameCounter, Frame.RPCSizeBits / 8 );
NetworkChart.Series["RPCSizeSec"].Points.AddXY( FrameCounter, Frame.RPCSizeBits / 8 * OneOverDeltaTime );
NetworkChart.Series["SendBunchCount"].Points.AddXY( FrameCounter, Frame.SendBunchCount );
NetworkChart.Series["SendBunchCountSec"].Points.AddXY( FrameCounter, Frame.SendBunchCount * OneOverDeltaTime );
NetworkChart.Series["SendBunchSize"].Points.AddXY( FrameCounter, Frame.SendBunchSizeBits / 8 );
NetworkChart.Series["SendBunchSizeSec"].Points.AddXY( FrameCounter, Frame.SendBunchSizeBits / 8 * OneOverDeltaTime );
NetworkChart.Series["GameSocketSendSize"].Points.AddXY( FrameCounter, Frame.UnrealSocketSize );
NetworkChart.Series["GameSocketSendSizeSec"].Points.AddXY( FrameCounter, Frame.UnrealSocketSize * OneOverDeltaTime );
NetworkChart.Series["GameSocketSendCount"].Points.AddXY( FrameCounter, Frame.UnrealSocketCount );
NetworkChart.Series["GameSocketSendCountSec"].Points.AddXY( FrameCounter, Frame.UnrealSocketCount * OneOverDeltaTime );
NetworkChart.Series["MiscSocketSendSize"].Points.AddXY( FrameCounter, Frame.OtherSocketSize );
NetworkChart.Series["MiscSocketSendSizeSec"].Points.AddXY( FrameCounter, Frame.OtherSocketSize * OneOverDeltaTime );
NetworkChart.Series["MiscSocketSendCount"].Points.AddXY( FrameCounter, Frame.OtherSocketCount );
NetworkChart.Series["MiscSocketSendCountSec"].Points.AddXY( FrameCounter, Frame.OtherSocketCount * OneOverDeltaTime );
int OutgoingBandwidth = Frame.UnrealSocketSize + Frame.OtherSocketSize + NetworkStream.PacketOverhead * (Frame.UnrealSocketCount + Frame.OtherSocketCount);
NetworkChart.Series["OutgoingBandwidthSize"].Points.AddXY( FrameCounter, OutgoingBandwidth );
NetworkChart.Series["OutgoingBandwidthSizeSec"].Points.AddXY( FrameCounter, OutgoingBandwidth * OneOverDeltaTime );
NetworkChart.Series["ActorReplicateTimeInMS"].Points.AddXY(FrameCounter, Frame.ActorReplicateTimeInMS);
if( Frame.NumEvents > 0 )
{
NetworkChart.Series["Events"].Points.AddXY( FrameCounter, 0 );
}
FrameCounter++;
}
NetworkChart.DataManipulator.FinancialFormula(FinancialFormula.MovingAverage,"30","GameSocketSendSizeSec","GameSocketSendSizeAvgSec");
NetworkChart.DataManipulator.FinancialFormula(FinancialFormula.MovingAverage,"30","OutgoingBandwidthSizeSec","OutgoingBandwidthSizeAvgSec");
NetworkChart.ChartAreas["DefaultChartArea"].RecalculateAxesScale();
NetworkChart.EndInit();
Console.WriteLine("Adding data to chart took {0} seconds", (DateTime.UtcNow - StartTime).TotalSeconds);
}
示例4: ResetEigenValueChart
/// <summary>
/// 伝搬定数分散特性(グラフの初期化
/// </summary>
/// <param name="chart1"></param>
public void ResetEigenValueChart(Chart chart1, bool isDataClear = true)
{
double normalizedFreq1 = FemSolver.GetNormalizedFreq(FirstWaveLength, WaveguideWidth);
normalizedFreq1 = Math.Round(normalizedFreq1, 2);
double normalizedFreq2 = FemSolver.GetNormalizedFreq(LastWaveLength, WaveguideWidth);
normalizedFreq2 = Math.Round(normalizedFreq2, 2);
if (isDataClear)
{
BetaChartXValueList.Clear();
BetaChartYValuesList.Clear();
}
// 表示モード数
int[] portModeCntAry = getPortModeCntFromBetaData();
// チャート初期化
setupChartColor(chart1);
chart1.Titles[0].Text = "規格化伝搬定数周波数特性";
chart1.ChartAreas[0].Axes[0].Title = "2W/λ";
chart1.ChartAreas[0].Axes[1].Title = "β/ k0";
SetChartFreqRange(chart1, normalizedFreq1, normalizedFreq2);
chart1.ChartAreas[0].Axes[1].Minimum = 0.0;
//chart1.ChartAreas[0].Axes[1].Maximum = 1.0; // 誘電体比誘電率の最大となるので可変
//chart1.ChartAreas[0].Axes[1].Interval = 0.2;
chart1.Series.Clear();
if (!isInputDataReady())
{
//MessageBox.Show("入力データがセットされていません", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
for (int portIndex = 0; portIndex < Ports.Count; portIndex++)
{
for (int modeIndex = 0; modeIndex < portModeCntAry[portIndex]; modeIndex++)
{
Series series = new Series();
series.Name = string.Format(((WaveModeDv == FemSolver.WaveModeDV.TM) ? "TM({0}) at {1}" : "TE({0}) at {1}"), modeIndex + 1, portIndex + 1);
series.ChartType = SeriesChartType.Line;
chart1.Series.Add(series);
}
}
// 計算されたグラフのプロパティ値をAutoに設定
chart1.ResetAutoValues();
}
示例5: addGraphicsPoint
/// <summary>
/// Add graphics point overload method - Series Name instead of Series Num
/// </summary>
/// <param name="CurChart"></param>
/// <param name="serName">Series name</param>
/// <param name="XVal"></param>
/// <param name="YVal"></param>
private void addGraphicsPoint(Chart CurChart, string serName, DateTime XVal, double YVal)
{
//curX=DateTime.Now;
CurChart.Series[serName].Points.AddXY(XVal, YVal);
// Keep a constant number of points by removing them from the left
if (CurChart.Series[serName].Points.Count > maxNumberOfPointsInChart)
{
// Remove data points on the left side
while (CurChart.Series[serName].Points.Count > maxNumberOfPointsInChart)
{
CurChart.Series[serName].Points.RemoveAt(0);
}
// Adjust X axis scale
//CurChart.ChartAreas[0].AxisX.Minimum = curX - maxNumberOfPointsInChart;
//CurChart.ChartAreas[0].AxisX.Maximum = CurChart.ChartAreas[0].AxisX.Minimum + maxNumberOfPointsInChart;
}
// Adjust Y & X axis scale
CurChart.ResetAutoValues();
// Invalidate chart
CurChart.Invalidate();
}
示例6: DisplayChartFOnIteration
private void DisplayChartFOnIteration(Chart chart, List<double> fList)
{
Series fOnIter = new Series
{
ChartType = SeriesChartType.Line
};
for (int i = 0; i < fList.Count; i++)
{
fOnIter.Points.AddXY(i, fList[i]);
}
chart.Series.Clear();
chart.Series.Add(fOnIter);
chart.ResetAutoValues();
}
示例7: ParseStreamIntoChart
public static void ParseStreamIntoChart( MainWindow InMainWindow, NetworkStream NetworkStream, Chart NetworkChart, FilterValues InFilterValues )
{
var StartTime = DateTime.UtcNow;
InMainWindow.ShowProgress( true );
// Save old scroll position
double OldPosition = NetworkChart.ChartAreas["DefaultChartArea"].AxisX.ScaleView.Position;
NetworkChart.BeginInit();
// Reset existing data.
for ( int i = 0; i < NetworkChart.Series.Count; i++ )
{
float Percent = ( float )i / ( float )NetworkChart.Series.Count;
InMainWindow.UpdateProgress( ( int )( Percent * 100 ) );
NetworkChart.Series[i].Points.Clear();
}
InMainWindow.ShowProgress( true );
NetworkChart.ResetAutoValues();
NetworkChart.Invalidate();
NetworkChart.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false;
NetworkChart.ChartAreas[0].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;
NetworkChart.ChartAreas[0].AxisX.ScrollBar.Size = 15;
NetworkChart.ChartAreas[0].AxisX.ScrollBar.ButtonColor = Color.LightGray;
NetworkChart.ChartAreas[0].AxisY.ScrollBar.IsPositionedInside = false;
NetworkChart.ChartAreas[0].AxisY.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;
NetworkChart.ChartAreas[0].AxisY.ScrollBar.Size = 15;
NetworkChart.ChartAreas[0].AxisY.ScrollBar.ButtonColor = Color.LightGray;
int FrameCounter = 0;
foreach( PartialNetworkStream RawFrame in NetworkStream.Frames )
{
if ( FrameCounter % 1000 == 0 )
{
float Percent = ( float )FrameCounter / ( float )NetworkStream.Frames.Count;
InMainWindow.UpdateProgress( ( int )( Percent * 100 ) );
}
PartialNetworkStream Frame = RawFrame.Filter( InFilterValues );
if( Frame.EndTime == Frame.StartTime )
{
throw new InvalidOperationException();
}
float OneOverDeltaTime = 1 / (Frame.EndTime - Frame.StartTime);
int OutgoingBandwidth = Frame.UnrealSocketSize + Frame.OtherSocketSize + NetworkStream.PacketOverhead * ( Frame.UnrealSocketCount + Frame.OtherSocketCount );
InMainWindow.AddChartPoint( SeriesType.OutgoingBandwidthSize, FrameCounter, OutgoingBandwidth );
InMainWindow.AddChartPoint( SeriesType.OutgoingBandwidthSizeSec, FrameCounter, OutgoingBandwidth * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.ActorCount, FrameCounter, Frame.ActorCount );
InMainWindow.AddChartPoint( SeriesType.PropertySize, FrameCounter, Frame.ReplicatedSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.PropertySizeSec, FrameCounter, Frame.ReplicatedSizeBits / 8 * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.RPCSize, FrameCounter, Frame.RPCSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.RPCSizeSec, FrameCounter, Frame.RPCSizeBits / 8 * OneOverDeltaTime );
#if true
InMainWindow.AddChartPoint( SeriesType.ActorCountSec, FrameCounter, Frame.ActorCount * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.PropertyCount, FrameCounter, Frame.PropertyCount );
InMainWindow.AddChartPoint( SeriesType.PropertyCountSec, FrameCounter, Frame.PropertyCount * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.RPCCount, FrameCounter, Frame.RPCCount );
InMainWindow.AddChartPoint( SeriesType.RPCCountSec, FrameCounter, Frame.RPCCount * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.ExportBunchCount, FrameCounter, Frame.ExportBunchCount );
InMainWindow.AddChartPoint( SeriesType.ExportBunchSize, FrameCounter, Frame.ExportBunchSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.MustBeMappedGuidsCount, FrameCounter, Frame.MustBeMappedGuidCount / 8 );
InMainWindow.AddChartPoint( SeriesType.MustBeMappedGuidsSize, FrameCounter, Frame.MustBeMappedGuidSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.SendAckCount, FrameCounter, Frame.SendAckCount );
InMainWindow.AddChartPoint( SeriesType.SendAckCountSec, FrameCounter, Frame.SendAckCount * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.SendAckSize, FrameCounter, Frame.SendAckSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.SendAckSizeSec, FrameCounter, Frame.SendAckSizeBits / 8 * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.ContentBlockHeaderSize, FrameCounter, Frame.ContentBlockHeaderSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.ContentBlockFooterSize, FrameCounter, Frame.ContentBlockFooterSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.PropertyHandleSize, FrameCounter, Frame.PropertyHandleSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.SendBunchCount, FrameCounter, Frame.SendBunchCount );
InMainWindow.AddChartPoint( SeriesType.SendBunchCountSec, FrameCounter, Frame.SendBunchCount * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.SendBunchSize, FrameCounter, Frame.SendBunchSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.SendBunchSizeSec, FrameCounter, Frame.SendBunchSizeBits / 8 * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.SendBunchHeaderSize, FrameCounter, Frame.SendBunchHeaderSizeBits / 8 );
InMainWindow.AddChartPoint( SeriesType.GameSocketSendSize, FrameCounter, Frame.UnrealSocketSize );
InMainWindow.AddChartPoint( SeriesType.GameSocketSendSizeSec, FrameCounter, Frame.UnrealSocketSize * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.GameSocketSendCount, FrameCounter, Frame.UnrealSocketCount );
InMainWindow.AddChartPoint( SeriesType.GameSocketSendCountSec, FrameCounter, Frame.UnrealSocketCount * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.ActorReplicateTimeInMS, FrameCounter, Frame.ActorReplicateTimeInMS);
#endif
#if false
InMainWindow.AddChartPoint( SeriesType.MiscSocketSendSize, FrameCounter, Frame.OtherSocketSize );
InMainWindow.AddChartPoint( SeriesType.MiscSocketSendSizeSec, FrameCounter, Frame.OtherSocketSize * OneOverDeltaTime );
InMainWindow.AddChartPoint( SeriesType.MiscSocketSendCount, FrameCounter, Frame.OtherSocketCount );
InMainWindow.AddChartPoint( SeriesType.MiscSocketSendCountSec, FrameCounter, Frame.OtherSocketCount * OneOverDeltaTime );
#endif
//.........这里部分代码省略.........
示例8: ResetEigenValueChart
/// <summary>
/// 伝搬定数分散特性(グラフの初期化
/// </summary>
/// <param name="chart1"></param>
public void ResetEigenValueChart(Chart chart1)
{
double normalizedFreq1 = FemSolver.GetNormalizedFreq(FirstWaveLength, WaveguideWidth);
normalizedFreq1 = Math.Round(normalizedFreq1, 2);
double normalizedFreq2 = FemSolver.GetNormalizedFreq(LastWaveLength, WaveguideWidth);
normalizedFreq2 = Math.Round(normalizedFreq2, 2);
// 表示モード数
int showMaxMode = ShowMaxMode;
/*
if (MaxMode > 0)
{
showMaxMode = MaxMode;
}
*/
// チャート初期化
setupChartColor(chart1);
chart1.Titles[0].Text = "規格化伝搬定数周波数特性";
chart1.ChartAreas[0].Axes[0].Title = "2W/λ";
chart1.ChartAreas[0].Axes[1].Title = "β/ k0";
SetChartFreqRange(chart1, normalizedFreq1, normalizedFreq2);
chart1.ChartAreas[0].Axes[1].Minimum = 0.0;
//chart1.ChartAreas[0].Axes[1].Maximum = 1.0; // 誘電体比誘電率の最大となるので可変
chart1.ChartAreas[0].Axes[1].Interval = 0.2;
chart1.Series.Clear();
if (!isInputDataReady())
{
//MessageBox.Show("入力データがセットされていません", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
for (int portIndex = 0; portIndex < Ports.Count; portIndex++)
{
for (int modeIndex = 0; modeIndex < showMaxMode; modeIndex++)
{
Series series = new Series();
series.Name = string.Format("TE{0}0 at {1}", modeIndex + 1, portIndex + 1);
series.ChartType = SeriesChartType.Line;
chart1.Series.Add(series);
}
}
// 計算されたグラフのプロパティ値をAutoに設定
chart1.ResetAutoValues();
}
示例9: drawChart
/// <summary>
/// チャート更新
/// </summary>
/// <param name="targetChart"></param>
/// <param name="targetColPos"></param>
private void drawChart(Chart targetChart, int targetColPos)
{
targetChart.Series.Clear();
if (targetColPos < 0)
{
return;
}
Series series = new Series();
series.ChartType = SeriesChartType.FastPoint;
series.MarkerSize = 2;
series.MarkerStyle = MarkerStyle.Circle;
series.ToolTip = "#VALX{D}, #VAL{D}";
for (int ii = 0; ii < dataGridView.Rows.Count; ii++)
{
if (dataGridView.Rows[ii].Cells[targetColPos].Value == null
|| "".Equals(dataGridView.Rows[ii].Cells[targetColPos].Value.ToString()))
{
break;
}
DataPoint point = series.Points.Add(Convert.ToDouble(dataGridView.Rows[ii].Cells[targetColPos].Value));
point.XValue = Convert.ToDouble(dataGridView.Rows[ii].Cells[0].Value.ToString());
point.AxisLabel = dataGridView.Rows[ii].Cells[0].Value.ToString();
}
targetChart.Series.Add(series);
targetChart.ResetAutoValues();
}