我尝试使用二维数组中的一组数据以对数刻度生成图表。
我将X轴标记为频率(以MHz为单位),将我的Y轴设置为以dBm为单位的幅度,并希望以30MHz开始我的X轴。
当我将x轴设置为30MHz时,它会抛弃我的对数刻度。有没有办法保持30MHz的对数刻度的完整性并显示小的划分?
附上我的图表和用于生成图表的代码。
谢谢!
for (int i = 29; i < freqdrive.Length; i++)
{
string[] lineSplit = freqdrive[i].Split(',');
frequency[i] = lineSplit[0];
pwr[i] = lineSplit[1];
double.TryParse(frequency[i], out FreqLenDbl[i]);
double.TryParse(pwr[i], out pwrLenDbl[i]);
FreqLenDblMHz[i] = FreqLenDbl[i] / 1000000;
}
for (int i = 29; i < freqdrive.Length; i++)
{
this.EmissionsChart.Series["Series1"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
this.EmissionsChart.ChartAreas[0].AxisX.IsLogarithmic = true;
this.EmissionsChart.ChartAreas[0].AxisX.MinorGrid.Interval = 1;
this.EmissionsChart.ChartAreas[0].AxisX.MinorGrid.Enabled = true;
this.EmissionsChart.ChartAreas[0].AxisX.Minimum = 1;
this.EmissionsChart.ChartAreas[0].AxisX.Maximum = 1000;
this.EmissionsChart.Series["Series1"].Points.AddXY(FreqLenDblMHz[i], pwrLenDbl[i]);
}