Series Markers

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
matthbri
Newbie
Newbie
Posts: 43
Joined: Wed Mar 22, 2006 12:00 am

Series Markers

Post by matthbri » Thu Oct 19, 2006 3:43 pm

Hi,

in a printing application I want to print the PointerStyle used for a series with some other information.

Is there an easy way to get an Image or bitmap of a single PointerStyle that I can use in Print?



thanks,

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

Post by Narcís » Mon Oct 23, 2006 1:43 pm

Hi matthbri,

Yes, in the next TeeChart for .NET maintenance release you'll be able to do something like this:

Code: Select all

    private void button1_Click(object sender, EventArgs e)
    {
      Bitmap bmp = new Bitmap(10, 10);
      Graphics g = Graphics.FromImage(bmp);
      SeriesPointer pointer = new SeriesPointer(tChart1.Chart, tChart1[0]);
      Graphics3D oldGraphics = tChart1.Graphics3D;
      (tChart1.Graphics3D as Graphics3DGdiPlus).Graphics = g;
      pointer.Draw(tChart1.Graphics3D, false, 0, 0, 10, 10, points1.Color, points1.Pointer.Style);
      bmp.Save("bitmap.bmp");
      tChart1.Graphics3D = oldGraphics;
    }
However, in the meantime, you can create a class doing this:

Code: Select all

  class MyCanvas : Graphics3DGdiPlus
  {
    public MyCanvas(System.Drawing.Graphics e, Steema.TeeChart.Chart chart) : base(chart)
    {
      this.g = e;
    }

  }
and use MyCanvas like this:

Code: Select all

    private void button1_Click(object sender, EventArgs e)
    {
      Bitmap bmp = new Bitmap(10, 10);
      Graphics g = Graphics.FromImage(bmp);
      SeriesPointer pointer = new SeriesPointer(tChart1.Chart, tChart1[0]);

      MyCanvas gg = new MyCanvas(g, tChart1.Chart);
      gg.Brush.Color = tChart1.Graphics3D.Brush.Color;
      gg.Brush.Visible = tChart1.Graphics3D.Brush.Visible;
      pointer.Draw(gg, false, 0, 0, 10, 10, points1.Color, points1.Pointer.Style);
      bmp.Save("bitmap.bmp");
    }
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