【发布时间】:2014-05-05 13:06:09
【问题描述】:
我有一个微软图表控件,我使用StripLine。
如何使StripLine 出现在数据点的前面。目前,带状线隐藏在一些数据后面。
图表是面积图。
【问题讨论】:
标签: c# .net winforms visual-studio-2010 mschart
我有一个微软图表控件,我使用StripLine。
如何使StripLine 出现在数据点的前面。目前,带状线隐藏在一些数据后面。
图表是面积图。
【问题讨论】:
标签: c# .net winforms visual-studio-2010 mschart
据我所知,StripLine 将始终绘制在数据点后面。一种捏造这个howerver的方法是使用PostPaint事件处理程序并自己绘制矩形。
在处理程序中,您可以按如下方式获取绘图坐标
private void chart_PostPaint(object sender, ChartPaintEventArgs e)
{
ChartArea a = sender as ChartArea;
if (a != null)
{
Gaphics g = e.ChartGrpahics.Graphics;
RectangleF r = e.ChartGraphics.GetAbsoluteRectangle(new RectangleF(0,0,10,50)); // the rect you need
g.FillRectangle(new Brushes.Yellow, r);
}
}
【讨论】: