GetPointerStyle - bug

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

GetPointerStyle - bug

Post by petroV » Wed May 05, 2010 5:41 am

Have bug with GetPointerStyle. I want draw only first points in some series. I have two charts with some series, series on different charts have same DataSource.
Result - first chart draw two first points, second chart don't draw first point in first series.
What do i wrong?
problems.JPG
problems.JPG (41.86 KiB) Viewed 5183 times
my code:

Code: Select all

    private void lineSeries_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series,
      Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
    {
      e.Style = Steema.TeeChart.Styles.PointerStyles.Nothing;
      if (series.DataSource == null)
        return;
      DataTable chartTable = series.DataSource as DataTable;
      if (chartTable.Rows.Count > 0 &&         
        e.ValueIndex == 0)
      {
          e.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
          e.Color = clPointColor;
      }        
    }

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: GetPointerStyle - bug

Post by Sandra » Wed May 05, 2010 10:25 am

Hello petroV,

I couldn't reproduce your problem with last version of TeeChart .Net. Please, you could send us a simple project, because we can reproduce it here? You could make a DataSource to runtime as explain in this thread.

Thanks,
Best Regards,
Sandra Pazos / 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

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

Re: GetPointerStyle - bug

Post by petroV » Wed May 05, 2010 11:20 am

i found proplem - it happen, when Left axe inverted
in attach sample project
Attachments
TestTeeChart.rar
(49.95 KiB) Downloaded 340 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: GetPointerStyle - bug

Post by Sandra » Thu May 06, 2010 11:04 am

Hello petroV,

I could reproduce your problem, and I think that you didn’t draw first points to series, because your code only works with points of first series:

Code: Select all

void line_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
    {
      int i = tChart2.Series.IndexOf(series);
      if (i == 0 && e.ValueIndex == index)
        e.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
      else
        e.Style = Steema.TeeChart.Styles.PointerStyles.Nothing;
    }
I modify your code and work correctly with last version of TeeChart .Net. Please, check next code works as you want

Code: Select all

   public Form1()
    {
      InitializeComponent();
    }

    private void Form1_Shown(object sender, EventArgs e)
    {
      
      Random rnd = new Random();
      double x = 0;
      double y = 0;
      double z = 0;

      tChart2.Axes.Left.Inverted = false;
      tChart2.Aspect.View3D = false;
      for (int i = 0; i < 4; i++)
      {
          Steema.TeeChart.Styles.Points3D points = new Steema.TeeChart.Styles.Points3D(tChart1.Chart) { Visible = true };
          Steema.TeeChart.Styles.HorizLine line = new Steema.TeeChart.Styles.HorizLine(tChart2.Chart);
          line.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(line_GetPointerStyle);
          line.Pointer.Visible = true;
          line.Visible = true;
          for (int k = 0; k < 50; k++)
          {
              points.Add(x, y, z);
              line.Add(x, y);
              x++; y++; z++;
          }
          x--; y--; z--;

      }
    
    }

    void line_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
    {
      if ((e.ValueIndex == 0) || (e.ValueIndex == 1))
        e.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
      else
          e.Style = Steema.TeeChart.Styles.PointerStyles.Nothing;
    }
i found proplem - it happen, when Left axe inverted
Ok, I can reproduce it and I have added in bug Report list with number [TF02014856]. We will try to fix for next versions of TeeChart .Net.

On the other hand, I recommend change property Inverted= true, to Inverted=false, for now.

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / 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

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

Re: GetPointerStyle - bug

Post by petroV » Thu May 06, 2010 11:48 am

Thanks, will wait next version

Post Reply