C# ChartControl 避免日期显示过于密集

需要设置X轴的日期格式

 

代码示例如下

 

                                XYDiagram xy = chartControl1.Diagram as XYDiagram;
                                if (xy != null)
                                {
                                    xy.AxisX.DateTimeOptions.Format = DateTimeFormat.Custom;
                                    xy.AxisX.DateTimeOptions.FormatString = "MM-dd";
                                }

 

posted @ 2014-11-30 11:32  逍遥子k  阅读(607)  评论(0编辑  收藏  举报