added AQDG_Graph_Axis_AddMargins()
This commit is contained in:
@@ -633,6 +633,43 @@
|
||||
</content>
|
||||
</inline>
|
||||
|
||||
|
||||
<inline loc="end" access="public">
|
||||
<content>
|
||||
$(api) void $(struct_prefix)_AddMargins(AQDG_GRAPH_AXIS *axis, double percent);
|
||||
</content>
|
||||
</inline>
|
||||
|
||||
<inline loc="code">
|
||||
<content>
|
||||
void $(struct_prefix)_AddMargins(AQDG_GRAPH_AXIS *axis, double percent)
|
||||
{
|
||||
double vMax;
|
||||
double vMin;
|
||||
double vDiff;
|
||||
|
||||
vMin=axis->minValue;
|
||||
vMax=axis->maxValue;
|
||||
vDiff=vMax-vMin;
|
||||
if (vDiff==0.0) {
|
||||
vDiff=vMax;
|
||||
if (vDiff==0.0)
|
||||
vDiff=1.0;
|
||||
}
|
||||
if (vDiff>0.0) {
|
||||
double vDiffForPercent;
|
||||
|
||||
vDiffForPercent=vDiff*(percent/100.0);
|
||||
vMin-=vDiffForPercent;
|
||||
vMax+=vDiffForPercent;
|
||||
axis->minValue=vMin;
|
||||
axis->maxValue=vMax;
|
||||
}
|
||||
}
|
||||
</content>
|
||||
</inline>
|
||||
|
||||
|
||||
</inlines>
|
||||
|
||||
</lang>
|
||||
|
||||
Reference in New Issue
Block a user