Can we use annotation tool to add an image with TeeChart for .Net using WPF?
The forum, in one of the answers does provide a snippet to add an image. The primary understanding is that the code snippet is for TeeChart for .Net and it should work with WPF. We observe that it does not work at our end with WPF.
Is there any other way we can add an image? Are there any other features for adding a small annotation image on / above the chart area?
How to add an image to annotation tool
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to add an image to annotation tool
The following code works as expected with TeeChart.WPF.dll version 4.1.2014.12150:Dev01 wrote:
Is there any other way we can add an image? Are there any other features for adding a small annotation image on / above the chart area?
Code: Select all
Annotation tool = new Annotation();
Line series = new Line();
private void InitializeChart()
{
//series = new LinePoint(tChart1.Chart);
//series.FillSampleValues();
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
tChart1.Series.Add(series);
series.FillSampleValues();
tChart1.Tools.Add(tool);
tool.Text = "Hello there";
tool.AutoSize = false;
tool.Height = 200;
tool.Width = 300;
tool.Shape.Image = new BitmapImage(new Uri(@"C:\MyPath\myimage.png"));
}
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 |
Re: How to add an image to annotation tool
Thank you Christopher. I have tried the same code, but with TeeChart.WPF.dll version 4.1.2014.5092. This does not work as expected.
We see the mulitple images tiled in the Annotation tool. We have tried all the different properties related to image for the Annotation tool (Like Strech, Fit, etc.) Still we see the same.
Is this related to the version I use? Is there any other way we can achieve the functionality?
Is there a way we can add an image using TeeChart.dll in a WPF UI?
We see the mulitple images tiled in the Annotation tool. We have tried all the different properties related to image for the Annotation tool (Like Strech, Fit, etc.) Still we see the same.
Is this related to the version I use? Is there any other way we can achieve the functionality?
Is there a way we can add an image using TeeChart.dll in a WPF UI?
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to add an image to annotation tool
For absolute control of image rendering, you can use the AfterDraw event, e.g.Dev01 wrote:Is there a way we can add an image using TeeChart.dll in a WPF UI?
Code: Select all
Line series = new Line();
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
tChart1.Series.Add(series);
series.FillSampleValues();
tChart1.AfterDraw += tChart1_AfterDraw;
}
void tChart1_AfterDraw(object sender, Graphics3D g)
{
g.Draw(100, 100, new BitmapImage(new Uri(@"D:\Program Files (x86)\Steema Software\Steema TeeChart for .NET 2014 4.1.2014.05090\Docs\images\image003.jpg")));
}
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 |