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

Message ListMessage List     Post MessagePost Message

  Chartdir Top Extension Manual
Posted by Mooseon Choi on Feb-09-2018 09:52
Attachments:
Hi
i made chart using the "top extension of chartdir"
look at the manual I write as follows:
------------------------------------------------------------------------------------
Argument
topExtension

Default
0.1

Description
The top portion of the axis that no data point should fall into. For example, a value of 0.2 means no data value will fall within the top 20% of the axis.

The topExtension must be between 0 to 1.
--------------------------------------------------------------------------------------
so, for example if max value of Y axis is 291.2321, the expected margin is different from the actual margin.

What is the Top / Bottom Extension setting value of Chartdir's AutoScale setting value and means the operation rule

explain.
What is the Top / Bottom extension setting value of Chartdir's AutoScale setting value and measns the operation rule
example.png

  Re: Chartdir Top Extension Manual
Posted by Peter Kwan on Feb-09-2018 13:25
Hi Mooseon,

Suppose the max y value is 291. If the top extension is 0.5, it means the top 50% of the plot area should have no data. Therefore the y-axis scale must be at least 291 x 2 = 582. In this way, the top 50% is empty.

Assuming the lower limit is 0. The top axis scale should then be:

top_limit = max_data_value / (1 - top_extension)

If the top_limit is 582, ChartDirector will then to move it to a label position. The next label position is 600, so the axis scale will be 600. That's why in the chart, you see the axis scale is from 0 to 600.

The top extension must be less than 1. If it is 1, it means the entire chart is empty, so the axis scale must be set to infinity. Besides the top extension, there is also the bottom extension. For the sample code, top_extension + bottom_extension must be less than 1.

Hope this can help.

Regards
Peter Kwan

  Re: Chartdir Top Extension Manual
Posted by Mooseon Choi on Feb-09-2018 14:56
Hi Peter kwan
I have one more question,

Is the following correct?

    1. if the lower limit is not 0,
        top_limit = max_data_value / (1 - (top_extension + botton_extension))
    2. top < 1 (bottom = 0)
    3. top + bottom < 1

if so, MaximumOffset, MinimuOffset the same?

  Re: Chartdir Top Extension Manual
Posted by Peter Kwan on Feb-09-2018 18:55
Hi Mooseon,

The computation is quite complicated as there are a lot of factors to consider. It is like:

data_range = max_data_value - min_data_value

extended_data_range = data_range / (1 - top_extension - bottom_extension)

y_axis_top = max_data_value + extended_data_range x top_extension

y_axis_bottom = min_data_value - extended_data_range x bottom_extension

There are certain restrictions:

0 <= top_extension < 1
0 <= bottom_extension < 1
top_extension + bottom_extension < 1

The extension cannot extend across the zero line. For example, if all the data values are positive, we cannot extend the bottom to negative. If all the data are negative, we cannot extend the top to positive.

The above is for linear or date/time scale. The formula for logarithmic scale is different.

Regards
Peter Kwan