* UIBarChart:绘制水平线增加宽度
This commit is contained in:
parent
3c742b2b67
commit
e1e5c3a31d
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.
@ -445,7 +445,11 @@ namespace Sunny.UI
|
|||||||
double ymax = YAxisEnd * YAxisInterval;
|
double ymax = YAxisEnd * YAxisInterval;
|
||||||
float pos = (float)((line.Value - ymin) * (Height - BarOption.Grid.Top - BarOption.Grid.Bottom) / (ymax - ymin));
|
float pos = (float)((line.Value - ymin) * (Height - BarOption.Grid.Top - BarOption.Grid.Bottom) / (ymax - ymin));
|
||||||
pos = (Height - BarOption.Grid.Bottom - pos);
|
pos = (Height - BarOption.Grid.Bottom - pos);
|
||||||
g.DrawLine(line.Color, DrawOrigin.X, pos, Width - BarOption.Grid.Right, pos);
|
using (Pen pn = new Pen(line.Color,line.Size))
|
||||||
|
{
|
||||||
|
g.DrawLine(pn, DrawOrigin.X, pos, Width - BarOption.Grid.Right, pos);
|
||||||
|
}
|
||||||
|
|
||||||
SizeF sf = g.MeasureString(line.Name, SubFont);
|
SizeF sf = g.MeasureString(line.Name, SubFont);
|
||||||
|
|
||||||
if (line.Left == UILeftAlignment.Left)
|
if (line.Left == UILeftAlignment.Left)
|
||||||
|
@ -36,7 +36,9 @@ namespace Sunny.UI
|
|||||||
public double Value { get; set; }
|
public double Value { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public Color Color { get; set; }
|
public Color Color { get; set; }
|
||||||
public UILeftAlignment Left { get; set; }
|
public UILeftAlignment Left { get; set; } = UILeftAlignment.Left;
|
||||||
|
|
||||||
|
public float Size { get; set; } = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UILegend
|
public class UILegend
|
||||||
|
@ -617,6 +617,8 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
base.OnDrawNode(e);
|
base.OnDrawNode(e);
|
||||||
|
|
||||||
|
if (e.Node==null) return;
|
||||||
|
|
||||||
if (BorderStyle == BorderStyle.Fixed3D) BorderStyle = BorderStyle.FixedSingle;
|
if (BorderStyle == BorderStyle.Fixed3D) BorderStyle = BorderStyle.FixedSingle;
|
||||||
|
|
||||||
if (e.Node == null || e.Node.Bounds.Width <= 0 && e.Node.Bounds.Height <= 0 && e.Node.Bounds.X <= 0 &&
|
if (e.Node == null || e.Node.Bounds.Width <= 0 && e.Node.Bounds.Height <= 0 && e.Node.Bounds.X <= 0 &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user