我想以不同的颜色显示一周中的每一天(星期一红色、星期二绿色等),但在图表中正确显示数据时遇到问题。
我每天都有系列。但是使用ChartType:column时,图表每天都显示得很丑(参见此处的图片:http: //i49.tinypic.com/oszeqt.png)。
图表中的数据:
01:12000
02:12500
03:13000
04:13500
05:14029
06:14509
07:15000
08:15500
09:16000
10:16500
11:17000
12:17125
一点代码
DateTime dateValue = new DateTime(2012, 5, int.Parse(tempDay));
switch ((int)dateValue.DayOfWeek)
{
case 1:
chart1.Series["Monday"].Points.AddXY(int.Parse(tempDay), int.Parse(tempTime));
break;
case 2:
chart1.Series["Tuesday"].Points.AddXY(int.Parse(tempDay), int.Parse(tempTime));
break;
case 3:
chart1.Series["Wednesday"].Points.AddXY(int.Parse(tempDay), int.Parse(tempTime));
break;
case 4:
chart1.Series["Thursday"].Points.AddXY(int.Parse(tempDay), int.Parse(tempTime));
break;
case 5:
chart1.Series["Friday"].Points.AddXY(int.Parse(tempDay), int.Parse(tempTime));
break;
case 6:
chart1.Series["Saturday"].Points.AddXY(int.Parse(tempDay), int.Parse(tempTime));
break;
case 7:
chart1.Series["Sunday"].Points.AddXY(int.Parse(tempDay), int.Parse(tempTime));
break;
}
我的问题:如何正确显示每一列的颜色。(我不需要每天都有单独的系列。)