Page 1 of 1

Series.Marks.Item Attributes not working

Posted: Tue Oct 25, 2011 7:44 pm
by 16660333
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!

Re: Series.Marks.Item Attributes not working

Posted: Wed Oct 26, 2011 8:36 am
by yeray
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.

Re: Series.Marks.Item Attributes not working

Posted: Wed Oct 26, 2011 11:30 am
by 10050769
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,

Re: Series.Marks.Item Attributes not working

Posted: Thu Oct 27, 2011 7:57 pm
by 16660333
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!

Re: Series.Marks.Item Attributes not working

Posted: Fri Oct 28, 2011 2:46 pm
by 10050769
Hello jbritt,

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

Thanks,