From dc1040ab02bc935b0530cc0209ebc4256d75ec2d Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 10 May 2021 08:27:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`RingChart`=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=8E=AF=E5=BD=A2=E7=9A=84=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E8=89=B2=E7=9A=84=E9=97=AE=E9=A2=98=20#141?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG-EN.md | 1 + CHANGELOG.md | 1 + Runtime/Internal/DrawSerieRing.cs | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-EN.md b/CHANGELOG-EN.md index 30e27a35..823c9891 100644 --- a/CHANGELOG-EN.md +++ b/CHANGELOG-EN.md @@ -34,6 +34,7 @@ ## Latest +* (2021.05.09) Fixed an issue where `RingChart` could not set the background color of the ring #141 * (2021.05.08) Added `Liquidchart` support for `Rect` shape * (2021.05.07) Improved the `Axis` scale performance #135 * (2021.05.01) Added `Settings` parameters for painter's material #140 diff --git a/CHANGELOG.md b/CHANGELOG.md index 95beadce..fe51b4b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ ## Latest +* (2021.05.09) 修复`RingChart`无法设置环形的背景色的问题 #141 * (2021.05.08) 增加`LiquidChart`的方形水位图支持 * (2021.05.07) 优化`Axis`的刻度表现 #135 * (2021.05.01) 增加`Settings`中关于关于材质球设置的参数 #140 diff --git a/Runtime/Internal/DrawSerieRing.cs b/Runtime/Internal/DrawSerieRing.cs index ec5bbc4f..e990a927 100644 --- a/Runtime/Internal/DrawSerieRing.cs +++ b/Runtime/Internal/DrawSerieRing.cs @@ -31,7 +31,7 @@ namespace XCharts public void CheckComponent() { } - + public void Update() { if (m_UpdateTitleText) @@ -98,6 +98,12 @@ namespace XCharts serieData.runtimePieToAngle = serie.clockwise ? toDegree : startDegree; serieData.runtimePieInsideRadius = insideRadius; serieData.runtimePieOutsideRadius = outsideRadius; + if (itemStyle.backgroundColor.a != 0) + { + UGL.DrawDoughnut(vh, serie.runtimeCenterPos, insideRadius, outsideRadius, itemStyle.backgroundColor, + itemStyle.backgroundColor, Color.clear, 0, 360, borderWidth, borderColor, 0, + chart.settings.cicleSmoothness, false, serie.clockwise); + } UGL.DrawDoughnut(vh, serie.runtimeCenterPos, insideRadius, outsideRadius, itemColor, itemToColor, Color.clear, startDegree, toDegree, borderWidth, borderColor, 0, chart.settings.cicleSmoothness, roundCap, serie.clockwise);