DevExpress设置饼状图的Lable位置实例
时间:2020-10-04 14:42:51|栏目:.NET代码|点击: 次
本文实例讲述了DevExpress设置饼状图的Lable位置的方法。分享给大家供大家参考。具体实现方法如下:
关键代码如下:
复制代码 代码如下:
/// <summary>
/// 设置饼状图的Lable位置
/// </summary>
/// <param name="series">Series</param>
/// <param name="lablePosition">PieSeriesLabelPosition枚举</param>
public static void SetLablePosition(this Series series, PieSeriesLabelPosition lablePosition)
{
if (series.Label is PieSeriesLabel)
{
PieSeriesLabel _label = series.Label as PieSeriesLabel;
_label.Position = lablePosition;
}
//if (series.Label is Pie3DSeriesLabel)
//{
// Pie3DSeriesLabel _label = series.Label as Pie3DSeriesLabel;
// _label.Position = lablePosition;
//}
/// 设置饼状图的Lable位置
/// </summary>
/// <param name="series">Series</param>
/// <param name="lablePosition">PieSeriesLabelPosition枚举</param>
public static void SetLablePosition(this Series series, PieSeriesLabelPosition lablePosition)
{
if (series.Label is PieSeriesLabel)
{
PieSeriesLabel _label = series.Label as PieSeriesLabel;
_label.Position = lablePosition;
}
//if (series.Label is Pie3DSeriesLabel)
//{
// Pie3DSeriesLabel _label = series.Label as Pie3DSeriesLabel;
// _label.Position = lablePosition;
//}
}
运行效果如下图所示:
希望本文所述对大家的C#程序设计有所帮助
栏 目:.NET代码
下一篇:C#中Trim()、TrimStart()、TrimEnd()的用法介绍
本文标题:DevExpress设置饼状图的Lable位置实例
本文地址:http://www.codeinn.net/misctech/6660.html