mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 02:10:16 +00:00
修复PieChart选中扇区后鼠标区域指示不准确的问题
This commit is contained in:
@@ -38,6 +38,8 @@
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2021.07.04) Fixed incorrect mouse area indication after `PieChart` selected sector
|
||||||
|
* (2021.07.04) Optimize when the `Label` of `PieChart` is `Inside`, the offset can be adjusted by the parameter `Margin`
|
||||||
* (2021.07.01) Added `DataZoom` arguments to `supportInsideScroll` and `supportInsideDrag` to set whether scrolling and dragging are supported in the coordinate system
|
* (2021.07.01) Added `DataZoom` arguments to `supportInsideScroll` and `supportInsideDrag` to set whether scrolling and dragging are supported in the coordinate system
|
||||||
* (2021.06.27) Add `showStartLabel` and `showEndLabel` arguments to `AxisLabel` to set whether the `Label` should be displayed at the beginning and end of the `AxisLabel`
|
* (2021.06.27) Add `showStartLabel` and `showEndLabel` arguments to `AxisLabel` to set whether the `Label` should be displayed at the beginning and end of the `AxisLabel`
|
||||||
* (2021.06.27) Added `formatter` delegate method to `AxisLabel` and `SerieLabel` (#145)
|
* (2021.06.27) Added `formatter` delegate method to `AxisLabel` and `SerieLabel` (#145)
|
||||||
|
|||||||
@@ -38,6 +38,8 @@
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2021.07.04) 修复`PieChart`选中扇区后鼠标区域指示不准确的问题
|
||||||
|
* (2021.07.04) 优化`PieChart`的`Label`为`Inside`时可通过参数`Margin`调节偏移
|
||||||
* (2021.07.01) 增加`DataZoom`的`supportInsideScroll`和`supportInsideDrag`参数设置坐标系内是否支持滚动和拖拽
|
* (2021.07.01) 增加`DataZoom`的`supportInsideScroll`和`supportInsideDrag`参数设置坐标系内是否支持滚动和拖拽
|
||||||
* (2021.06.27) 增加`AxisLabel`的`showStartLabel`和`showEndLabel`参数设置首尾的`Label`是否显示
|
* (2021.06.27) 增加`AxisLabel`的`showStartLabel`和`showEndLabel`参数设置首尾的`Label`是否显示
|
||||||
* (2021.06.27) 增加`AxisLabel`和`SerieLabel`的`formatter`委托方法 (#145)
|
* (2021.06.27) 增加`AxisLabel`和`SerieLabel`的`formatter`委托方法 (#145)
|
||||||
|
|||||||
@@ -566,7 +566,6 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
if (serie.type != SerieType.Pie) return -1;
|
if (serie.type != SerieType.Pie) return -1;
|
||||||
var dist = Vector2.Distance(local, serie.runtimeCenterPos);
|
var dist = Vector2.Distance(local, serie.runtimeCenterPos);
|
||||||
if (dist < serie.runtimeInsideRadius || dist > serie.runtimeOutsideRadius) return -1;
|
|
||||||
Vector2 dir = local - new Vector2(serie.runtimeCenterPos.x, serie.runtimeCenterPos.y);
|
Vector2 dir = local - new Vector2(serie.runtimeCenterPos.x, serie.runtimeCenterPos.y);
|
||||||
float angle = ChartHelper.GetAngle360(Vector2.up, dir);
|
float angle = ChartHelper.GetAngle360(Vector2.up, dir);
|
||||||
for (int i = 0; i < serie.data.Count; i++)
|
for (int i = 0; i < serie.data.Count; i++)
|
||||||
@@ -574,7 +573,12 @@ namespace XCharts
|
|||||||
var serieData = serie.data[i];
|
var serieData = serie.data[i];
|
||||||
if (angle >= serieData.runtimePieStartAngle && angle <= serieData.runtimePieToAngle)
|
if (angle >= serieData.runtimePieStartAngle && angle <= serieData.runtimePieToAngle)
|
||||||
{
|
{
|
||||||
return i;
|
var ndist = !serieData.selected ? dist :
|
||||||
|
Vector2.Distance(local, serieData.runtiemPieOffsetCenter);
|
||||||
|
if (ndist >= serieData.runtimePieInsideRadius && ndist <= serieData.runtimePieOutsideRadius)
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user