TeeChart for ActiveX, COM and ASP
-
Shurik
- Newbie
- Posts: 4
- Joined: Thu Oct 31, 2002 5:00 am
Post
by Shurik » Tue Feb 08, 2005 3:21 pm
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.
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Fri Feb 11, 2005 3:50 pm
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
-
Shurik
- Newbie
- Posts: 4
- Joined: Thu Oct 31, 2002 5:00 am
Post
by Shurik » Fri Feb 11, 2005 4:20 pm
Hi Narcís,
That (MarkText = TChart1.Series(SeriesIndex).Title )
did the trick .
Thanks a lot
Shurik.
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Fri Feb 11, 2005 5:06 pm
Hi Shurik,
You're welcome! I'm glad to hear this helped.