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
Custom values/units display in Mark's values ?
Re: Custom values/units display in Mark's values ?
Hi Dawie,
You could use OnGetSeriesMark event to modify the text the marks will show. For example, in VB6:
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Custom values/units display in Mark's values ?
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
* 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
-
- 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 ?
Hi Dawie,
Try callling TChart1.Environment.InternalRepaint before exporting. This will force the chart being repainted internally.
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 |
Instructions - How to post in this forum |