need help for choosing moment for draw series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
petroV
Newbie
Newbie
Posts: 24
Joined: Tue Mar 02, 2010 12:00 am

need help for choosing moment for draw series

Post by petroV » Fri Apr 23, 2010 10:40 am

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?

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: need help for choosing moment for draw series

Post by Yeray » Fri Apr 23, 2010 10:50 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

petroV
Newbie
Newbie
Posts: 24
Joined: Tue Mar 02, 2010 12:00 am

Re: need help for choosing moment for draw series

Post by petroV » Fri Apr 23, 2010 11:07 am

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.

petroV
Newbie
Newbie
Posts: 24
Joined: Tue Mar 02, 2010 12:00 am

Re: need help for choosing moment for draw series

Post by petroV » Fri Apr 23, 2010 11:11 am

understand. answer in 2 post )) method DRAW()

Post Reply