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

Message ListMessage List     Post MessagePost Message

  Increasing Polar Chart scale text size
Posted by CAA on Dec-31-2020 18:04
Attachments:
On retina displays, a polar chart looks slightly poor and I get aliasing on some of the lines. The workaround is to scale it 2x so it's in line with the resolution.

I can scale the text size of labels and titles and whatnot, but I cannot seem to find a way to change the size of the scale within the polar chart itself without changing the size of the chart (screenshot attached).

I'm doing this in C++ and I had a look at the documentation on base chart, polar chart, polar layer and angular axis but none seem to offer a method to change the size of the internal scale...
2x
2x

66.29 Kb
normal
normal

53.21 Kb

  Re: Increasing Polar Chart scale text size
Posted by Peter Kwan on Jan-01-2021 23:50
Hi CAA,

In the sample code, the radial axis is auto-scaled. By default, for auto-scaled axis, if the axis is vertical, ChartDirector will put labels on the axis so that the label spacing is at least 20 pixels. That means ChartDirector may put more labels on the axis is the axis is longer.

For your case, you can use Axis.setTickDensity to configure the tick density as proportional to the scale factor, like:

c->radialAxis()->setTickDensity((int)(20 * scaleFactor + 0.5));

Hope this can help.

Regards
Peter Kwan

  Re: Increasing Polar Chart scale text size
Posted by CAA on Jan-04-2021 17:52
Hey Peter,

Thank you very much for the reply!

I see what you mean - with setTickDensity I can change the scale between the numbers themselves.

I should have been a bit more specific in my first post, by scale in this context I mean the width, height and text size of those boxes containing the numbers separated by setTickDensity.

On a Retina display once scaled up to 2x, the graph and labels look good and I can change their text size to match the new resolution, however, I was not able to find a method of changing the text size of those boxes containing the scale set via setTickDensity.

My best guess so far is that it's all handled in a smart way internally based on the width and height of the chart, but once there's a need to scale it up to get rid of aliasing on a high pixel density display, it's not growing enough in line with the size of the chart?

Thanks again for taking time to reply, appreciate it :)

Kindest Regards,

CAA

  Re: Increasing Polar Chart scale text size
Posted by Peter Kwan on Jan-05-2021 00:03
Hi CAA,

The font size for the axis labels can be configured with Axis.setLabelStyle. For example:

c->radialAxis()->setLabelStyle("arial.ttf", 8 * scaleFactor);

Hope this can help.

Regards
Peter Kwan

  Re: Increasing Polar Chart scale text size
Posted by CAA on Jan-05-2021 17:41
Hey Peter,

That works wonderfully! Thank you very much for your help!

Kindest Regards,

CAA