Custom values/units display in Mark's values ?

TeeChart for ActiveX, COM and ASP
Post Reply
Otokon
Newbie
Newbie
Posts: 25
Joined: Thu Sep 18, 2008 12:00 am

Custom values/units display in Mark's values ?

Post by Otokon » Tue Jul 20, 2010 7:16 am

Hi,

I have the following problem/want to do the following:
* I have 2 bar series on a chart, one is % and one kW
* I want to display a mark above each bar containing the value and the unit
* The series name is the unit eg. % or kW
* The eventual value in the mark must be something like 56% or 312kW

Can I set Marks.Style to combine two different styles - a combination of TeeChart.EMarkStyle.smsValue and TeeChart.EMarkStyle.smsSeriesTitle will work

thanks

Dawie

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

Re: Custom values/units display in Mark's values ?

Post by Yeray » Tue Jul 20, 2010 11:40 am

Hi Dawie,

You could use OnGetSeriesMark event to modify the text the marks will show. For example, in VB6:

Code: Select all

Private Sub TChart1_OnGetSeriesMark(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, MarkText As String)
  MarkText = Str$(TChart1.Series(SeriesIndex).YValues.Value(ValueIndex)) + TChart1.Series(SeriesIndex).Name
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

Otokon
Newbie
Newbie
Posts: 25
Joined: Thu Sep 18, 2008 12:00 am

Re: Custom values/units display in Mark's values ?

Post by Otokon » Tue Jul 20, 2010 3:29 pm

Yeray, thanks for the reply. I have got it working now, but I have one problem still:
* It seems that the event does not fire when I export the chart to a .tee file : Export.asNative.SaveToFile(..) (for view in IE) thus the edits I make in the MarkText is not brought forward to the chart that is displayed.
* But the event is called when exporting to a JPG (for view in Firefox) and the correct MarkText is displayed.

Is there some way to force the call of the event ?

thanks

Dawie

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

Re: Custom values/units display in Mark's values ?

Post by Narcís » Wed Jul 21, 2010 7:18 am

Hi Dawie,

Try callling TChart1.Environment.InternalRepaint before exporting. This will force the chart being repainted internally.
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