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

Message ListMessage List     Post MessagePost Message

  Label Font Size
Posted by TN on Sep-13-2022 21:51
The setLabelStyle requires a font size to rotate the x-axis labels. Is there a way to query what the current font size is so not to change it?

In general, to get property values of various chart components (title,axisTitle, bars...etc),
one would need to save the return value after calling "add***". Is there a general way to retrieve these handles from the chart object itself?

Thanks.

  Re: Label Font Size
Posted by TN on Sep-13-2022 21:57
Looks like the first issue, setFontAngle can be used.

  Re: Label Font Size
Posted by Peter Kwan on Sep-14-2022 18:52
Hi TN,

Unluckily, these properties cannot be retrieved.

Note that in ChartDirector, with the exception of the dynamic layer, you cannot change things once the chart has been rendered (such as when the chart is displayed). For example, you cannot change the angle of the font of a chart that already been displayed. You would need to draw another chart.

In practice, drawing another chart is simple, because you already have the code that draws the chart in the first place. You just call the draw chart code again to draw another chart. The chart drawing code simply draws the chart according to your "property page".

In your case, you need to have some variables or data structure (the property page) to keep track of any property that can change, such as the font angle or your data. The chart drawing code simply draws according to the property page.

The Interactive Financial Chart is an example of this approach:

https://www.advsofteng.com/doc/cdjava.htm#financedemo.htm

The left side of the user interface serves as a user configurable "property page". The charting code simply draws according to the property page. Whenever the properties change, just redraw the chart and it will reflect the properties.

Best Regards
Peter Kwan