5
WinForms 앱에서 MS 차트 컨트롤을 사용하여 레이더 차트를 그립니다.MS 차트 레이더 축 주파수
이 차트에는 1 일 동안의 데이터가 포함되어 있으며 매 초당 데이터가 있으므로 8600 x-y 값 쌍이 있습니다. X 축은 날짜를 포함하고, y는 int 값을가집니다.
내 테스트 코드는 다음과 같다 :
var fromDate = new DateTime(DateTime.Now.Year,
DateTime.Now.Month,
DateTime.Now.Day,
0,
0,
0);
var toDate = new DateTime(DateTime.Now.Year,
DateTime.Now.Month,
DateTime.Now.Day,
23,
59,
59);
List<DateTime> xValues = new List<DateTime>();
List<double> yValues = new List<double>();
var iterDate = fromDate;
var i = 0;
while (iterDate <= toDate)
{
xValues.Add(iterDate);
yValues.Add(i);
iterDate = iterDate.AddSeconds(1);
i++;
}
chart1.Series["Default"].Points.DataBindXY(xValues, yValues);
var dateLabelStyle = new LabelStyle();
dateLabelStyle.Format = "HH:mm:ss";
chart1.ChartAreas["Default"].AxisX.LabelStyle = dateLabelStyle;
chart1.ChartAreas["Default"].AxisX.Minimum = fromDate.ToOADate();
chart1.ChartAreas["Default"].AxisX.Maximum = toDate.ToOADate();
chart1.Series["Default"].IsXValueIndexed = true;
chart1.Series["Default"].ChartType = SeriesChartType.Radar;
chart1.Series["Default"]["RadarDrawingStyle"] = "Line";
chart1.Series["Default"]["AreaDrawingStyle"] = "Circle";
chart1.Series["Default"]["CircularLabelsStyle"] = "Horizontal";
chart1.ChartAreas["Default"].Area3DStyle.Enable3D = false;
결과보기는 다음과 같이이다 :
나는 '검은 원 효과'의 이유는 모든 86 y 축을 그립니다 생각 400 점. 매 시간마다이 축을 그리도록 어떻게 설정할 수 있습니까?
x 축에 대한 레이블 (설정된대로 날짜)이 표시되지 않습니다. 어떻게 보여줄 수 있습니까?
미리 Thx!
.net4/C#/윈폼/VS2010
당신은 아마 대신 "레이더"의 "극"음모를 사용하려면
감사합니다! – Tom