* UILineChart:更新X轴坐标文字格式化自定义格式化字符串

This commit is contained in:
Sunny 2020-11-18 22:22:59 +08:00
parent e8a78979af
commit 325a384b4f
2 changed files with 12 additions and 2 deletions

Binary file not shown.

View File

@ -180,9 +180,19 @@ namespace Sunny.UI
{
string label;
if (Option.XAxisType == UIAxisType.DateTime)
label = new DateTimeInt64(XLabels[i]).ToString(XScale.Format);
{
if (Option.XAxis.AxisLabel.AutoFormat)
label = new DateTimeInt64(XLabels[i]).ToString(XScale.Format);
else
label = new DateTimeInt64(XLabels[i]).ToString(Option.XAxis.AxisLabel.DateTimeFormat);
}
else
label = XLabels[i].ToString(XScale.Format);
{
if (Option.XAxis.AxisLabel.AutoFormat)
label = XLabels[i].ToString(XScale.Format);
else
label = new DateTimeInt64(XLabels[i]).ToString("F" + Option.XAxis.AxisLabel.DecimalCount);
}
SizeF sf = g.MeasureString(label, SubFont);
g.DrawString(label, SubFont, ChartStyle.ForeColor, x - sf.Width / 2.0f, DrawOrigin.Y + Option.XAxis.AxisTick.Length);