我有一个微软图表控件,我使用StripLine
。
如何使StripLine
出现在数据点的前面。目前,带状线隐藏在一些数据背后。
该图表是面积图。
答案 0 :(得分:2)
据我所知,StripLine
始终会被吸引到数据点后面。捏造这种方法的一种方法是使用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);
}
}