Page 1 of 1

need help for choosing moment for draw series

Posted: Fri Apr 23, 2010 10:40 am
by 15655333
Hello.Excuse for my bad english.

I need draw series(A) after drawing and showing other series(B), because series(A) draw using values in pixels series(B).

What chart(series, form) method better used for my task?

Re: need help for choosing moment for draw series

Posted: Fri Apr 23, 2010 10:50 am
by yeray
Hi petroV,

I think you should create your first series (A) and populate it with the desired data. Then, you should force the chart to be drawn with Draw() method. Then, once the series is drawn, you'll be able to use series (A) CalcXPos() and CalcYPos() to calculate the values for the second series (B).

If you need a more detailed explanation it would be helpful if we can have more information. So, if you still have problems with it, please try to arrange a simple example project we can run as-is to reproduce the situation here.

Re: need help for choosing moment for draw series

Posted: Fri Apr 23, 2010 11:07 am
by 15655333
thank you, i'll try

other question. sample code:

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Steema.TeeChart.Styles;

namespace WindowsFormsApplication1
{
  public partial class Form1 : Form
  {
    string _text = "test";
    public Form1()
    {
      InitializeComponent();
      Shape shape = new Shape(tChart1.Chart);
      shape.Text = new string[1];
      shape.Add(0, 0);
      shape.Add(1, 1);
      shape.AfterDrawValues += new Steema.TeeChart.PaintChartEventHandler(shape_AfterDrawValues);
      shape = new Shape(tChart1.Chart);
      shape.Add(1, 1);
      shape.Add(100, 100);
      shape.Text = new string[1];
      shape.AfterDrawValues += new Steema.TeeChart.PaintChartEventHandler(shape_AfterDrawValues);
    
    }

    void shape_AfterDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
    {
      Shape shape = sender as Shape;
      int size = Math.Abs(shape.CalcYPos(0) - shape.CalcYPos(1));
      double fsize = g.TextHeight(shape.Font, _text);
      if (size + 4 < fsize)
        shape.Text[0] = "";
      else
        shape.Text[0] = _text;
      shape.RefreshSeries();
    }
  }
}
form size height = 300
after run program, afterDrawValue don't work. need force chart repaint with resize control or zooming
i want, that after shawing form algorithm in AfterDrawValue work. What method need call, for executing shape_AfterDrawValues.

Re: need help for choosing moment for draw series

Posted: Fri Apr 23, 2010 11:11 am
by 15655333
understand. answer in 2 post )) method DRAW()