DevExpress]ChartControl 创建Drill-Down样式的Title

关键代码:

        /// <summary>
        /// 创建Drill-Down样式的Title
        /// </summary>
        /// <param name="chart">ChartControl</param>
        /// <param name="title">title文字</param>
        /// <param name="visible">是否可见</param>
        public static void AddDrillDownTitle(this ChartControl chart, string title, bool visible)
        {
            ChartTitle _chartTitle = new ChartTitle();
            _chartTitle.Alignment = StringAlignment.Near;
            _chartTitle.Antialiasing = false;
            _chartTitle.Font = new Font("Tahoma", 10F, FontStyle.Underline);
            _chartTitle.Indent = 20;
            _chartTitle.Text = title;
            _chartTitle.TextColor = Color.RoyalBlue;
            _chartTitle.Visible = false;
            chart.Titles.Add(_chartTitle);
        }
运行效果:
image
posted on 2015-01-15 18:38  zrSoldier  阅读(402)  评论(0编辑  收藏  举报