I have a microsoft chart control and I use a StripLine
. How do I make the StripLine
appear in front of the data points. Currently the strip line is hidden behind some data. The chart is an area chart.
As far as I'm aware StripLine
will always be drawn behind the data points. One way to fudge this howerver would be to use a PostPaint
event handler and draw the rectangle yourself.
inside the handler your can get drawing coordinates as follows
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);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.