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

Message ListMessage List     Post MessagePost Message

  Surface Plot x/y/z Axis Labels
Posted by Rick Issen on Jan-27-2023 21:03
Hi Peter,

We can set the axis labels with e.g.
pChart->xAxis()->setTitle("X-Axis Title Place Holder", "Arial Bold Italic", 12);

But the angle of the text is not parallel to a specific 3D chart axis. Can we change this?

On the other hand, I'd like to get the position and angle of a 3D text label to write my own text on this position, so that it moves and turns when we rotate the chart.

Please help...

Regards,
Rick

  Re: Surface Plot x/y/z Axis Labels
Posted by Peter Kwan on Jan-28-2023 05:03
Hi Rick,

After some thoughts, it may be possible, but it is not very simple especially if the chart can rotate. The basic idea is as follows:

After creating the chart and calling "BaseChart.layout()", we can get the axes min and max values (using Axis.getMinValue and Axis.getMaxValue), and then use ThreeDChart.getXCoor and ThreeDChart.getYCoor to determine the pixel coordinates at the end points. In this way, we can determine the angle and center point of the axes. We can then add a text label (using BaseChart.addText) a few pixels away from the center point.

If you try the 3D Rotation sample code, as you rotate the chart, you can see there are 8 possible axis orientations. For example, the z-axis and the y-axis can switch between the left side or right side of the x-axis. The orientation changes every 90 degrees of rotation, and it changes if the elevation angle > 180 degrees (that is, the surface is upside down). We need to handle these 8 cases to determine which side of the axis is outside the plot region so we can put the label there

Best Regards
Peter Kwan

  Re: Surface Plot x/y/z Axis Labels
Posted by Rick Issen on Jan-28-2023 17:51
Hi Peter,

Thank you very much for your suggestion. I'm going to think about that, too.

Regards,
Rick