mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-28 12:08:46 +00:00
完善HeatmapChart中VisualMap对Piecewise的支持
This commit is contained in:
@@ -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.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) 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
|
* (2020.09.18) Fixed `SerieLabel` also displayed after hided `Serie` by clicked the legend #94
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
* (2020.10.22) 完善`HeatmapChart`中`VisualMap`对`Piecewise`的支持
|
||||||
* (2020.09.22) 修复`PieChart`边框大小不一致的问题
|
* (2020.09.22) 修复`PieChart`边框大小不一致的问题
|
||||||
* (2020.09.19) 发布`v1.6.1`版本
|
* (2020.09.19) 发布`v1.6.1`版本
|
||||||
* (2020.09.19) 增加`Remove All Chart Object`移除图表下的所有子节点(会自动重新初始化)
|
* (2020.09.19) 增加`Remove All Chart Object`移除图表下的所有子节点(会自动重新初始化)
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ namespace XCharts
|
|||||||
if (splitNumber <= 0) return -1;
|
if (splitNumber <= 0) return -1;
|
||||||
value = Mathf.Clamp(value, m_Min, m_Max);
|
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;
|
var index = -1;
|
||||||
for (int i = 0; i < splitNumber; i++)
|
for (int i = 0; i < splitNumber; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
var splitPos = pos1 + dir * (i - 1 + 0.5f) * splitWid;
|
var splitPos = pos1 + dir * (i - 1 + 0.5f) * splitWid;
|
||||||
var startColor = colors[i - 1];
|
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);
|
ChartDrawer.DrawPolygon(vh, splitPos, xRadius, yRadius, startColor, toColor, isVertical);
|
||||||
}
|
}
|
||||||
else if (rangeMin > splitMin && rangeMax >= splitMax)
|
else if (rangeMin > splitMin && rangeMax >= splitMax)
|
||||||
@@ -291,7 +291,7 @@ namespace XCharts
|
|||||||
var splitMaxPos = pos1 + dir * i * splitWid;
|
var splitMaxPos = pos1 + dir * i * splitWid;
|
||||||
var splitPos = p0 + (splitMaxPos - p0) / 2;
|
var splitPos = p0 + (splitMaxPos - p0) / 2;
|
||||||
var startColor = m_VisualMap.GetColor(m_VisualMap.rangeMin);
|
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;
|
var yRadius1 = Vector3.Distance(p0, splitMaxPos) / 2;
|
||||||
if (m_VisualMap.orient == Orient.Vertical)
|
if (m_VisualMap.orient == Orient.Vertical)
|
||||||
ChartDrawer.DrawPolygon(vh, splitPos, xRadius, yRadius1, startColor, toColor, isVertical);
|
ChartDrawer.DrawPolygon(vh, splitPos, xRadius, yRadius1, startColor, toColor, isVertical);
|
||||||
@@ -304,7 +304,7 @@ namespace XCharts
|
|||||||
var splitMinPos = pos1 + dir * (i - 1) * splitWid;
|
var splitMinPos = pos1 + dir * (i - 1) * splitWid;
|
||||||
var splitPos = splitMinPos + (p0 - splitMinPos) / 2;
|
var splitPos = splitMinPos + (p0 - splitMinPos) / 2;
|
||||||
var startColor = colors[i - 1];
|
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;
|
var yRadius1 = Vector3.Distance(p0, splitMinPos) / 2;
|
||||||
if (m_VisualMap.orient == Orient.Vertical)
|
if (m_VisualMap.orient == Orient.Vertical)
|
||||||
ChartDrawer.DrawPolygon(vh, splitPos, xRadius, yRadius1, startColor, toColor, isVertical);
|
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 splitPos = pos1 + dir * (i - 1 + 0.5f) * splitWid;
|
||||||
var startColor = colors[i - 1];
|
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);
|
ChartDrawer.DrawPolygon(vh, splitPos, xRadius, yRadius, startColor, toColor, isVertical);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user