B2017-008 - If the scale entered for an axis is reversed (maximum to minimum) the code will correctly print the axis. Prior to this fix the axis was not printed.

This commit is contained in:
Rich 2017-01-19 21:18:03 +00:00
parent 21434d576d
commit dc7a2a7273

View File

@ -332,7 +332,7 @@ namespace XYPlots
{
int retval;
string np = NextPiece();
np = Regex.Replace(np, "[^0-9]", "");
np = Regex.Replace(np, "[^-0-9]", "");
retval = Convert.ToInt32(np, 10);
return retval;
}
@ -1610,6 +1610,8 @@ namespace XYPlots
newmaximum = ((int)(maximum[flag] / delta[flag])) * delta[flag];
if (newmaximum < maximum[flag] - (delta[flag] * 0.001))
newmaximum += delta[flag];
// B2017-008 Support a reverse Axis which goes from a larger value to a smaller value.
if (newmaximum < newminimum) delta[flag] = -delta[flag];
minimum[flag] = newminimum;
maximum[flag] = newmaximum;
}
@ -1877,6 +1879,18 @@ namespace XYPlots
//VG.VG_Arc.iColor = 0;
//#endif
}
private int _OffsetX = 0;
public int OffsetX
{
get { return _OffsetX; }
set { _OffsetX = value; }
}
private int _OffsetY = 0;
public int OffsetY
{
get { return _OffsetY; }
set { _OffsetY = value; }
}
public void Setup()
{
char Command, PrevCommand = ' ';
@ -1890,6 +1904,10 @@ namespace XYPlots
ShadowFlag = 0;
switch (Command)
{
case 'O':
OffsetX = getint();
OffsetY = getint();
break;
case 'T':
ShadowFlag += 2; // 2 for no box
GetBoxParameters();