mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 08:50:10 +00:00
增加Ring的radiusGradient参数设置渐变方向
This commit is contained in:
@@ -76,6 +76,9 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
* (2024.09.01) 增加`Ring`的`radiusGradient`参数设置渐变方向
|
||||
* (2024.09.01) 优化`Axis`为时间轴时首个Label的位置
|
||||
|
||||
## v3.11.2
|
||||
|
||||
* (2024.08.01) 发布`v3.11.2`版本
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace XCharts.Editor
|
||||
PropertyField("m_RoundCap");
|
||||
PropertyField("m_Clockwise");
|
||||
PropertyField("m_AvoidLabelOverlap");
|
||||
PropertyField("m_RadiusGradient");
|
||||
|
||||
PropertyField("m_ItemStyle");
|
||||
PropertyField("m_Animation");
|
||||
|
||||
@@ -9,7 +9,20 @@ namespace XCharts.Runtime
|
||||
[SerieDataExtraField()]
|
||||
public class Ring : Serie
|
||||
{
|
||||
[SerializeField][Since("v3.12.0")] private bool m_RadiusGradient = false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to use gradient color in pie chart.
|
||||
/// || 是否开启半径方向的渐变效果。
|
||||
/// </summary>
|
||||
public bool radiusGradient
|
||||
{
|
||||
get { return m_RadiusGradient; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_RadiusGradient, value)) { SetVerticesDirty(); } }
|
||||
}
|
||||
|
||||
public override SerieColorBy defaultColorBy { get { return SerieColorBy.Data; } }
|
||||
|
||||
public static Serie AddDefaultSerie(BaseChart chart, string serieName)
|
||||
{
|
||||
var serie = chart.AddSerie<Ring>(serieName);
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace XCharts.Runtime
|
||||
DrawBackground(vh, serie, serieData, j, insideRadius, outsideRadius);
|
||||
UGL.DrawDoughnut(vh, serie.context.center, insideRadius, outsideRadius, itemColor, itemToColor,
|
||||
Color.clear, startDegree, toDegree, borderWidth, borderColor, 0, chart.settings.cicleSmoothness,
|
||||
roundCap, serie.clockwise);
|
||||
roundCap, serie.clockwise, serie.radiusGradient);
|
||||
DrawCenter(vh, serie, serieData, insideRadius, j == data.Count - 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user