* UINavBar:修正一处小Bug
This commit is contained in:
parent
f3adc6af6e
commit
ec907e54b8
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
BIN
Bin/SunnyUI.pdb
BIN
Bin/SunnyUI.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -55,6 +55,9 @@ namespace Sunny.UI
|
||||
max = 0;
|
||||
}
|
||||
|
||||
if (!o.YAxis.MaxAuto) max = o.YAxis.Max;
|
||||
if (!o.YAxis.MinAuto) min = o.YAxis.Min;
|
||||
|
||||
if ((max - min).IsZero())
|
||||
{
|
||||
max = 100;
|
||||
|
@ -77,6 +77,13 @@ namespace Sunny.UI
|
||||
public UIAxisTick AxisTick = new UIAxisTick();
|
||||
|
||||
public UIAxisLabel AxisLabel = new UIAxisLabel();
|
||||
|
||||
public bool MaxAuto { get; set; } = true;
|
||||
public bool MinAuto { get; set; } = true;
|
||||
|
||||
public double Max { get; set; } = 100;
|
||||
public double Min { get; set; } = 0;
|
||||
|
||||
}
|
||||
|
||||
public class UICategoryAxis : UIAxis
|
||||
@ -92,8 +99,6 @@ namespace Sunny.UI
|
||||
{
|
||||
Data.Clear();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class UIAxisLabel
|
||||
|
@ -137,18 +137,25 @@ namespace Sunny.UI
|
||||
double x = Math.Abs(Math.Sin(az * Math.PI / 180));
|
||||
double y = Math.Abs(Math.Cos(az * Math.PI / 180));
|
||||
|
||||
SizeF sf = g.MeasureString(pie.Data[0].Value.ToString("F0"), SubFont);
|
||||
PointF pf;
|
||||
if (az >= 0 && az < 90)
|
||||
pf = new PointF((float)(DrawCenter(pie).X + RadiusSize(pie) * x + 6), (float)(DrawCenter(pie).Y - RadiusSize(pie) * y - sf.Height - 6));
|
||||
else if (az >= 90 && az < 180)
|
||||
pf = new PointF((float)(DrawCenter(pie).X + RadiusSize(pie) * x + 6), (float)(DrawCenter(pie).Y + RadiusSize(pie) * y + 6));
|
||||
else if (az >= 180 && az < 270)
|
||||
pf = new PointF((float)(DrawCenter(pie).X - RadiusSize(pie) * x - 6) - sf.Width, (float)(DrawCenter(pie).Y + RadiusSize(pie) * y + 6));
|
||||
else
|
||||
pf = new PointF((float)(DrawCenter(pie).X - RadiusSize(pie) * x - 6) - sf.Width, (float)(DrawCenter(pie).Y - RadiusSize(pie) * y) - sf.Height - 6);
|
||||
string name = Option.Legend != null ? Option.Legend.Data[azIndex] + " : " : "";
|
||||
if (pie.Data[azIndex].Value > 0)
|
||||
{
|
||||
string text = name + pie.Data[azIndex].Value.ToString("F0");
|
||||
SizeF sf = g.MeasureString(text, SubFont);
|
||||
PointF pf;
|
||||
int added = 9;
|
||||
if (az >= 0 && az < 90)
|
||||
pf = new PointF((float)(DrawCenter(pie).X + RadiusSize(pie) * x + added), (float)(DrawCenter(pie).Y - RadiusSize(pie) * y - sf.Height - added));
|
||||
else if (az >= 90 && az < 180)
|
||||
pf = new PointF((float)(DrawCenter(pie).X + RadiusSize(pie) * x + added), (float)(DrawCenter(pie).Y + RadiusSize(pie) * y + added));
|
||||
else if (az >= 180 && az < 270)
|
||||
pf = new PointF((float)(DrawCenter(pie).X - RadiusSize(pie) * x - added) - sf.Width, (float)(DrawCenter(pie).Y + RadiusSize(pie) * y + added));
|
||||
else
|
||||
pf = new PointF((float)(DrawCenter(pie).X - RadiusSize(pie) * x - added) - sf.Width, (float)(DrawCenter(pie).Y - RadiusSize(pie) * y) - sf.Height - added);
|
||||
|
||||
g.DrawString(pie.Data[azIndex].Value.ToString("F0"), SubFont, color, pf.X, pf.Y);
|
||||
if (pie.Data[azIndex].Value > 0)
|
||||
g.DrawString(text, SubFont, color, pf.X, pf.Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ namespace Sunny.UI
|
||||
return;
|
||||
}
|
||||
|
||||
NavBarMenu.Style = Style;
|
||||
NavBarMenu.Style = UIStyles.Style;
|
||||
NavBarMenu.Items.Clear();
|
||||
foreach (TreeNode node in Nodes[SelectedIndex].Nodes)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user