优化RingChart的渐变效果

This commit is contained in:
monitor1394
2021-08-31 21:05:02 +08:00
parent 608ba43246
commit 9d8b95ddc4
3 changed files with 10 additions and 0 deletions

View File

@@ -39,6 +39,7 @@
## master
* (2021.08.31) Optimized the gradient effect of `RingChart`
* (2021.08.31) Fixed bug where `SerieLabel` does not refresh when `DataZoom` is dragged (#165)
* (2021.08.25) Fixed an issue where the theme switch could not be save to the scene (#166)
* (2021.08.24) Added `Animation`'s `alongWithLinePath`

View File

@@ -39,6 +39,7 @@
## master
* (2021.08.31) 优化`RingChart`的渐变效果
* (2021.08.31) 修复`DataZoom`拖动时`SerieLabel`不刷新的问题 (#165)
* (2021.08.25) 修复`Theme`主题切换无法保持到场景上的问题 (#166)
* (2021.08.24) 增加`Animation``alongWithLinePath`参数设置折线轨迹匀速动画

View File

@@ -104,6 +104,14 @@ namespace XCharts
itemStyle.backgroundColor, Color.clear, 0, 360, borderWidth, borderColor, 0,
chart.settings.cicleSmoothness, false, serie.clockwise);
}
var isGradient = !UGLHelper.IsValueEqualsColor(itemColor, itemToColor);
if (isGradient)
{
if (serie.clockwise)
itemToColor = Color.Lerp(itemColor, itemToColor, toDegree / (startDegree + 360));
else
itemToColor = Color.Lerp(itemToColor, itemColor, toDegree / (startDegree + 360));
}
UGL.DrawDoughnut(vh, serie.runtimeCenterPos, insideRadius, outsideRadius, itemColor, itemToColor,
Color.clear, startDegree, toDegree, borderWidth, borderColor, 0, chart.settings.cicleSmoothness,
roundCap, serie.clockwise);