DevExpress之ChartControl创建Drill-Down样式的Title实例
程序员文章站
2023-12-16 09:41:46
本文实例讲述了devexpress中chartcontrol创建drill-down样式的title实现方法。分享给大家供大家参考。具体实现方法如下:
关键代码如下:...
本文实例讲述了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#程序设计有所帮助。