[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);
        }
运行效果:
希望有所帮助!谢谢!
 

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

时间: 2024-11-20 00:31:11

[DevExpress]ChartControl 创建Drill-Down样式的Title的相关文章

DevExpress ChartControl大数据加载时有哪些性能优化方法

DevExpress ChartControl加载大数据量数据时的性能优化方法有哪些? 关于图表优化,可从以下几个方面解决: 1.关闭不需要的可视化的元素(如LineMarkers, Labels等): Series.View.LineMarkerOptions.Visible =false. 2. 关闭图表的滚动与缩放功能,手动调整范围,这样将大大减少所需计算的个数. 3. 将 ChartControl.RefreshDataOnRepaint属性设为false 4. 将 ChartContr

JavaScript 创建DIV 设置样式不起作用,很多都是因为设置样式的顺序问题

JavaScript 创建DIV 设置样式不起作用,很多都是因为设置样式的顺序问题,因为有的样式需要之前设置其他样式才能生效,推荐的样式排序如下: insertDIV:function(){ var divId=document.getElementById("divContainer"); if(divId){ divId.style.display="block";   //作用:一般这种需要设置退出时候就消失了,可以设置display为none隐藏,那么再添加

[DevExpress]ChartControl之创建X,Y轴Title示例

关键代码: /// <summary> /// 设置X轴Title /// </summary> /// <param name="chart">ChartControl</param> /// <param name="titleText">Title文字</param> /// <param name="titleColor">Title文字颜色</pa

[DevExpress]ChartControl之创建Strip示例

关键代码: /// <summary> /// 创建Strip /// </summary> /// <param name="chart">ChartControl</param> /// <param name="strip">Strip</param> /// <param name="stripLable">Strip文字</param> //

DevExpress ChartControl 样式设置

第三方控件,设置ChartControl的样式,仅供参考 Demo: <Grid> <Grid.Resources> <SolidColorBrush x:Key="GridLineBursh" Color="CornflowerBlue"></SolidColorBrush> </Grid.Resources> <dxc:ChartControl Background="Transpare

[DevExpress]ChartControl之基准线示例

关键代码: /// <summary> /// 创建基准线ConstantLine /// </summary> /// <param name="chart">ChartControl</param> /// <param name="ctAxisValue">基准线数值</param> /// <param name="ctLegendText">基准线图例文

WPF DevExpress ChartControl使用之XYDiagram

WPF使用Dev和WinForm有许多不同,相对而言,WPF要更简单和炫酷一点,我只做了一点基本的功能,没有仔细的研究,这里只介绍一下WPF Dev ChartControl绘制XYDiagram的基础. XYDiagramControl.xaml页面 <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microso

WPF DevExpress 设置雷达图Radar样式

  DevExpress中定义的ChartControl很不错,很多项目直接使用这种控件. 本节讲述雷达图的样式设置 <Grid> <Grid.Resources> <DataTemplate x:Key="LabelItemDataTemplate" DataType="dxc:SeriesLabelItem"> <Border CornerRadius="8" Padding="8,1&qu

[DevExpress]ChartControl之时间轴示例

关键代码: using System; using System.Data; using System.Windows.Forms; using DevExpress.XtraCharts; namespace DevExpressChart { public partial class winDateTime : Form { public winDateTime() { InitializeComponent(); } private void winDateTime_Load(object