mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-14 20:00:09 +00:00
修复HeatmapChart的Tooltip指示的位置不准的问题 #123
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
|
||||
## Latest
|
||||
|
||||
* (2021.02.26) Fixed incorrect position of `Tooltip` in `HeatmapChart` #123
|
||||
* (2021.02.22) Fixed compatibility issues with `Unity` version
|
||||
* (2021.02.21) Added `Tooltip` parameter `ignoreDataShow`
|
||||
* (2021.02.19) Fixed an issue where charts could appear abnormal when under `LayoutGroup` control #121
|
||||
* (2021.02.18) Fixed an issue where the `Radar` could not refresh itself after parameter changing #122
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
## Latest
|
||||
|
||||
* (2021.02.26) 修复`HeatmapChart`的`Tooltip`指示的位置不准的问题 #123
|
||||
* (2021.02.22) 修复`Unity`版本兼容问题
|
||||
* (2021.02.21) 增加`Tooltip`的`ignoreDataShow`参数
|
||||
* (2021.02.19) 修复图表在`LayoutGroup`控制下时可能显示错乱的问题 #121
|
||||
* (2021.02.18) 修复`Radar`参数变更后无法自刷新的问题 #122
|
||||
|
||||
@@ -28,9 +28,9 @@ namespace XCharts
|
||||
grid.bottom = 60;
|
||||
|
||||
m_XAxes[0].type = Axis.AxisType.Category;
|
||||
m_XAxes[0].boundaryGap = false;
|
||||
m_XAxes[0].boundaryGap = true;
|
||||
m_YAxes[0].type = Axis.AxisType.Category;
|
||||
m_YAxes[0].boundaryGap = false;
|
||||
m_YAxes[0].boundaryGap = true;
|
||||
m_XAxes[0].splitNumber = 10;
|
||||
m_YAxes[0].splitNumber = 10;
|
||||
RemoveData();
|
||||
|
||||
@@ -120,6 +120,8 @@ namespace XCharts
|
||||
if (serie.animation.HasFadeOut()) return;
|
||||
var yAxis = m_YAxes[serie.yAxisIndex];
|
||||
var xAxis = m_XAxes[serie.xAxisIndex];
|
||||
xAxis.boundaryGap = true;
|
||||
yAxis.boundaryGap = true;
|
||||
var grid = GetSerieGridOrDefault(serie);
|
||||
var xCount = xAxis.data.Count;
|
||||
var yCount = yAxis.data.Count;
|
||||
@@ -153,9 +155,11 @@ namespace XCharts
|
||||
serie.dataPoints.Add(Vector3.zero);
|
||||
continue;
|
||||
}
|
||||
var value = serieData.GetCurrData(dimension, dataChangeDuration, yAxis.inverse, yAxis.runtimeMinValue, yAxis.runtimeMaxValue);
|
||||
var value = serieData.GetCurrData(dimension, dataChangeDuration, yAxis.inverse,
|
||||
yAxis.runtimeMinValue, yAxis.runtimeMaxValue);
|
||||
if (serieData.IsDataChanged()) dataChanging = true;
|
||||
var pos = new Vector3(zeroX + (i + 0.5f) * xWidth, zeroY + (j + 0.5f) * yWidth);
|
||||
var pos = new Vector3(zeroX + (i + (xAxis.boundaryGap ? 0.5f : 0)) * xWidth,
|
||||
zeroY + (j + (yAxis.boundaryGap ? 0.5f : 0)) * yWidth);
|
||||
serie.dataPoints.Add(pos);
|
||||
serieData.canShowLabel = false;
|
||||
if (value == 0) continue;
|
||||
@@ -171,7 +175,9 @@ namespace XCharts
|
||||
}
|
||||
if (animationIndex >= 0 && i > animationIndex) continue;
|
||||
serieData.canShowLabel = true;
|
||||
var emphasis = (tooltip.show && i == (int)tooltip.runtimeXValues[0] && j == (int)tooltip.runtimeYValues[0])
|
||||
var emphasis = (tooltip.show
|
||||
&& i == (int)tooltip.runtimeXValues[0]
|
||||
&& j == (int)tooltip.runtimeYValues[0])
|
||||
|| visualMap.runtimeSelectedIndex > 0;
|
||||
var rectWid = xWidth - 2 * borderWidth;
|
||||
var rectHig = yWidth - 2 * borderWidth;
|
||||
@@ -180,10 +186,12 @@ namespace XCharts
|
||||
{
|
||||
UGL.DrawBorder(vh, pos, rectWid, rectHig, borderWidth, borderColor);
|
||||
}
|
||||
if (visualMap.hoverLink && emphasis && serie.emphasis.show && serie.emphasis.itemStyle.borderWidth > 0)
|
||||
if (visualMap.hoverLink && emphasis && serie.emphasis.show
|
||||
&& serie.emphasis.itemStyle.borderWidth > 0)
|
||||
{
|
||||
var emphasisBorderWidth = serie.emphasis.itemStyle.borderWidth;
|
||||
var emphasisBorderColor = serie.emphasis.itemStyle.opacity > 0 ? serie.emphasis.itemStyle.borderColor : ChartConst.clearColor32;
|
||||
var emphasisBorderColor = serie.emphasis.itemStyle.opacity > 0
|
||||
? serie.emphasis.itemStyle.borderColor : ChartConst.clearColor32;
|
||||
UGL.DrawBorder(vh, pos, rectWid, rectHig, emphasisBorderWidth, emphasisBorderColor);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user