DevExpress之ChartControl创建Drill-Down样式的Title实例
时间:2020-10-06 21:52:50|栏目:.NET代码|点击: 次
本文实例讲述了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);
}
/// 创建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#程序设计有所帮助。
栏 目:.NET代码
下一篇:ASP.NET MVC 从IHttp到页面输出的实例代码
本文标题:DevExpress之ChartControl创建Drill-Down样式的Title实例
本文地址:http://www.codeinn.net/misctech/7414.html