完善HeatmapChartVisualMapPiecewise的支持

This commit is contained in:
monitor1394
2020-10-22 09:39:47 +08:00
parent 7e7d7270ab
commit 95cf5ed303
4 changed files with 7 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
# 更新日志
* (2020.10.22) Improve the support of `VisualMap` for `Piecewise` in `HeatmapChart`
* (2020.09.22) Fixed `PieChart` inconsistent border size
* (2020.09.18) Added `Remove All Chart Object` to Remove All child nodes under the Chart (automatically reinitialized)
* (2020.09.18) Fixed `SerieLabel` also displayed after hided `Serie` by clicked the legend #94

View File

@@ -1,6 +1,7 @@
# 更新日志
* (2020.10.22) 完善`HeatmapChart``VisualMap``Piecewise`的支持
* (2020.09.22) 修复`PieChart`边框大小不一致的问题
* (2020.09.19) 发布`v1.6.1`版本
* (2020.09.19) 增加`Remove All Chart Object`移除图表下的所有子节点(会自动重新初始化)

View File

@@ -454,7 +454,7 @@ namespace XCharts
if (splitNumber <= 0) return -1;
value = Mathf.Clamp(value, m_Min, m_Max);
var diff = (m_Max - m_Min) / (splitNumber - (IsPiecewise() ? 0 : 1));
var diff = (m_Max - m_Min) / (splitNumber - 1);
var index = -1;
for (int i = 0; i < splitNumber; i++)
{

View File

@@ -282,7 +282,7 @@ namespace XCharts
{
var splitPos = pos1 + dir * (i - 1 + 0.5f) * splitWid;
var startColor = colors[i - 1];
var toColor = colors[i];
var toColor = m_VisualMap.IsPiecewise() ? startColor : colors[i];
ChartDrawer.DrawPolygon(vh, splitPos, xRadius, yRadius, startColor, toColor, isVertical);
}
else if (rangeMin > splitMin && rangeMax >= splitMax)
@@ -291,7 +291,7 @@ namespace XCharts
var splitMaxPos = pos1 + dir * i * splitWid;
var splitPos = p0 + (splitMaxPos - p0) / 2;
var startColor = m_VisualMap.GetColor(m_VisualMap.rangeMin);
var toColor = colors[i];
var toColor = m_VisualMap.IsPiecewise() ? startColor : colors[i];
var yRadius1 = Vector3.Distance(p0, splitMaxPos) / 2;
if (m_VisualMap.orient == Orient.Vertical)
ChartDrawer.DrawPolygon(vh, splitPos, xRadius, yRadius1, startColor, toColor, isVertical);
@@ -304,7 +304,7 @@ namespace XCharts
var splitMinPos = pos1 + dir * (i - 1) * splitWid;
var splitPos = splitMinPos + (p0 - splitMinPos) / 2;
var startColor = colors[i - 1];
var toColor = m_VisualMap.GetColor(m_VisualMap.rangeMax);
var toColor = m_VisualMap.IsPiecewise() ? startColor : m_VisualMap.GetColor(m_VisualMap.rangeMax);
var yRadius1 = Vector3.Distance(p0, splitMinPos) / 2;
if (m_VisualMap.orient == Orient.Vertical)
ChartDrawer.DrawPolygon(vh, splitPos, xRadius, yRadius1, startColor, toColor, isVertical);
@@ -332,7 +332,7 @@ namespace XCharts
{
var splitPos = pos1 + dir * (i - 1 + 0.5f) * splitWid;
var startColor = colors[i - 1];
var toColor = colors[i];
var toColor = m_VisualMap.IsPiecewise() ? startColor : colors[i];
ChartDrawer.DrawPolygon(vh, splitPos, xRadius, yRadius, startColor, toColor, isVertical);
}
}