How to add shapes to the points of a series (dynamically)

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Maxeta
Newbie
Newbie
Posts: 7
Joined: Fri Apr 07, 2006 12:00 am

How to add shapes to the points of a series (dynamically)

Post by Maxeta » Wed Jun 07, 2006 5:32 pm

I simply want to set the size, shape, and color of each point in my series. Currenlty it is setup as a fastline, and I still want to keep the line, I would just like to make the points more defined by adding a small circle for each point, and possibly change the color. I would also like to accomplsih this dynamically as everything else is setup as such. Currently I'm not having much luck tracking down how to do this in the help files.

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

Post by Narcís » Thu Jun 08, 2006 8:00 am

Hi Maxeta,

FastLine series don't have the possibility to add a pointer to them. However you can do that using a Line series:

Code: Select all

    private void Form1_Load(object sender, EventArgs e)
    {
      Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);

      line1.Pointer.Visible = true;
      line1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;

      line1.Add(5, Color.Red);
      line1.Add(7, Color.Blue);
      line1.Add(2, Color.Yellow);
      line1.Add(7, Color.Green);
      line1.Add(1, Color.Orange);
    }
Another option is doing something like this:

Code: Select all

    private void Form1_Load(object sender, EventArgs e)
    {
      Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);

      line1.Pointer.Visible = true;
      line1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
           
      line1.FillSampleValues();      
      line1.ColorEach = true;
      line1.ColorEachLine = false;
    }
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

Maxeta
Newbie
Newbie
Posts: 7
Joined: Fri Apr 07, 2006 12:00 am

Post by Maxeta » Thu Jun 08, 2006 1:33 pm

Thanks that seemed to work well, one quick question though.

With the FastLine, the scale for my Y values was auto ranged (actual point values where not listed), but with the Line it seems to actually put in exact point values (with a very long set of trailing decimal places).What is the best way to alieviate this?

* Actually, I just noticed it only happens when the points are "visible", a grid line marker of 1781.89 changes to 1788.18798507 when I change visible from "false" to "true".
Last edited by Maxeta on Thu Jun 08, 2006 1:52 pm, edited 2 times in total.

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

Post by Narcís » Thu Jun 08, 2006 1:37 pm

Hi Maxeta,

Could you please send us an example we can run "as-is" or some code so that we can reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance.
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

Maxeta
Newbie
Newbie
Posts: 7
Joined: Fri Apr 07, 2006 12:00 am

Post by Maxeta » Thu Jun 08, 2006 1:54 pm

Actually I was able to fix it by setting the value format of the label (I never had to do this before though).

Post Reply