Hello,
I'm trying to create my first bar graph with the TeeChart tool. I'm 99% finished, but am having some issues with a couple of oustanding issues. One is, how do I change the text in the Marks at the top of each bar to be something other than a repeat of the X Label values? Ideally, I'd like to make it the value from a third field in the dataset I'm retrieving. I've found a way to disable to marks for now:
With Chart1.Series(0)
.Color = vbGreen
.DataSource = rsGraph
.YValues.ValueSource = "audit_score"
.LabelsSource = "dc_name"
.Marks.Visible = false
End With
Can I have Marks text display something other than X Labels?
Hi Jimmy,
the Mark text can be customized in the OnGetSeriesMark event, you can use similar code to the following :
the Mark text can be customized in the OnGetSeriesMark event, you can use similar code to the following :
Code: Select all
Private Sub TChart1_OnGetSeriesMark(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, MarkText As String)
If ValueIndex > 3 Then
MarkText = ""
Else
MarkText = "Cust " & MarkText
End If
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com
Thanks for the response, but the problem I'm having is that I don't know how to apply your example to vbscript -- it's a syntax thing. I've tried reading through the examples, and everything I'm seeing is very generic.
I think I would need to apply it to this area of my vbscript:
With Chart1.Series(0)
.Color = vbGreen
.DataSource = rsGraph
.YValues.ValueSource = "audit_score"
.LabelsSource = "dc_name"
.Marks.Style = 5
.Marks.Visible = true
End With
As you can see, my datasource is rsGraph -- which is basically pulling back 3 fields of data from SQL Server. One of the fields, audit_score, is being used to supply the Y Axis values. A second field, dc_name, is being used to supply the X Axis values. I'd like to use the third field, audit_date, to be my custom Mark text value.
I've been playing around and discovered how to make the marks visible or invisible, and also how to change the value to be something like either a combination of the x value, y value, both values, etc. But I cannot figure out how to place a custom value -- specifically the third database field, in for the Mark.
Please, Please help!!
I think I would need to apply it to this area of my vbscript:
With Chart1.Series(0)
.Color = vbGreen
.DataSource = rsGraph
.YValues.ValueSource = "audit_score"
.LabelsSource = "dc_name"
.Marks.Style = 5
.Marks.Visible = true
End With
As you can see, my datasource is rsGraph -- which is basically pulling back 3 fields of data from SQL Server. One of the fields, audit_score, is being used to supply the Y Axis values. A second field, dc_name, is being used to supply the X Axis values. I'd like to use the third field, audit_date, to be my custom Mark text value.
I've been playing around and discovered how to make the marks visible or invisible, and also how to change the value to be something like either a combination of the x value, y value, both values, etc. But I cannot figure out how to place a custom value -- specifically the third database field, in for the Mark.
Please, Please help!!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi JimmyG,
Please read Tutorial 8 - ADO Database access, this tutorials shows how to do this programmatically. You'll the tutorials at TeeChart's program group.
Please read Tutorial 8 - ADO Database access, this tutorials shows how to do this programmatically. You'll the tutorials at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |