答案 0 :(得分:1)
分别更改每个MarkerSize
上的DataPoint
属性
答案 1 :(得分:0)
您可以使用像这样的区域类型图表:
设置
Series s1 = chart1.Series.Add("S1");
s2.ChartType = SeriesChartType.Area;
ChartArea ca = chart1.ChartAreas[0];
ca.AxisX.Minimum = 0;
AddArea(chart1, s2, 12, 53, Color.SlateBlue);
AddArea(chart1, s2, 32, 63, Color.Firebrick);
AddArea(chart1, s2, 22, 23, Color.SlateBlue);
AddArea(chart1, s2, 62, 33, Color.Goldenrod);
AddArea(chart1, s2, 12, 33, Color.PaleVioletRed);
并添加如下内容:
int AddArea(Chart chart, Series s, double x, double y, Color color)
{
ChartArea ca = chart.ChartAreas[s.ChartArea];
Axis ax = ca.AxisX;
Axis ay = ca.AxisY;
if (s.Points.Count == 0) s.Points.AddXY(ax.Minimum, ay.Minimum);
DataPoint dp0 = s.Points.Last();
int p1 = s.Points.AddXY(dp0.XValue, y);
s.Points.AddXY(dp0.XValue + x, y);
s.Points.Last().Color = color;
s.Points.AddXY(dp0.XValue + x, ay.Minimum);
dp0.Color = color;
s.Points.Last().Color = color;
return p1;
}