Page 1 of 1

Plotting Bitmaps on a Chart.

Posted: Fri Aug 13, 2010 5:07 am
by 8751509
Greetings,

I would like to plot many bitmaps on the Chart to annotate points of interest (I have icon markers for all sorts of interesting things on a Stock)... looking something like the following image .
Bitmap Question.png
Bitmap Question.png (16.41 KiB) Viewed 3677 times
I kind of asked this before and was directed here http://www.teechart.net/support/viewtopic.php?t=4309
But I cannot make heads nor tails out of that snippet .... how do you actually plot the images where you want them.
It made sense up until the point where FillSampleValues() was called. Kind of ...

i.e. how do you set an images x , y values so it appears in the correct place on the chart.

I'm guessing I dont plot them individually but they are part of a series ... if this is the case do they have to be all the same for that series ?? (I hope not)
Cheers Phil.

Re: Plotting Bitmaps on a Chart.

Posted: Fri Aug 13, 2010 3:49 pm
by yeray
Hi Phil,

I'm not sure to understand what is your exact problem. If you know the X and Y values where you have to draw your images, you can use Add method of the ImagePoint series:

Code: Select all

            Steema.TeeChart.Styles.ImagePoint PntGreen = new Steema.TeeChart.Styles.ImagePoint(tChart1.Chart);
            Steema.TeeChart.Styles.ImagePoint PntPurple = new Steema.TeeChart.Styles.ImagePoint(tChart1.Chart);
            Steema.TeeChart.Styles.ImagePoint PntRed = new Steema.TeeChart.Styles.ImagePoint(tChart1.Chart);
            PntGreen.PointImage = Image.FromFile(@"C:\tmp\16_button_green.bmp");
            PntPurple.PointImage = Image.FromFile(@"C:\tmp\16_button_purple.bmp");
            PntRed.PointImage = Image.FromFile(@"C:\tmp\16_button_red.bmp");

            PntGreen.Add(5, 10);
            PntGreen.Add(10, 10);
            PntGreen.Add(15, 10);

            PntPurple.Add(3, 5);
            PntPurple.Add(5, 7);

            PntRed.Add(7, 5);
            PntRed.Add(12, 2);
Chart1.png
Chart1.png (32.28 KiB) Viewed 3668 times

Re: Plotting Bitmaps on a Chart.

Posted: Mon Aug 16, 2010 1:40 am
by 8751509
Thanks again Yeray,

I think I had a mental block with that one ... I dont understand my own question now ... ;-)

Re: Plotting Bitmaps on a Chart.

Posted: Mon Aug 16, 2010 8:47 am
by yeray
Hi Snarkle,

:lol:
I'm glad to unblock it!