Two ways..:
In order to place it correctly you will need to know exactly what you want.

Here is the example code to produce the above image:
chart1.Images.Add(new NamedImage("gradient", Image.FromFile(yourImagePath)));
ImageAnnotation imgA = new ImageAnnotation();
imgA.Image = "gradient";
imgA.ImageWrapMode = ChartImageWrapMode.Scaled;
imgA.IsSizeAlwaysRelative = false;
imgA.AxisY = ay;
imgA.Y = ay.Minimum;
imgA.Height = ay.Maximum - ay.Minimum;
imgA.X = 0;
imgA.Width = 3;
chart1.Annotations.Add(imgA);
Chart coordinates are tricky.
Note that the Height
and Y
are in axis value coordinates
since I have associated the Annotation with the Y-Axis as I also turned off IsSizeAlwaysRelative
.
By default Annotatons
are in relative coordinates, ie percentages of the respective containers. The horizontal numbers still are relative, so the 3
means 3%
of the chart's width and the X = 0
positions the Annotation
at the left egde..
Second way:
- To place an image inside the plot area but below all gridlines and points you can use a
StripLine
instead of the Annotation
. See here.
Example:
StripLine sl = new StripLine();
sl.IntervalOffset = -1;
sl.Interval = 0;
sl.StripWidth = 0.33;
sl.BorderWidth = 0;
sl.BackImage = "gradient";
sl.BackImageWrapMode = ChartImageWrapMode.Scaled;
ax.StripLines.Add(sl);

Note that StripLines
are in axis value coordinates!
The image should be added to the Chart.Images
as a NamedImage
.. When you do a chart.SaveImage
the annotation or the stripline will be included..