|
Write text over a Curved line or Spline |
Posted by Sal on Feb-03-2018 03:18 |
|
Hello Peter,
1 - Is there a way to produce some text over a series of point, which are plotted in a XYChart as a line using C++ Language and V6 of the Library ?
I have the Points Curve equation.
2 - Any Idea on how to accomplish this, if this is not readily available with the current Library ?
I appreciate any input on this topic
Thanks
Sal |
Re: Write text over a Curved line or Spline |
Posted by Peter Kwan on Feb-05-2018 16:39 |
|
Hi Sal,
If you need some text in a straight line (like from left to right), there are many methods. For example, you can use BaseChart.addText to add the text at any pixel coordinate you like, and you can rotate the text using TextBox.setFontAngle.
Another method is to add a scatter with only one transparent point, and then use Layer.addCustomDataLabel to add the label to that scatter point. The scatter point essentially becomes the starting position of the text.
If you want the text to flow along an arbitrary curve, you would need to position the text character by character. Basically, you can add multiple scatter points along the curve, and use Layer.addCustomDataLabel to put one character at each point. (You can use TextBox.setAlignment to make the label center aligned to the point.)
Regards
Peter Kwan |
|