ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Add text that automatically places itself away from the data
Posted by David Littau on Jun-10-2012 11:31
Is there a way to add text to a chart that automatically gets placed so that it doesn't obscure the data?  The text I want to add is a general notification, and not related to any specific data point.

For example, in an XY chart there will be data points and lines connecting them, and I don't want the text to appear on top of any of the lines or data points.  However, that desired placement will change with the data.

thanks,

David

  Re: Add text that automatically places itself away from the data
Posted by Peter Kwan on Jun-11-2012 23:24
Hi David,

The only method I can think of is to place the text in some location that cannot have data. An example is some place outside of the plot area. If you must put the text inside the plot area, you can use Axis.setAutoScale to reserse some space in the axis scale, so that the top range of the scale cannot have data. (When ChartDirector auto-scales the axis, it will make sure the scale is slightly larger than necessary, so that the top end of the axis exceeds all data values.) Alternatively, you may use Axis.setMargin to reserve some non-scaling axis margin. The legend box in the "Multi-Bar Chart" sample code an in the "Finance Chart" sample code is put in these non-scaling axis margin to ensure that they will not overlap with the data.

Regards
Peter Kwan