本文实例讲述了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);
}
运行效果如下图所示:
希望本文所述对大家的C#程序设计有所帮助。
您可能感兴趣的文章:DevExpress之饼状图突出(Explode)设置实例DevExpress之ChartControl实现饼状图百分比演示实例DevExpress之ChartControl实现时间轴实例DevExpress之ChartControl的SeriesTemplate实例DevExpress之ChartControl实现柱状图演示实例DevExpress之SplashScreen用法实例DevExpress获取节点下可视区域子节点集合的实现方法DevExpress实现为TextEdit设置水印文字的方法DevExpress之ChartControl用法实例总结DevExpress之TreeList用法实例总结DevExpress设置饼状图的Lable位置实例