问题描述
- C#怎么把散点图画在chart控件上?
-
我这样写的。貌似不对。新手。x,y中分别存着n个double型的数据。我想把(x[i],y[i])显示在图上。(i=0到n-1)
this.chart1.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;this.chart1.ChartAreas[0].AxisY.Maximum = 5.0D; this.chart1.ChartAreas[0].AxisY.Minimum = 0.0D; this.chart1.ChartAreas[0].CursorY.Interval = 0.01D; this.chart1.ChartAreas[0].AxisX.Maximum = 60.0D; this.chart1.ChartAreas[0].AxisX.Minimum = 0.0D; this.chart1.ChartAreas[0].CursorX.Interval = 0.01D; this.chart1.ChartAreas[0].CursorX.IntervalOffset = 0.01D; for(int i=0;i<c1.y.Length;i++) { double x2; double y2; x2 = (double)x[i]; y2 = (double)y[i]; } this.chart1.Series[0].Points.AddXY(x2, y2);
解决方案
建议试下telerik,官方demo也很详细的。记得有撒点图
时间: 2025-01-31 01:53:48