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

Message ListMessage List     Post MessagePost Message

  polar graph axis labels
Posted by Jackie Lloyd on Oct-08-2012 22:59
I am working on a PolarChart and am trying to label the radial and angular axes.

I have tried:

int title_pos = 12; // I have tried all options from 1 - 13

int font_size = 10;
int title_gap = 2;

polarChart->radialAxis()->setTitle(radial_axis_label, "arialbi.ttf", font_size);
polarChart->radialAxis()->setTitlePos(title_pos, title_gap);
polarChart->radialAxis()->setWidth(2);

But I cannot get any axis labels to appear. What am I doing wrong?

  Re: polar graph axis labels
Posted by Peter Kwan on Oct-09-2012 03:23
Hi Jackie,

By axis labels, do you mean labels along the axis (which is something like 0, 20, 40, 60, 80 but can be other sequence of text), or do you mean a label that describes the entire axis (which is called the "axis title" in the ChartDirector API)?

For the labels along the axis, you can configure it using Axis.setLabels, Axis.setLabels2, Axis.setLinearScale, Axis.setLinearScale2, and several other APIs.

If you are referring to the "axis title", because there is no safe or well-accepted place to put the axis title, so the radial and angular axis has no axis title.

In an XYChart, the axis title can be put outside the chart next to the axis. However, for a PolarChart, the regions on both sides of the radial axis are inside the plot area, so it is not safe to put the title there (it may interfere or overlap with the chart contents). The region on top of the radial axis may be occupied by angular axis labels, so it is not safe to put the title at that position either. That's why the radial axis does not have a axis title. The setTitle API has no effect on the radial axis.

If you would like to add a title to the radial axis, you may use BaseChart.addText to put the title to anywhere you think is suitable. For example, you can put it on top of the radial axis if it is a suitable place for your chart layout. The same method can be used to add a title to the angular axis.

If you need further help, would you mind to clarify where you would like to add the title to? (May be attaching an image can help me understand your requirement.)

Regards
Peter Kwan