Page 1 of 1

Series Marks Style displaying difficulties

Posted: Tue Feb 08, 2005 3:21 pm
by 6925467
Hello,

I'm running 5.03 version and trying to display the results of a crosstab
table using VB6

Code: Select all

With TChart2
      
      'hide chart
      ' .Visible = False
      'clean up
       .RemoveAllSeries
       
        For i = 0 To rs.Fields.Count - 3
        'add a ne wseries        
        .AddSeries scPoint
        .Series(i).DataSource = rs
        .Series(i).YValues.ValueSource = rs.Fields(i + 1).Name
        .Series(i).VerticalAxis = aLeftAxis
        'labels
        .Series(i).LabelsSource = rs.Fields(0).Name
        ' legend title
        .Series(i).Title = rs.Fields(i + 1).Name
        .Series(i).Marks.Style = smsLegend             '<------------------
        .Series(i).Marks.Visible = True 'False
       Next
       
      .Visible = True
   
   End With
The legend does display the Series names which I'd like to be dispayed on the chart but what happens instead is that I only get XY values and not the legend "content".

Am I missing something here?
Thanks in advance for your input

Shurik.

Posted: Fri Feb 11, 2005 3:50 pm
by narcis
Hello Shurik,

I don't understand very well what are you trying to do, but if you want to change the series marks text you can implement it in the OnGetSeriesMark event as shown below. In that case the series marks are changed to the series name.

Code: Select all

Private Sub TChart1_OnGetSeriesMark(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, MarkText As String)
    MarkText = TChart1.Series(SeriesIndex).Name
End Sub

Posted: Fri Feb 11, 2005 4:20 pm
by 6925467
Hi NarcĂ­s,

That (MarkText = TChart1.Series(SeriesIndex).Title )
did the trick .

Thanks a lot

Shurik.

Posted: Fri Feb 11, 2005 5:06 pm
by narcis
Hi Shurik,

You're welcome! I'm glad to hear this helped.