Point Image

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Point Image

Post by amol » Fri May 30, 2014 10:24 am

I need to show a point with attached shape. kindly confirm how can i implement this using teechart.
Attachments
1.png
Point shape
1.png (350 Bytes) Viewed 14492 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Point Image

Post by Christopher » Fri May 30, 2014 11:22 am

amol wrote:I need to show a point with attached shape. kindly confirm how can i implement this using teechart.
You can use the image itself in an ImagePoint series, or draw it directly onto the canvas, e.g.

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      ImagePoint point = new ImagePoint(tChart1.Chart);
      point.PointImage = Image.FromFile(@"C:\tmp\1.png");
      point.Pointer.HorizSize = 30;
      point.Pointer.VertSize = 20;
      point.FillSampleValues();

      tChart1.AfterDraw += tChart1_AfterDraw;
    }

    void tChart1_AfterDraw(object sender, Graphics3D g)
    {
      g.Draw(Utils.FromLTRB(10, 10, 70, 50), Image.FromFile(@"C:\tmp\1.png"), true);
    }
Is that what you meant?
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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Point Image

Post by amol » Tue Jun 03, 2014 6:45 am

I am not able to give the title of ImagePoint, plz answer this.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Point Image

Post by Christopher » Tue Jun 03, 2014 7:44 am

amol wrote:I am not able to give the title of ImagePoint, plz answer this.
I'm not sure what the problem is here. The following code works as expected, with the series title being correctly displayed in the legend:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      ImagePoint point = new ImagePoint(tChart1.Chart);
      point.PointImage = Image.FromFile(@"D:\tmp\1.png");
      point.Pointer.HorizSize = 30;
      point.Pointer.VertSize = 20;
      point.FillSampleValues();

      point.Title = "My Point";

      tChart1.Legend.LegendStyle = LegendStyles.Series;
    }
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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Point Image

Post by amol » Wed Jun 04, 2014 8:03 am

thx it works

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Point Image

Post by amol » Tue Jun 10, 2014 7:16 am

Hi ,

I have taken Point not taken ImagePoint and coded then how can i achieve this using Point. plz suggest.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Point Image

Post by Christopher » Tue Jun 10, 2014 10:20 am

amol wrote:Hi ,

I have taken Point not taken ImagePoint and coded then how can i achieve this using Point. plz suggest.
I'm sorry, I'm afraid I don't understand your request. Could you please provide some code to show me what you need?
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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Point Image

Post by amol » Fri Jun 13, 2014 6:30 am

You have taken ImagePoint point = new ImagePoint(tChart1.Chart) in your example but i have taken Point ps=new Point(). i want to achieve same functionality using Point how can i achieve this?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Point Image

Post by Narcís » Fri Jun 13, 2014 7:18 am

Hello amol,

ImagePoint is the specific series style, which is derived from Points series, to plot images as pointers. If you don't want to use ImagePoint series you can achieve almost the same creating your own custom series, deriving it from Points series and overriding its drawing methods as in the example I posted here: http://www.teechart.net/support/viewtopic.php?t=4309
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply