0

Is there a way to paint each of the 4 quadrants with a different background color? I'm using BackColor but it paints the whole chart. I can't find how to customize by area, axis, or anything.

chart1.ChartAreas[0].BackColor = Color.AliceBlue;

this is my chart:

This is my chart:

And I want it to look like this

And I want it to look like this one:

EduardoT80
  • 19
  • 1
  • 5
  • While you could use a PaintXXX event to fill 4 rectangles you can also use StripLines.. – TaW May 22 '20 at 13:09
  • I tried StripLines but the problem is that they overlap, so I'm not able to have 4 different colors at the same time – EduardoT80 May 22 '20 at 13:13
  • and the rectangles would be object on the top, so they'll cover my grid lines, which is not useful – EduardoT80 May 22 '20 at 13:14
  • You are right about the striplines: each will always go across the whole axis, so to combine them you would have the pick semi-transparent colors that look good when being mixed. Not so easy. But the painted rectangles will look ok with semi-transparent colors imo. - The last resort would be RectangleAnnotations but I don't think they'll go behind the gridlines either.. – TaW May 22 '20 at 13:22
  • Final idea: You could make the chart and chartareas' backcolors transparent, nest the chart in a panel and set the panel's Tag to the [innerplotposition](https://stackoverflow.com/questions/36491231/ms-chart-rectangular-annotation-width-in-percent-and-not-pixel/36497262#36497262) of the chart in one of the chart's events. Then the panel could use the ractangle in its tag to fil the colors; this would create a true background fill. Dock the chart and anchor the panel as you would anchor the chart..! – TaW May 22 '20 at 14:07

0 Answers0