社区
图表区
帖子详情
UltraChart 颜色的设置
li_jingjing_127108
2011-08-23 11:26:02
在Winform的项目上使用Ultrachart控件,图形的类型为ColumnLineChart,已经分别为ColumnData和LineData绑定了数据源,
但是图形中得柱状图和折线的颜色相同,因为显示的是不同的数据需要用颜色区别开,如何设置才能使柱状图和折线的颜色不同呢?
...全文
192
1
打赏
收藏
UltraChart 颜色的设置
在Winform的项目上使用Ultrachart控件,图形的类型为ColumnLineChart,已经分别为ColumnData和LineData绑定了数据源, 但是图形中得柱状图和折线的颜色相同,因为显示的是不同的数据需要用颜色区别开,如何设置才能使柱状图和折线的颜色不同呢?
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
li_jingjing_127108
2011-08-23
打赏
举报
回复
1
在infragistics的论坛上找到了答案,把解决方法放上来!也方便别人查找!
//设置折线的颜色
private void chart_Trend_ChartDrawItem(object sender, Infragistics.UltraChart.Shared.Events.ChartDrawItemEventArgs e)
{
if (e.Primitive is Polyline)
{
e.Primitive.PE = new PaintElement(Color.Firebrick);
}
}
//设置Legend标注的颜色!
private void chart_Trend_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
{
for (int current = 0; current < e.SceneGraph.Count; current++)
{
Primitive currentPrim = e.SceneGraph[current];
bool legendBox = currentPrim is Box && currentPrim.Path != null && currentPrim.Path.Contains("Legend") && currentPrim.Row == 0;
if (legendBox && current < e.SceneGraph.Count - 1)
{
Text nextLabel = e.SceneGraph[current + 1] as Text;
if (nextLabel != null && nextLabel.GetTextString() == "行业指数")
{
currentPrim.PE = new PaintElement(Color.Firebrick);
}
}
}
Ul
traC
hart
之 图形
颜色
设置
在处理二维柱状图、折线图、饼状图时可能经常会要区分
颜色
。在属性 ColorModel中可以
设置
颜色
。可以选择随机的
颜色
,纯白色,自定义
颜色
等。一般我选择自定义,这样可以是图表分析出的结果显示依照自己的定制。在柱状图中,可以随便定制十种
颜色
然后让它循环。
Ul
traC
hart
相关
设置
Infragistics.Win.
Ul
traWinC
hart
.
Ul
traC
hart
c
hart
=newInfragistics.Win.
Ul
traWinC
hart
.
Ul
traC
hart
();;if(Cds.Tables.Count>0){c
hart
.Anchor=((System.Windows.Fo...
Infragistics-
Ul
traC
har-新增目标线
Ul
traC
har新增目标线 Imports System.IO Imports System.Data Imports System.Collections Imports System.ComponentModel Imports System.Windows.Forms Imports Infragistics.
Ul
traC
hart
.Core Imports Infragistics.U
转 C
hart
C
hart
s are fun and apparently usef
ul
. They give people the ability to relate information quickly and effectively. They show trends and patterns through the use of polygons in different locations and
图表区
4,818
社区成员
14,133
社区内容
发帖
与我相关
我的任务
图表区
.NET技术 图表区
复制链接
扫一扫
分享
社区描述
.NET技术 图表区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章