Page 1 of 1

Point Image

Posted: Fri May 30, 2014 10:24 am
by 9526439
I need to show a point with attached shape. kindly confirm how can i implement this using teechart.

Re: Point Image

Posted: Fri May 30, 2014 11:22 am
by Christopher
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?

Re: Point Image

Posted: Tue Jun 03, 2014 6:45 am
by 9526439
I am not able to give the title of ImagePoint, plz answer this.

Re: Point Image

Posted: Tue Jun 03, 2014 7:44 am
by Christopher
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;
    }

Re: Point Image

Posted: Wed Jun 04, 2014 8:03 am
by 9526439
thx it works

Re: Point Image

Posted: Tue Jun 10, 2014 7:16 am
by 9526439
Hi ,

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

Re: Point Image

Posted: Tue Jun 10, 2014 10:20 am
by Christopher
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?

Re: Point Image

Posted: Fri Jun 13, 2014 6:30 am
by 9526439
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?

Re: Point Image

Posted: Fri Jun 13, 2014 7:18 am
by narcis
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