Page 1 of 1

Triangle Base Perimeter Line Does Not Appear

Posted: Wed Feb 02, 2011 1:57 am
by 15657280
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;

Re: Triangle Base Perimeter Line Does Not Appear

Posted: Wed Feb 02, 2011 9:19 am
by narcis
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);
      }