Can I have Marks text display something other than X Labels?

TeeChart for ActiveX, COM and ASP
Post Reply
JimmyG
Newbie
Newbie
Posts: 4
Joined: Mon Jun 07, 2004 4:00 am

Can I have Marks text display something other than X Labels?

Post by JimmyG » Tue Dec 05, 2006 10:05 pm

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

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Dec 07, 2006 10:54 am

Hi Jimmy,
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

JimmyG
Newbie
Newbie
Posts: 4
Joined: Mon Jun 07, 2004 4:00 am

Post by JimmyG » Thu Dec 14, 2006 4:59 pm

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!!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Dec 15, 2006 8:31 am

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.
Best Regards,
Narcís Calvet / 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