How can I show a logo in the chart area?
I found that g.Draw(100, 100,img) in the BeforeDrawSeries does work, but I can't find a way to control the size or stretch the logo within a defined rectangle. Is there maybe a Teechart equivalent for e.Graphics.DrawImage(newImage, x, y, srcRect, units) that I'm not aware of?
I've also seen that this forum recommends to use the annotation tool for including images in charts, however my annotation tool only allows for text to be included, but not images? Is this feature limited to certain Teechart products?
Show logo in chart (c#)
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Show logo in chart (c#)
Hello,
I would say the easiest and most powerful way to draw images to the Chart is to use one of the Draw overloads within one of TChart's custom drawing events. Here's an example of what I mean, using an image which has been added as a resource to the project:
This gives me, as expected:
There are a number of TChart draw events which fire at different stages of TChart's rendering cycle, and these can be seen with reference to the Feature Demo on Steema's GitHub here - the relevant example being this one:
I would say the easiest and most powerful way to draw images to the Chart is to use one of the Draw overloads within one of TChart's custom drawing events. Here's an example of what I mean, using an image which has been added as a resource to the project:
Code: Select all
private void InitializeChart(TChart chart)
{
void Chart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
var image = new Bitmap(Resources.shell);
g.Draw(Utils.FromLTRB(100, 100, 300, 200), Utils.FromLTRB(0, 0, image.Width, image.Height), image, false);
}
chart.AfterDraw += Chart_AfterDraw;
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |