* UIBarChart: 修复Y轴文字居中

This commit is contained in:
Sunny 2023-06-06 21:59:43 +08:00
parent fcaddef7b4
commit 184bf0ca8b
42 changed files with 57 additions and 56 deletions

View File

@ -27,9 +27,10 @@
* 2022-08-10: V3.2.2 Y轴显示名称
* 2022-08-17: V3.2.3 Nan
* 2022-09-07: V3.2.3 Option.YAxis.ShowGridLine为false时线
* 2022-05-10: V3.3.6 Option.ShowFullRect为true时线
* 2022-05-13: V3.3.6 Option.BarInterval,Bar之间间隔-1
* 2022-05-14: V3.3.6 DrawString函数
* 2023-05-10: V3.3.6 Option.ShowFullRect为true时线
* 2023-05-13: V3.3.6 Option.BarInterval,Bar之间间隔-1
* 2023-05-14: V3.3.6 DrawString函数
* 2023-06-06: V3.3.7 Y轴文字居中
******************************************************************************/
using System;
@ -565,10 +566,10 @@ namespace Sunny.UI
if (Option.YAxis.AxisLabel.Show && Option.YAxis.Name.IsValid())
{
Size sfname = TextRenderer.MeasureText(Option.YAxis.Name, TempFont);
int x = (int)(DrawOrigin.X - Option.YAxis.AxisTick.Length - wmax - sfname.Height);
int y = (int)(Option.Grid.Top + (DrawSize.Height - sfname.Width) / 2);
g.DrawRotateString(Option.YAxis.Name, TempFont, ForeColor, new Point(x, y), new StringFormat() { Alignment = StringAlignment.Center }, 270);
Size sfName = TextRenderer.MeasureText(Option.YAxis.Name, TempFont);
float xx = DrawOrigin.X - Option.YAxis.AxisTick.Length - wmax - sfName.Height / 2.0f;
float yy = Option.Grid.Top + DrawSize.Height / 2.0f;
g.DrawRotateString(Option.YAxis.Name, TempFont, ForeColor, new PointF(xx, yy), 270);
}
}

View File

@ -18,7 +18,7 @@
*
* 2020-06-06: V2.2.5
* 2020-09-10: V2.2.7 线
* 2022-05-14: V3.3.6 DrawString函数
* 2023-05-14: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -19,7 +19,7 @@
* 2020-06-06: V2.2.5
* 2021-07-22: V3.0.5
* 2022-07-29: V3.2.2 Option.DecimalPlaces
* 2022-05-14: V3.3.6 DrawString函数
* 2023-05-14: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -43,7 +43,7 @@
* 2023-03-26: V3.3.3 X轴坐标时
* 2023-04-23: V3.3.5 Smooth绘制
* 2023-05-12: V3.3.6 线
* 2022-05-14: V3.3.6 DrawString函数
* 2023-05-14: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -19,7 +19,7 @@
* 2020-06-06: V2.2.5
* 2021-07-22: V3.0.5
* 2022-07-29: V3.2.2 Option.DecimalPlaces
* 2022-05-14: V3.3.6 DrawString函数
* 2023-05-14: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -20,7 +20,7 @@
* 2020-05-29: V2.2.5
* 2020-07-04: V2.2.6
* 2023-03-26: V3.3.3 Bug
* 2022-05-13: V3.3.6 DrawString函数
* 2023-05-13: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -19,7 +19,7 @@
* 2020-01-01: V2.2.0
* 2020-05-29: V2.2.5
* 2020-07-08: V2.2.6
* 2022-05-13: V3.3.6 DrawString函数
* 2023-05-13: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -23,8 +23,8 @@
* 2023-02-07: V3.3.1 Tips小红点
* 2023-04-08: V3.3.4 DropDownList时
* 2023-05-08: V3.3.6
* 2022-05-12: V3.3.6 DrawString函数
* 2022-05-16: V3.3.6 DrawFontImage函数
* 2023-05-12: V3.3.6 DrawString函数
* 2023-05-16: V3.3.6 DrawFontImage函数
******************************************************************************/
using System;

View File

@ -18,7 +18,7 @@
*
* 2020-01-01: V2.2.0
* 2022-03-19: V3.1.1
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -20,7 +20,7 @@
* 2022-01-26: V3.1.0 AlignBothEnds
* 2022-01-26: V3.1.0
* 2022-03-19: V3.1.1
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -27,7 +27,7 @@
* 2022-03-19: V3.1.1
* 2022-03-31: V3.1.2
* 2022-08-25: V3.2.3 GroupIndex的按钮控件的Selected单选
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -17,7 +17,7 @@
* : 2022-06-28
*
* 2022-06-28: V3.2.0
* 2022-05-13: V3.3.6 DrawString函数
* 2023-05-13: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -21,7 +21,7 @@
* 2020-04-25: V2.2.4
* 2021-04-26: V3.0.3 CheckedChanged
* 2022-03-19: V3.1.1
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -23,7 +23,7 @@
* 2022-02-16: V3.1.1
* 2022-03-19: V3.1.1
* 2023-02-03: V3.3.1 WIN10系统响应触摸屏的按下和弹起事件
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -20,7 +20,7 @@
* 2021-09-24: V3.0.7 Column列显示方向一致
* 2021-11-22: V3.0.9
* 2022-09-05: V3.2.3
* 2022-05-15: V3.3.6 DrawString函数
* 2023-05-15: V3.3.6 DrawString函数
******************************************************************************/
using System.Collections.Generic;

View File

@ -20,7 +20,7 @@
* 2022-12-18: V3.3.0 0Text为空仍有显示的问题
* 2023-03-07: V3.3.3
* 2023-04-19: V3.3.5
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -19,7 +19,7 @@
* 2020-01-01: V2.2.0
* 2020-04-25: V2.2.4
* 2022-05-30: V3.1.9 Padding设置
* 2022-05-13: V3.3.6 DrawString函数
* 2023-05-13: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -24,8 +24,8 @@
* 2021-12-07: V3.0.9
* 2022-01-02: V3.0.9
* 2022-03-19: V3.1.1
* 2022-05-13: V3.3.6 DrawString函数
* 2022-05-16: V3.3.6 DrawFontImage函数
* 2023-05-13: V3.3.6 DrawString函数
* 2023-05-16: V3.3.6 DrawFontImage函数
******************************************************************************/
using System;

View File

@ -19,8 +19,8 @@
* 2022-01-29: V3.1.0
* 2022-11-02: V3.2.6 TextChanged事件
* 2022-12-02: V3.3.0 TextChanged事件ValueChanged事件
* 2022-05-10: V3.3.6 Enabled切换时背景色不一致的问题
* 2022-05-13: V3.3.6 DrawString函数
* 2023-05-10: V3.3.6 Enabled切换时背景色不一致的问题
* 2023-05-13: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -19,7 +19,7 @@
* 2020-01-01: V2.2.0
* 2022-03-19: V3.1.1
* 2023-05-04: V3.3.6 PerformClick
* 2022-05-13: V3.3.6 DrawString函数
* 2023-05-13: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -24,7 +24,7 @@
* 2022-08-30: V3.2.3
* 2022-09-05: V3.2.3 ClickDoubleClick事件
* 2022-11-03: V3.2.6
* 2022-05-13: V3.3.6 DrawString函数
* 2023-05-13: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -20,7 +20,7 @@
* 2021-06-19: V3.0.4
* 2021-08-07: V3.0.5 线
* 2022-05-15: V3.1.8
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -21,7 +21,7 @@
* 2022-01-10: V3.1.0
* 2022-03-19: V3.1.1
* 2022-11-26: V3.2.9 线
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -16,8 +16,8 @@
* : V3.1
* : 2022-05-12
*
* 2022-05-12: V3.3.6
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -25,8 +25,8 @@
* 2022-04-14: V3.1.3
* 2022-07-28: V3.2.2
* 2023-02-22: V3.3.2
* 2022-05-12: V3.3.6 DrawString函数
* 2022-05-16: V3.3.6 DrawFontImage函数
* 2023-05-12: V3.3.6 DrawString函数
* 2023-05-16: V3.3.6 DrawFontImage函数
******************************************************************************/
using System;

View File

@ -33,8 +33,8 @@
* 2022-11-03: V3.2.6
* 2023-02-02: V3.3.1
* 2023-02-10: V3.3.2 /
* 2022-05-12: V3.3.6 DrawString函数
* 2022-05-16: V3.3.6 DrawFontImage函数
* 2023-05-12: V3.3.6 DrawString函数
* 2023-05-16: V3.3.6 DrawFontImage函数
* 2023-05-29: V3.3.7 PageGuid相关扩展方法
******************************************************************************/

View File

@ -23,7 +23,7 @@
* 2021-10-14: V3.0.8 3
* 2022-03-19: V3.1.1
* 2022-09-05: V3.2.3 1
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -22,7 +22,7 @@
* 2021-04-26: V3.0.3 CheckedChanged
* 2022-03-19: V3.1.1
* 2022-12-21: V3.3.0 CheckedChanged事件
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -20,7 +20,7 @@
* 2021-07-16: V3.0.5
* 2022-03-19: V3.1.1
* 2023-02-23: V3.3.2
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -24,7 +24,7 @@
* 2022-03-19: V3.1.1
* 2022-09-26: V3.2.4 Readonly时
* 2022-04-23: V3.3.5 ActiveChanging事件
* 2022-05-13: V3.3.6 DrawString函数
* 2023-05-13: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -20,8 +20,8 @@
* 2020-07-26: V2.2.6 Image属性
* 2022-01-05: V3.0.9
* 2022-03-19: V3.1.1
* 2022-05-15: V3.3.6 DrawString函数
* 2022-05-16: V3.3.6 DrawFontImage函数
* 2023-05-15: V3.3.6 DrawString函数
* 2023-05-16: V3.3.6 DrawFontImage函数
******************************************************************************/
using System;

View File

@ -19,8 +19,8 @@
* 2020-04-23: V2.2.4 UISymbolLabel
* 2021-12-24: V3.0.9 Dock和AutoSize同时设置的Bug
* 2022-03-19: V3.1.1
* 2022-05-12: V3.3.6 DrawString函数
* 2022-05-16: V3.3.6 DrawFontImage函数
* 2023-05-12: V3.3.6 DrawString函数
* 2023-05-16: V3.3.6 DrawFontImage函数
******************************************************************************/
using System;

View File

@ -30,7 +30,7 @@
* 2022-05-11: V3.1.8 使
* 2022-05-17: V3.1.9
* 2022-06-19: V3.2.0 UIPage的FormClosed事件
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using Sunny.UI.Win32;

View File

@ -18,7 +18,7 @@
*
* 2020-01-01: V2.2.0
* 2022-08-11: V3.0.2 ItemSize
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -24,7 +24,7 @@
* 2022-10-28: V3.2.6
* 2023-05-02: V3.3.6
* 2023-05-12: V3.3.6 TextAlign改为TextAlignment
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -20,7 +20,7 @@
* 2020-07-25: V2.2.6
* 2021-08-16: V3.0.6 ToolTip接口UITextBox这类的组合控件无法显示ToolTip的问题
* 2021-12-09: V3.0.9
* 2022-05-14: V3.3.6 DrawString函数
* 2023-05-14: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -32,7 +32,7 @@
* 2022-12-06: V3.3.0
* 2023-03-13: V3.3.3 MouseDoubleClick和MouseClick事件
* 2023-03-26: V3.3.4 LabelEdit属性
* 2022-05-13: V3.3.6 DrawString函数
* 2023-05-13: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -18,7 +18,7 @@
*
* 2022-04-02: V3.1.1
* 2022-04-02: V3.1.2 AutoScaleMode为None
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -17,7 +17,7 @@
* : 2022-06-11
*
* 2022-06-11: V3.1.9
* 2022-05-16: V3.3.6 DrawString函数
* 2023-05-16: V3.3.6 DrawString函数
* 2022-05-28: V3.3.7
******************************************************************************/

View File

@ -21,7 +21,7 @@
* https://gitee.com/maikebing
* 2021-06-15: V3.0.4 FontAwesomeV5的字体图标
* 2021-06-15: V3.3.5 FontAwesomeV6的字体图标
* 2022-05-16: V3.3.6 DrawFontImage函数
* 2023-05-16: V3.3.6 DrawFontImage函数
* 2022-05-17: V3.3.7
******************************************************************************/

View File

@ -45,7 +45,7 @@
* 2022-11-30: V3.3.0 RemoveAllPages函数
* 2023-01-25: V3.3.1
* 2023-02-24: V3.3.2 PageSelected可能未显示选中页面的问题
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;

View File

@ -36,7 +36,7 @@
* 2023-02-24: V3.3.2 PageDeselecting
* 2023-02-24: V3.3.2 Dock.Fill
* 2023-03-15: V3.3.3
* 2022-05-12: V3.3.6 DrawString函数
* 2023-05-12: V3.3.6 DrawString函数
******************************************************************************/
using System;