mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-31 05:48:45 +00:00
优化Tooltip的LineStyle支持设置Shadow时的颜色
This commit is contained in:
@@ -562,7 +562,7 @@ namespace XCharts.Runtime
|
|||||||
break;
|
break;
|
||||||
Vector2 sp = new Vector2(pX, grid.context.y);
|
Vector2 sp = new Vector2(pX, grid.context.y);
|
||||||
Vector2 ep = new Vector2(pX, grid.context.y + grid.context.height);
|
Vector2 ep = new Vector2(pX, grid.context.y + grid.context.height);
|
||||||
var lineColor = TooltipHelper.GetLineColor(tooltip, chart.theme);
|
var lineColor = TooltipHelper.GetLineColor(tooltip, chart.theme.tooltip.lineColor);
|
||||||
ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, sp, ep, lineColor);
|
ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, sp, ep, lineColor);
|
||||||
if (tooltip.type == Tooltip.Type.Corss)
|
if (tooltip.type == Tooltip.Type.Corss)
|
||||||
{
|
{
|
||||||
@@ -584,7 +584,8 @@ namespace XCharts.Runtime
|
|||||||
Vector3 p2 = new Vector3(pX, pY);
|
Vector3 p2 = new Vector3(pX, pY);
|
||||||
Vector3 p3 = new Vector3(pX + tooltipSplitWid, pY);
|
Vector3 p3 = new Vector3(pX + tooltipSplitWid, pY);
|
||||||
Vector3 p4 = new Vector3(pX + tooltipSplitWid, grid.context.y);
|
Vector3 p4 = new Vector3(pX + tooltipSplitWid, grid.context.y);
|
||||||
UGL.DrawQuadrilateral(vh, p1, p2, p3, p4, chart.theme.tooltip.areaColor);
|
var areaColor = TooltipHelper.GetLineColor(tooltip, chart.theme.tooltip.areaColor);
|
||||||
|
UGL.DrawQuadrilateral(vh, p1, p2, p3, p4, areaColor);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -625,7 +626,7 @@ namespace XCharts.Runtime
|
|||||||
break;
|
break;
|
||||||
Vector2 sp = new Vector2(grid.context.x, pY);
|
Vector2 sp = new Vector2(grid.context.x, pY);
|
||||||
Vector2 ep = new Vector2(grid.context.x + grid.context.width, pY);
|
Vector2 ep = new Vector2(grid.context.x + grid.context.width, pY);
|
||||||
var lineColor = TooltipHelper.GetLineColor(tooltip, chart.theme);
|
var lineColor = TooltipHelper.GetLineColor(tooltip, chart.theme.tooltip.lineColor);
|
||||||
ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, sp, ep, lineColor);
|
ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, sp, ep, lineColor);
|
||||||
if (tooltip.type == Tooltip.Type.Corss)
|
if (tooltip.type == Tooltip.Type.Corss)
|
||||||
{
|
{
|
||||||
@@ -660,7 +661,7 @@ namespace XCharts.Runtime
|
|||||||
if (tooltip.context.angle < 0) return;
|
if (tooltip.context.angle < 0) return;
|
||||||
var theme = chart.theme;
|
var theme = chart.theme;
|
||||||
var m_AngleAxis = ComponentHelper.GetAngleAxis(chart.components, m_Polar.index);
|
var m_AngleAxis = ComponentHelper.GetAngleAxis(chart.components, m_Polar.index);
|
||||||
var lineColor = TooltipHelper.GetLineColor(tooltip, theme);
|
var lineColor = TooltipHelper.GetLineColor(tooltip, theme.tooltip.lineColor);
|
||||||
var lineType = tooltip.lineStyle.GetType(theme.tooltip.lineType);
|
var lineType = tooltip.lineStyle.GetType(theme.tooltip.lineType);
|
||||||
var lineWidth = tooltip.lineStyle.GetWidth(theme.tooltip.lineWidth);
|
var lineWidth = tooltip.lineStyle.GetWidth(theme.tooltip.lineWidth);
|
||||||
var cenPos = m_Polar.context.center;
|
var cenPos = m_Polar.context.center;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ namespace XCharts.Runtime
|
|||||||
else return tooltip.numericFormatter;
|
else return tooltip.numericFormatter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Color32 GetLineColor(Tooltip tooltip, ThemeStyle theme)
|
public static Color32 GetLineColor(Tooltip tooltip, Color32 defaultColor)
|
||||||
{
|
{
|
||||||
var lineStyle = tooltip.lineStyle;
|
var lineStyle = tooltip.lineStyle;
|
||||||
if (!ChartHelper.IsClearColor(lineStyle.color))
|
if (!ChartHelper.IsClearColor(lineStyle.color))
|
||||||
@@ -96,7 +96,7 @@ namespace XCharts.Runtime
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var color = theme.tooltip.lineColor;
|
var color = defaultColor;
|
||||||
ChartHelper.SetColorOpacity(ref color, lineStyle.opacity);
|
ChartHelper.SetColorOpacity(ref color, lineStyle.opacity);
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user