Mark data source

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Mark data source

Post by Pujol1986 » Mon Feb 02, 2009 5:03 pm

Hello, i'm making a gantt chart and i have to change the mark text.

I have a lot of options to show different information, but i have to show a specified data that i have in a dataset.

how i can change the datasource of the Marks?

can i change the Marks text like the color of the gantt bars?

exemple:

Gantt1.Colors(0) = Color.Red

thanks.

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

Post by Narcís » Mon Feb 02, 2009 5:08 pm

Hi Pujol1986,

Yes, you have several options here:

1. You can assign it directly to Labels StringList:

Code: Select all

			gantt1.Labels[0] = "first bar";
2. You can add them when populating series using Add method:

Code: Select all

			gantt1.Add(startDate, endDate, y, "first bar", yourColour);
3. You can assign them using a datasource and LabelMember property as shown in the examples here:

http://www.teechart.net/support/viewtopic.php?t=3450
http://www.teechart.net/support/viewtopic.php?t=8082

Hope this helps!
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

Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Post by Pujol1986 » Tue Feb 03, 2009 1:11 pm

Hi Narcís,

i test the code but it change the label of the task and i don't want it.

i need to change only the Mark of the task, for exemple:

I have a Task that have the Label "Máquina 105" and i want to show in the Mark the % of task completion.

If i put the code that you give me the label will change it's value to % of task completion.

how can i change the Mark value without changing the label of the task?

Thanks.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue Feb 03, 2009 2:26 pm

Hi Pujol1986,

To modify the marks without modifying the axis labels, you could use gantt's event GetSeriesMark, for example, to modify the first mark:

Code: Select all

Private Sub Gantt1_GetSeriesMark(ByVal series As Steema.TeeChart.Styles.Series, ByVal e As Steema.TeeChart.Styles.GetSeriesMarkEventArgs) Handles Gantt1.GetSeriesMark
        If e.ValueIndex = 0 Then
            e.MarkText = "my custom label"
        End If
    End Sub
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Pujol1986
Newbie
Newbie
Posts: 58
Joined: Thu Jan 29, 2009 12:00 am
Location: Barcelona
Contact:

Post by Pujol1986 » Tue Feb 03, 2009 3:36 pm

it's done.

thanks.

Post Reply