mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 15:00:08 +00:00
修复Pie无数据时绘制异常的问题
This commit is contained in:
@@ -68,6 +68,7 @@ slug: /changelog
|
||||
|
||||
## master
|
||||
|
||||
* (2023.09.16) 修复`Pie`无数据时绘制异常的问题
|
||||
* (2023.09.12) 增加`Pie`的`radiusGradient`可设置半径方向的渐变效果
|
||||
* (2023.09.05) 优化`LabelLine`的`lineEndX`在`Pie`中的表现
|
||||
* (2023.09.05) 修复`TriggerTooltip()`接口对`Ring`无效的问题
|
||||
|
||||
@@ -348,6 +348,16 @@ namespace XCharts.Runtime
|
||||
&& !serie.animation.IsFadeIn() && !serie.animation.IsFadeOut();
|
||||
var data = serie.data;
|
||||
serie.animation.InitProgress(0, 360);
|
||||
if (data.Count == 0)
|
||||
{
|
||||
var itemStyle = SerieHelper.GetItemStyle(serie, null);
|
||||
var fillColor = ChartHelper.IsClearColor(itemStyle.backgroundColor) ?
|
||||
(Color32)chart.theme.legend.unableColor : itemStyle.backgroundColor;
|
||||
UGL.DrawDoughnut(vh, serie.context.center, serie.context.insideRadius,
|
||||
serie.context.outsideRadius, fillColor, fillColor, Color.clear, 0,
|
||||
360, itemStyle.borderWidth, itemStyle.borderColor, serie.gap / 2, chart.settings.cicleSmoothness,
|
||||
false, true, serie.radiusGradient);
|
||||
}
|
||||
for (int n = 0; n < data.Count; n++)
|
||||
{
|
||||
var serieData = data[n];
|
||||
|
||||
@@ -201,6 +201,7 @@ namespace XCharts.Runtime
|
||||
/// <returns></returns>
|
||||
public static bool IsAllZeroValue(Serie serie, int dimension = 1)
|
||||
{
|
||||
if (serie.dataCount == 0) return false;
|
||||
foreach (var serieData in serie.data)
|
||||
{
|
||||
if (serieData.GetData(dimension) != 0) return false;
|
||||
|
||||
Reference in New Issue
Block a user