mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 01:10:08 +00:00
完善BarChart的Zebra斑马柱图渐变支持
This commit is contained in:
@@ -1689,11 +1689,11 @@ namespace XCharts
|
||||
}
|
||||
|
||||
public void Internal_CheckClipAndDrawZebraLine(VertexHelper vh, Vector3 p1, Vector3 p2, float size, float zebraWidth,
|
||||
float zebraGap, Color32 color, bool clip, Grid grid)
|
||||
float zebraGap, Color32 color,Color32 toColor, bool clip, Grid grid)
|
||||
{
|
||||
ClampInChart(ref p1);
|
||||
ClampInChart(ref p2);
|
||||
UGL.DrawZebraLine(vh, p1, p2, size, zebraWidth, zebraGap, color);
|
||||
UGL.DrawZebraLine(vh, p1, p2, size, zebraWidth, zebraGap, color, toColor);
|
||||
}
|
||||
|
||||
protected Color32 GetXLerpColor(Color32 areaColor, Color32 areaToColor, Vector3 pos, Grid grid)
|
||||
|
||||
@@ -376,21 +376,22 @@ namespace XCharts
|
||||
bool highlight, float space, float barWidth, float pX, float pY, Vector3 plb, Vector3 plt, Vector3 prt,
|
||||
Vector3 prb, bool isYAxis, Grid grid)
|
||||
{
|
||||
var areaColor = SerieHelper.GetItemColor(serie, serieData, m_Theme, colorIndex, highlight);
|
||||
var barColor = SerieHelper.GetItemColor(serie, serieData, m_Theme, colorIndex, highlight);
|
||||
var barToColor = SerieHelper.GetItemToColor(serie, serieData, m_Theme, colorIndex, highlight);
|
||||
DrawBarBackground(vh, serie, serieData, itemStyle, colorIndex, highlight, pX, pY, space, barWidth, isYAxis, grid);
|
||||
if (isYAxis)
|
||||
{
|
||||
plt = (plb + plt) / 2;
|
||||
prt = (prt + prb) / 2;
|
||||
Internal_CheckClipAndDrawZebraLine(vh, plt, prt, barWidth / 2, serie.barZebraWidth, serie.barZebraGap,
|
||||
areaColor, serie.clip, grid);
|
||||
barColor, barToColor, serie.clip, grid);
|
||||
}
|
||||
else
|
||||
{
|
||||
plb = (prb + plb) / 2;
|
||||
plt = (plt + prt) / 2;
|
||||
Internal_CheckClipAndDrawZebraLine(vh, plb, plt, barWidth / 2, serie.barZebraWidth, serie.barZebraGap,
|
||||
areaColor, serie.clip, grid);
|
||||
barColor, barToColor, serie.clip, grid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -635,11 +635,11 @@ namespace XCharts
|
||||
areaColor, areaToColor, zeroPos);
|
||||
break;
|
||||
case LineType.Dash:
|
||||
UGL.DrawDashLine(vh, lp, np, serie.lineStyle.GetWidth(m_Theme.serie.lineWidth), lineColor);
|
||||
UGL.DrawDashLine(vh, lp, np, serie.lineStyle.GetWidth(m_Theme.serie.lineWidth), lineColor, lineColor);
|
||||
isFinish = true;
|
||||
break;
|
||||
case LineType.Dot:
|
||||
UGL.DrawDotLine(vh, lp, np, serie.lineStyle.GetWidth(m_Theme.serie.lineWidth), lineColor);
|
||||
UGL.DrawDotLine(vh, lp, np, serie.lineStyle.GetWidth(m_Theme.serie.lineWidth), lineColor, lineColor);
|
||||
isFinish = true;
|
||||
break;
|
||||
case LineType.DashDot:
|
||||
@@ -1172,10 +1172,10 @@ namespace XCharts
|
||||
switch (serie.lineType)
|
||||
{
|
||||
case LineType.Dash:
|
||||
UGL.DrawDashLine(vh, lp, np, lineWidth, lineColor, 0, 0, posList);
|
||||
UGL.DrawDashLine(vh, lp, np, lineWidth, lineColor, lineColor, 0, 0, posList);
|
||||
break;
|
||||
case LineType.Dot:
|
||||
UGL.DrawDotLine(vh, lp, np, lineWidth, lineColor, 0, 0, posList);
|
||||
UGL.DrawDotLine(vh, lp, np, lineWidth, lineColor, lineColor, 0, 0, posList);
|
||||
break;
|
||||
case LineType.DashDot:
|
||||
UGL.DrawDashDotLine(vh, lp, np, lineWidth, lineColor, 0, 0, 0, posList);
|
||||
|
||||
@@ -104,10 +104,10 @@ namespace XCharts
|
||||
switch (lineType)
|
||||
{
|
||||
case LineStyle.Type.Dashed:
|
||||
UGL.DrawDashLine(vh, startPos, endPos, lineWidth, color);
|
||||
UGL.DrawDashLine(vh, startPos, endPos, lineWidth, color, color);
|
||||
break;
|
||||
case LineStyle.Type.Dotted:
|
||||
UGL.DrawDotLine(vh, startPos, endPos, lineWidth, color);
|
||||
UGL.DrawDotLine(vh, startPos, endPos, lineWidth, color, color);
|
||||
break;
|
||||
case LineStyle.Type.Solid:
|
||||
UGL.DrawLine(vh, startPos, endPos, lineWidth, color);
|
||||
|
||||
Reference in New Issue
Block a user