Triangle Base Perimeter Line Does Not Appear

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Ivan_vS
Newbie
Newbie
Posts: 6
Joined: Mon Sep 20, 2010 12:00 am

Triangle Base Perimeter Line Does Not Appear

Post by Ivan_vS » Wed Feb 02, 2011 1:57 am

The following code produces a triangle shape.
However the base perimeter line is missing?:

Steema.TeeChart.Styles.Shape triangle = new Steema.TeeChart.Styles.Shape (Chart.Chart);
triangle.Style = Steema.TeeChart.Styles.ShapeStyles.Triangle;
triangle.Pen.Color = System.Drawing.Color.Blue;
triangle.Color = System.Drawing.Color.Yellow;
triangle.Brush.Gradient.Visible = false;
triangle.X0 = 0; triangle.Y0 = 0;
triangle.X1 = 50; triangle.Y1 = 50;

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

Re: Triangle Base Perimeter Line Does Not Appear

Post by Narcís » Wed Feb 02, 2011 9:19 am

Hi Ivan_vS,

I'm afraid so. I have added the issue (TF02015376) to the defect list to be fixed for next releases. In the meantime a workaround is manually painting the bottom line as in this example:

Code: Select all

      public Form1()
      {
        InitializeComponent();
        InitializeChart();
      }

      private Steema.TeeChart.Styles.Shape triangle;

      private void InitializeChart()
      {
        tChart1.Aspect.View3D = false;

        triangle = new Steema.TeeChart.Styles.Shape(tChart1.Chart);
        triangle.Style = Steema.TeeChart.Styles.ShapeStyles.Triangle;
        triangle.Pen.Color = System.Drawing.Color.Blue;
        triangle.Color = System.Drawing.Color.Yellow;
        triangle.Brush.Gradient.Visible = false;
        triangle.X0 = 0; triangle.Y0 = 0;
        triangle.X1 = 50; triangle.Y1 = 50;
        tChart1.Axes.Left.MinimumOffset = 10;

        tChart1.Draw();
        tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
      }

      void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
      {
        g.Pen.Color = triangle.Pen.Color;
        int x0 = triangle.CalcXPos(0);
        int y0 = triangle.CalcYPos(0);
        int x1 = triangle.CalcXPos(1);

        g.Line(x0, y0, x1, y0);
      }
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