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

Message ListMessage List     Post MessagePost Message

  setLabelFormat() ... is there a getLabelFormat()?
Posted by Peter on Feb-16-2022 15:57
Hi Peter,
I note there is an Axis.setLabelFormat(). Is there an Axis.getLabelFormat() at all or anyway to retrieve the string used for the formatting?

I have a number of charts on the screen and tracking line for each of them. They have different yAxis values and it would be convenient to use the same trackingLine function for them all. This would require the formatting for the trackingLegend to use a formatting consistent with the current chart being tracked.

Is it possible to somehow retrieve the labelFormat?

  Re: setLabelFormat() ... is there a getLabelFormat()?
Posted by Peter Kwan on Feb-17-2022 14:27
Hi Peter,

Unluckily, there is no Axis.getLabelFormat API. If you need the format string, your code will need to remember the string you use in Axis.setLabelFormat.

Note that in many cases, the axis label format is not suitable for track cursors. It is because the axis labels are usually "nice numbers". For exmaple, suppose the data are from 1.079 to 5.481. The axis labels might be [0, 1, 2, 3, 4, 5, 6]. That means the axis labels may be formatted with no decimal place, even though your data have decimal places. It may be desirable for the track cursor labels to use a different format string that accurately display the data values with decimal places.

For your case, you may try to use a generic format (such as {value|P4} for numeric values), or you may need to specify a different format string for different charts.

Regards
Peter Kwan