Title - Unable to display label on inner text and multi line text on legend.
We are currently migrating from another 3rd party control to TeeChart Pro ActiveX 14. The code we are writing is C++ using Visual Studio 2013 and will be running on Windows Server 2008R2 and above and Win 7 and above.
We are unable to create a label on inner tick because we are unable to find the coordinate to display label on inner tick. How can we determine coordinates to display label on inner tick? How can we draw text on inner tick inside Chart? How can we display multiline text on legend?
Unable to display label on inner text and multi line text on
Unable to display label on inner text and multi line text on
- Attachments
-
- chart.png (71.85 KiB) Viewed 8941 times
Re: Unable to display label on inner text and multi line text on
Hello,
Here you have a simple example in Visual Basic:
http://stackoverflow.com/questions/2390 ... n-teechart
You can use the bottom axis CalcXPosValue function to convert axis values to screen pixel coordinates.WinArch wrote:We are unable to create a label on inner tick because we are unable to find the coordinate to display label on inner tick. How can we determine coordinates to display label on inner tick?
You can use Canvas.TextOut function to draw text manually at the OnAfterDraw event.WinArch wrote:How can we draw text on inner tick inside Chart?
Here you have a simple example in Visual Basic:
Code: Select all
Private Sub Form_Load()
TChart1.Aspect.View3D = False
Dim i As Integer
For i = 0 To 3
TChart1.AddSeries scLine
TChart1.Series(i).FillSampleValues
Next i
TChart1.Axis.Left.MinimumOffset = 50
End Sub
Private Sub TChart1_OnAfterDraw()
Dim XPos, YPos, txtWidth, txtHeight As Integer
Dim txt As String
XPos = TChart1.Axis.Bottom.CalcXPosValue(2.5)
YPos = TChart1.Axis.Bottom.Position
txt = "my date"
txtWidth = TChart1.Canvas.TextWidth(txt)
txtHeight = TChart1.Canvas.TextHeight(txt)
TChart1.Canvas.TextOut XPos - (txtWidth / 2), YPos - txtHeight - 2, txt
End Sub
I'm afraid this is not supported in the current legend but you can always draw your custom legend manually as in the example here:WinArch wrote:How can we display multiline text on legend?
http://stackoverflow.com/questions/2390 ... n-teechart
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |