增加GanttChart甘特图

This commit is contained in:
monitor1394
2021-03-25 12:55:52 +08:00
parent e8fdea764c
commit da383c80ae
47 changed files with 968 additions and 72 deletions

View File

@@ -188,9 +188,8 @@ namespace XCharts
}
else
{
var content = m_Formatter.Replace("{value}", category);
content = content.Replace("\\n", "\n");
content = content.Replace("<br/>", "\n");
var content = m_Formatter;
FormatterHelper.ReplaceAxisLabelContent(ref content, category);
return m_TextLimit.GetLimitContent(content);
}
}
@@ -224,5 +223,21 @@ namespace XCharts
return content;
}
}
public string GetFormatterDateTime(DateTime dateTime)
{
var format = string.IsNullOrEmpty(numericFormatter) ? "yyyy/M/d" : numericFormatter;
if (!string.IsNullOrEmpty(m_Formatter))
{
var content = m_Formatter;
FormatterHelper.ReplaceAxisLabelContent(ref content, dateTime.ToString(format));
return m_TextLimit.GetLimitContent(content);
}
else
{
var content = dateTime.ToString(format);
return m_TextLimit.GetLimitContent(content);
}
}
}
}

View File

@@ -5,11 +5,8 @@
/* */
/************************************************/
using System.Linq;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
namespace XCharts
{
@@ -191,6 +188,10 @@ namespace XCharts
/// </summary>
public float runtimePieOffsetRadius { get; internal set; }
public Vector3 runtimePosition { get; internal set; }
/// <summary>
/// 绘制区域。
/// </summary>
public Rect runtimeRect { get; internal set; }
public float runtimeAngle { get; internal set; }
public Vector3 runtiemPieOffsetCenter { get; internal set; }
public float runtimeStackHig { get; internal set; }

View File

@@ -85,5 +85,13 @@ namespace XCharts
runtimeText.SetText(text);
}
}
public void SetColor(Color color)
{
if (runtimeText != null)
{
runtimeText.SetColor(color);
}
}
}
}