Series.Marks.Item Attributes not working

TeeChart for ActiveX, COM and ASP
Post Reply
jbritt
Newbie
Newbie
Posts: 12
Joined: Mon Oct 03, 2011 12:00 am

Series.Marks.Item Attributes not working

Post by jbritt » Tue Oct 25, 2011 7:44 pm

Hello,

I am having problems setting the Series.Marks.Item attribute. My graph is a 3d bar graph, plotting multiple series...

None of the following code snippets had any effect....

Code: Select all

Series(z).GetMarks().GetItem(x).SetVisible(bVisible)
or

Code: Select all

if (bVisible)
   Series(z).GetMarks().GetItem(x).Show();
else
   Series(z).GetMarks().GetItem(x).Hide();
or

Code: Select all

Series(z).GetMarks().GetItem(x).SetTransparent(!bVisible)

Is there something else that needs to happen to get the Series.Marks.Item attributes to act independent of the Series.Marks settings? I am using TeeChart Pro v2011.0.0.4.11109 32 VCL.


Thank you!

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

Re: Series.Marks.Item Attributes not working

Post by Yeray » Wed Oct 26, 2011 8:36 am

Hello,
jbritt wrote:I am having problems setting the Series.Marks.Item attribute. My graph is a 3d bar graph, plotting multiple series...
I'm trying this in VB6 and I find no problems with the following examples.
This two examples do the same. They show/hide the marks alternatively:

Code: Select all

Private Sub Form_Load()  
  Dim i, j As Integer
  For i = 0 To 3
    TChart1.AddSeries scBar
    TChart1.Series(i).FillSampleValues
    For j = 0 To TChart1.Series(i).Count - 1
      TChart1.Series(i).Marks.Item(j).Visible = (j Mod 2 = 0)
    Next j
  Next i
End Sub

Code: Select all

Private Sub Form_Load()    
  Dim i, j As Integer
  For i = 0 To 3
    TChart1.AddSeries scBar
    TChart1.Series(i).FillSampleValues
    For j = 0 To TChart1.Series(i).Count - 1
      If j Mod 2 = 0 Then
        TChart1.Series(i).Marks.Item(j).Show
      Else
        TChart1.Series(i).Marks.Item(j).Hide
      End If
    Next j
  Next i
End Sub
This one doesn't hide the marks at indexes 0,2,4,... like the above. It shows the text without shape for these marks.

Code: Select all

Private Sub Form_Load()  
  Dim i, j As Integer
  For i = 0 To 3
    TChart1.AddSeries scBar
    TChart1.Series(i).FillSampleValues
    For j = 0 To TChart1.Series(i).Count - 1
      TChart1.Series(i).Marks.Item(j).Transparent = (j Mod 2 = 0)
    Next j
  Next i
End Sub
If you still have problems with it, could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
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

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

Re: Series.Marks.Item Attributes not working

Post by Sandra » Wed Oct 26, 2011 11:30 am

Hello jbritt,

I have added more information that can help you to solve your problem. Concretely, I have converted the three examples that Yeray have suggested to VC++ 6.0, and code works me fine using last version of Activex:

Example with visible

Code: Select all

	for(int i=0; i<3; i++)
	{
		m_ctrlChart.AddSeries(1);
	    m_ctrlChart.Series(i).FillSampleValues(10);

	  for(int j=0; j<m_ctrlChart.Series(i).GetCount();j++)
	  {
		  m_ctrlChart.Series(i).GetMarks().GetItem(j).SetVisible(j%2==0);
	  }
	}
	
Example with Hide and Show properties

Code: Select all

	
	for(int i=0; i<3; i++)
	{
		m_ctrlChart.AddSeries(1);
	    m_ctrlChart.Series(i).FillSampleValues(10);

	  for(int j=0; j<m_ctrlChart.Series(i).GetCount();j++)
	 {
		  if(j%2==0)
		  {
			 m_ctrlChart.Series(i).GetMarks().GetItem(j).Show();
		  }
		  else
		  {
			 m_ctrlChart.Series(i).GetMarks().GetItem(j).Hide();
		  }
	  }
	}

Example with Transparent property:

Code: Select all

	
	for(int i=0; i<3; i++)
	{
		m_ctrlChart.AddSeries(1);
	    m_ctrlChart.Series(i).FillSampleValues(10);

	  for(int j=0; j<m_ctrlChart.Series(i).GetCount();j++)
	  {
		 
			 m_ctrlChart.Series(i).GetMarks().GetItem(j).SetTransparent(j%2==0);
		  
	  }
	}
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

jbritt
Newbie
Newbie
Posts: 12
Joined: Mon Oct 03, 2011 12:00 am

Re: Series.Marks.Item Attributes not working

Post by jbritt » Thu Oct 27, 2011 7:57 pm

Thanks for getting back to me so quickly.

I think I see the problem I was having. As new data comes in, I clear out the old set of data and add a new group of X, Y, Z data. The Series.Marks.Item attributes are also cleared at this time. I guess I'll have to set it again when I add the new data.

Thank you again for getting back so quickly on this!

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

Re: Series.Marks.Item Attributes not working

Post by Sandra » Fri Oct 28, 2011 2:46 pm

Hello jbritt,

I am glad the solution works fine for you :).

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

Post Reply