protected override void DrawBackground(VertexHelper vh) { Vector3 p1 = new Vector3(chartX, chartY + chartHeight); Vector3 p2 = new Vector3(chartX + chartWidth, chartY + chartHeight); Vector3 p3 = new Vector3(chartX + chartWidth, chartY); Vector3 p4 = new Vector3(chartX, chartY); var backgroundColor = ThemeHelper.GetBackgroundColor(m_ThemeInfo, m_Background); ChartDrawer.DrawPolygon(vh, p1, p2, p3, p4, backgroundColor); }
private void DrawRoundCap(VertexHelper vh, Serie serie, float angle, Color color, bool invert = false) { var radius = serie.gaugeAxis.axisLine.width / 2; var len = serie.runtimeInsideRadius + radius; var pos = ChartHelper.GetPosition(serie.runtimeCenterPos, angle, len); var startAngle = invert ? angle + 180 : angle; var endAngle = invert ? angle + 360 : angle + 180; ChartDrawer.DrawSector(vh, pos, radius, color, startAngle, endAngle); }
private void DrawBackground(VertexHelper vh) { // draw bg Vector3 p1 = new Vector3(0, chartHeight); Vector3 p2 = new Vector3(chartWidth, chartHeight); Vector3 p3 = new Vector3(chartWidth, 0); Vector3 p4 = new Vector3(0, 0); ChartDrawer.DrawPolygon(vh, p1, p2, p3, p4, m_ThemeInfo.backgroundColor); }
protected virtual void DrawBackground(VertexHelper vh) { Vector3 p1 = new Vector3(chartX, chartY + chartHeight); Vector3 p2 = new Vector3(chartX + chartWidth, chartY + chartHeight); Vector3 p3 = new Vector3(chartX + chartWidth, chartY); Vector3 p4 = new Vector3(chartX, chartY); var backgroundColor = ThemeHelper.GetBackgroundColor(m_ThemeInfo, m_Background, m_IsControlledByLayout); ChartDrawer.DrawPolygon(vh, p1, p2, p3, p4, backgroundColor); }
public static void DrawTriangle(VertexHelper vh, Vector3 pos, float size, Color32 color, Color32 toColor) { var x = size * Mathf.Cos(30 * Mathf.PI / 180); var y = size * Mathf.Sin(30 * Mathf.PI / 180); var p1 = new Vector2(pos.x - x, pos.y - y); var p2 = new Vector2(pos.x, pos.y + size); var p3 = new Vector2(pos.x + x, pos.y - y); ChartDrawer.DrawTriangle(vh, p1, p2, p3, color, toColor, color); }
private void DrawCenter(VertexHelper vh, Serie serie, SerieData serieData, float insideRadius, bool last) { var itemStyle = SerieHelper.GetItemStyle(serie, serieData); if (itemStyle.centerColor != Color.clear && last) { var radius = insideRadius - itemStyle.centerGap; var smoothness = m_Settings.cicleSmoothness; ChartDrawer.DrawCricle(vh, serie.runtimeCenterPos, radius, itemStyle.centerColor, smoothness); } }
private void DrawBorder(VertexHelper vh, Serie serie, float insideRadius, float outsideRadius) { if (serie.itemStyle.show && serie.itemStyle.borderWidth > 0 && serie.itemStyle.borderColor != Color.clear) { ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, outsideRadius, outsideRadius + serie.itemStyle.borderWidth, serie.itemStyle.borderColor, Color.clear, m_Settings.cicleSmoothness); ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, insideRadius, insideRadius + serie.itemStyle.borderWidth, serie.itemStyle.borderColor, Color.clear, m_Settings.cicleSmoothness); } }
private void DrawVesselBackground(VertexHelper vh) { for (int i = 0; i < m_Vessels.Count; i++) { var vessel = m_Vessels[i]; if (vessel.backgroundColor.a != 0) { var cenPos = vessel.runtimeCenterPos; var radius = vessel.runtimeRadius; ChartDrawer.DrawCricle(vh, cenPos, vessel.runtimeInnerRadius, vessel.backgroundColor, m_Settings.cicleSmoothness); } } }
private void DrawRadar(VertexHelper vh, Radar radar) { if (!radar.splitLine.show && !radar.splitArea.show) { return; } float insideRadius = 0, outsideRadius = 0; float block = radar.runtimeRadius / radar.splitNumber; int indicatorNum = radar.indicatorList.Count; Vector3 p1, p2, p3, p4; Vector3 p = radar.runtimeCenterPos; float angle = 2 * Mathf.PI / indicatorNum; var lineColor = GetLineColor(radar); for (int i = 0; i < radar.splitNumber; i++) { Color color = radar.splitArea.color[i % radar.splitArea.color.Count]; outsideRadius = insideRadius + block; p1 = new Vector3(p.x + insideRadius * Mathf.Sin(0), p.y + insideRadius * Mathf.Cos(0)); p2 = new Vector3(p.x + outsideRadius * Mathf.Sin(0), p.y + outsideRadius * Mathf.Cos(0)); for (int j = 0; j <= indicatorNum; j++) { float currAngle = j * angle; p3 = new Vector3(p.x + outsideRadius * Mathf.Sin(currAngle), p.y + outsideRadius * Mathf.Cos(currAngle)); p4 = new Vector3(p.x + insideRadius * Mathf.Sin(currAngle), p.y + insideRadius * Mathf.Cos(currAngle)); if (radar.splitArea.show) { ChartDrawer.DrawPolygon(vh, p1, p2, p3, p4, color); } if (radar.splitLine.NeedShow(i)) { ChartDrawer.DrawLineStyle(vh, radar.splitLine.lineStyle, p2, p3, lineColor); } p1 = p4; p2 = p3; } insideRadius = outsideRadius; } for (int j = 0; j <= indicatorNum; j++) { float currAngle = j * angle; p3 = new Vector3(p.x + outsideRadius * Mathf.Sin(currAngle), p.y + outsideRadius * Mathf.Cos(currAngle)); if (radar.splitLine.show) { ChartDrawer.DrawLineStyle(vh, radar.splitLine.lineStyle, p, p3, lineColor); } } }
private void DrawBorder(VertexHelper vh, Serie serie, SerieData serieData, float insideRadius, float outsideRadius) { var itemStyle = SerieHelper.GetItemStyle(serie, serieData); if (itemStyle.show && itemStyle.borderWidth > 0 && itemStyle.borderColor != Color.clear) { ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, outsideRadius, outsideRadius + itemStyle.borderWidth, itemStyle.borderColor, Color.clear, m_Settings.cicleSmoothness); ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, insideRadius, insideRadius + itemStyle.borderWidth, itemStyle.borderColor, Color.clear, m_Settings.cicleSmoothness); } }
protected void DrawLabelBackground(VertexHelper vh, Serie serie, SerieData serieData) { if (serieData == null || serieData.labelObject == null) { return; } var serieLabel = SerieHelper.GetSerieLabel(serie, serieData); if (!serieLabel.show) { return; } var invert = serieLabel.autoOffset && serie.type == SerieType.Line && SerieHelper.IsDownPoint(serie, serieData.index) && !serie.areaStyle.show; var centerPos = Vector3.zero; if (serie.type == SerieType.Pie) { centerPos = SerieLabelHelper.GetRealLabelPosition(serieData, serieLabel); } else { centerPos = serieData.labelPosition + serieLabel.offset * (invert ? -1 : 1); } var labelHalfWid = serieData.labelObject.GetLabelWidth() / 2; var labelHalfHig = serieData.GetLabelHeight() / 2; var p1 = new Vector3(centerPos.x - labelHalfWid, centerPos.y + labelHalfHig); var p2 = new Vector3(centerPos.x + labelHalfWid, centerPos.y + labelHalfHig); var p3 = new Vector3(centerPos.x + labelHalfWid, centerPos.y - labelHalfHig); var p4 = new Vector3(centerPos.x - labelHalfWid, centerPos.y - labelHalfHig); if (serieLabel.rotate > 0) { p1 = ChartHelper.RotateRound(p1, centerPos, Vector3.forward, serieLabel.rotate); p2 = ChartHelper.RotateRound(p2, centerPos, Vector3.forward, serieLabel.rotate); p3 = ChartHelper.RotateRound(p3, centerPos, Vector3.forward, serieLabel.rotate); p4 = ChartHelper.RotateRound(p4, centerPos, Vector3.forward, serieLabel.rotate); } ChartDrawer.DrawPolygon(vh, p1, p2, p3, p4, serieLabel.backgroundColor); if (serieLabel.border) { ChartDrawer.DrawBorder(vh, centerPos, serieData.GetLabelWidth(), serieData.GetLabelHeight(), serieLabel.borderWidth, serieLabel.borderColor, serieLabel.rotate); } ChartDrawer.DrawPolygon(vh, serieData.labelPosition, 0.3f, Color.red); }
protected void DrawLabelBackground(VertexHelper vh, Serie serie, SerieData serieData) { var labelHalfWid = serieData.GetLabelWidth() / 2; var labelHalfHig = serieData.GetLabelHeight() / 2; var serieLabel = serieData.GetSerieLabel(serie.label); var centerPos = serieData.labelPosition + serieLabel.offset; var p1 = new Vector3(centerPos.x - labelHalfWid, centerPos.y + labelHalfHig); var p2 = new Vector3(centerPos.x + labelHalfWid, centerPos.y + labelHalfHig); var p3 = new Vector3(centerPos.x + labelHalfWid, centerPos.y - labelHalfHig); var p4 = new Vector3(centerPos.x - labelHalfWid, centerPos.y - labelHalfHig); if (serieLabel.rotate > 0) { p1 = ChartHelper.RotateRound(p1, centerPos, Vector3.forward, serieLabel.rotate); p2 = ChartHelper.RotateRound(p2, centerPos, Vector3.forward, serieLabel.rotate); p3 = ChartHelper.RotateRound(p3, centerPos, Vector3.forward, serieLabel.rotate); p4 = ChartHelper.RotateRound(p4, centerPos, Vector3.forward, serieLabel.rotate); } ChartDrawer.DrawPolygon(vh, p1, p2, p3, p4, serieLabel.backgroundColor); if (serieLabel.border) { var borderWid = serieLabel.borderWidth; p1 = new Vector3(centerPos.x - labelHalfWid, centerPos.y + labelHalfHig + borderWid); p2 = new Vector3(centerPos.x + labelHalfWid + 2 * borderWid, centerPos.y + labelHalfHig + borderWid); p3 = new Vector3(centerPos.x + labelHalfWid + borderWid, centerPos.y + labelHalfHig); p4 = new Vector3(centerPos.x + labelHalfWid + borderWid, centerPos.y - labelHalfHig - 2 * borderWid); var p5 = new Vector3(centerPos.x + labelHalfWid, centerPos.y - labelHalfHig - borderWid); var p6 = new Vector3(centerPos.x - labelHalfWid - 2 * borderWid, centerPos.y - labelHalfHig - borderWid); var p7 = new Vector3(centerPos.x - labelHalfWid - borderWid, centerPos.y - labelHalfHig); var p8 = new Vector3(centerPos.x - labelHalfWid - borderWid, centerPos.y + labelHalfHig + 2 * borderWid); if (serieLabel.rotate > 0) { p1 = ChartHelper.RotateRound(p1, centerPos, Vector3.forward, serieLabel.rotate); p2 = ChartHelper.RotateRound(p2, centerPos, Vector3.forward, serieLabel.rotate); p3 = ChartHelper.RotateRound(p3, centerPos, Vector3.forward, serieLabel.rotate); p4 = ChartHelper.RotateRound(p4, centerPos, Vector3.forward, serieLabel.rotate); p5 = ChartHelper.RotateRound(p5, centerPos, Vector3.forward, serieLabel.rotate); p6 = ChartHelper.RotateRound(p6, centerPos, Vector3.forward, serieLabel.rotate); p7 = ChartHelper.RotateRound(p7, centerPos, Vector3.forward, serieLabel.rotate); p8 = ChartHelper.RotateRound(p8, centerPos, Vector3.forward, serieLabel.rotate); } ChartDrawer.DrawLine(vh, p1, p2, borderWid, serieLabel.borderColor); ChartDrawer.DrawLine(vh, p3, p4, borderWid, serieLabel.borderColor); ChartDrawer.DrawLine(vh, p5, p6, borderWid, serieLabel.borderColor); ChartDrawer.DrawLine(vh, p7, p8, borderWid, serieLabel.borderColor); } }
private void DrawRoundCap(VertexHelper vh, Serie serie, SerieData serieData, Vector3 centerPos, Color color, ref float drawStartDegree, ref float drawEndDegree) { if (serie.roundCap && serieData.runtimePieInsideRadius > 0) { var width = (serieData.runtimePieOutsideRadius - serieData.runtimePieInsideRadius) / 2; var radius = serieData.runtimePieInsideRadius + width; var diffDegree = Mathf.Asin(width / radius) * Mathf.Rad2Deg; drawStartDegree += diffDegree; drawEndDegree -= diffDegree; ChartDrawer.DrawRoundCap(vh, centerPos, width, radius, drawStartDegree, serie.clockwise, color, false); ChartDrawer.DrawRoundCap(vh, centerPos, width, radius, drawEndDegree, serie.clockwise, color, true); } }
private void DrawRoundCap(VertexHelper vh, Serie serie, Vector3 centerPos, Color color, float insideRadius, float outsideRadius, ref float drawStartDegree, ref float drawEndDegree) { if (serie.roundCap && insideRadius > 0 && drawStartDegree != drawEndDegree) { var width = (outsideRadius - insideRadius) / 2; var radius = insideRadius + width; var diffDegree = Mathf.Asin(width / radius) * Mathf.Rad2Deg; drawStartDegree += serie.clockwise ? diffDegree : -diffDegree; drawEndDegree -= serie.clockwise ? diffDegree : -diffDegree; ChartDrawer.DrawRoundCap(vh, centerPos, width, radius, drawStartDegree, serie.clockwise, color, false); ChartDrawer.DrawRoundCap(vh, centerPos, width, radius, drawEndDegree, serie.clockwise, color, true); } }
private void DrawPointer(VertexHelper vh, Serie serie, float currAngle) { if (!serie.gaugePointer.show) { return; } var pointerColor = serie.gaugeAxis.GetPointerColor(m_ThemeInfo, serie.index, currAngle, serie.itemStyle); var len = serie.gaugePointer.length <1 && serie.gaugePointer.length> -1 ? serie.runtimeInsideRadius * serie.gaugePointer.length : serie.gaugePointer.length; var p1 = ChartHelper.GetPosition(serie.runtimeCenterPos, currAngle, len); var p2 = ChartHelper.GetPosition(serie.runtimeCenterPos, currAngle + 180, serie.gaugePointer.width); var p3 = ChartHelper.GetPosition(serie.runtimeCenterPos, currAngle - 90, serie.gaugePointer.width / 2); var p4 = ChartHelper.GetPosition(serie.runtimeCenterPos, currAngle + 90, serie.gaugePointer.width / 2); ChartDrawer.DrawPolygon(vh, p1, p3, p2, p4, pointerColor); }
private void DrawBackground(VertexHelper vh, Serie serie, int index, float insideRadius, float outsideRadius) { var backgroundColor = SerieHelper.GetItemBackgroundColor(serie, m_ThemeInfo, index, false); if (serie.itemStyle.backgroundWidth != 0) { var centerRadius = (outsideRadius + insideRadius) / 2; var inradius = centerRadius - serie.itemStyle.backgroundWidth / 2; var outradius = centerRadius + serie.itemStyle.backgroundWidth / 2; ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, inradius, outradius, backgroundColor, Color.clear, m_Settings.cicleSmoothness); } else { ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, insideRadius, outsideRadius, backgroundColor, Color.clear, m_Settings.cicleSmoothness); } }
private void DrawPolarLine(VertexHelper vh, Serie serie) { var startAngle = m_AngleAxis.runtimeStartAngle; var radius = m_Polar.runtimeRadius; var datas = serie.data; if (datas.Count <= 0) { return; } float dataChangeDuration = serie.animation.GetUpdateAnimationDuration(); float min = m_RadiusAxis.GetCurrMinValue(dataChangeDuration); float max = m_RadiusAxis.GetCurrMaxValue(dataChangeDuration); var firstSerieData = datas[0]; var startPos = GetPolarPos(firstSerieData, min, max, radius); var nextPos = Vector3.zero; var lineColor = SerieHelper.GetLineColor(serie, m_ThemeInfo, serie.index, serie.highlighted); var lineWidth = serie.lineStyle.width; float currDetailProgress = 0; float totalDetailProgress = datas.Count; serie.animation.InitProgress(serie.dataPoints.Count, currDetailProgress, totalDetailProgress); serie.animation.SetDataFinish(0); for (int i = 1; i < datas.Count; i++) { if (serie.animation.CheckDetailBreak(i)) { break; } var serieData = datas[i]; nextPos = GetPolarPos(datas[i], min, max, radius); ChartDrawer.DrawLine(vh, startPos, nextPos, lineWidth, lineColor); startPos = nextPos; } if (!serie.animation.IsFinish()) { serie.animation.CheckProgress(totalDetailProgress); serie.animation.CheckSymbol(serie.symbol.size); m_IsPlayingAnimation = true; RefreshChart(); } }
private void DrawCricleRadar(VertexHelper vh, Radar radar) { if (!radar.splitLine.show && !radar.splitArea.show) { return; } float insideRadius = 0, outsideRadius = 0; float block = radar.runtimeRadius / radar.splitNumber; int indicatorNum = radar.indicatorList.Count; Vector3 p = radar.runtimeCenterPos; Vector3 p1; float angle = 2 * Mathf.PI / indicatorNum; var lineColor = GetLineColor(radar); for (int i = 0; i < radar.splitNumber; i++) { Color color = radar.splitArea.color[i % radar.splitArea.color.Count]; outsideRadius = insideRadius + block; if (radar.splitArea.show) { ChartDrawer.DrawDoughnut(vh, p, insideRadius, outsideRadius, color, Color.clear, 0, 360, m_Settings.cicleSmoothness); } if (radar.splitLine.show) { ChartDrawer.DrawEmptyCricle(vh, p, outsideRadius, radar.splitLine.lineStyle.width, lineColor, Color.clear, m_Settings.cicleSmoothness); } insideRadius = outsideRadius; } for (int j = 0; j <= indicatorNum; j++) { float currAngle = j * angle; p1 = new Vector3(p.x + outsideRadius * Mathf.Sin(currAngle), p.y + outsideRadius * Mathf.Cos(currAngle)); if (radar.splitLine.show) { ChartDrawer.DrawLine(vh, p, p1, radar.splitLine.lineStyle.width / 2, lineColor); } } }
private void DrawArcShape(VertexHelper vh, Serie serie, SerieData serieData, Vector3 centerPos, Color color, ref float drawStartDegree, ref float drawEndDegree) { if (serie.arcShaped && serieData.runtimePieInsideRadius > 0) { var width = (serieData.runtimePieOutsideRadius - serieData.runtimePieInsideRadius) / 2; var radius = serieData.runtimePieInsideRadius + width; var diffDegree = Mathf.Asin(width / radius) * Mathf.Rad2Deg; drawStartDegree += diffDegree; drawEndDegree -= diffDegree; var px = Mathf.Sin(drawStartDegree * Mathf.Deg2Rad) * radius; var py = Mathf.Cos(drawStartDegree * Mathf.Deg2Rad) * radius; var pos = new Vector3(px, py) + centerPos; ChartDrawer.DrawSector(vh, pos, width, color, drawStartDegree + 180, drawStartDegree + 360); px = Mathf.Sin(drawEndDegree * Mathf.Deg2Rad) * radius; py = Mathf.Cos(drawEndDegree * Mathf.Deg2Rad) * radius; pos = new Vector3(px, py) + centerPos; ChartDrawer.DrawSector(vh, pos, width, color, drawEndDegree, drawEndDegree + 180); } }
protected void DrawSymbol(VertexHelper vh, SerieSymbolType type, float symbolSize, float tickness, Vector3 pos, Color color) { switch (type) { case SerieSymbolType.None: break; case SerieSymbolType.Circle: ChartDrawer.DrawCricle(vh, pos, symbolSize, color, GetSymbolCricleSegment(symbolSize)); break; case SerieSymbolType.EmptyCircle: int segment = GetSymbolCricleSegment(symbolSize); ChartDrawer.DrawCricle(vh, pos, symbolSize, m_ThemeInfo.backgroundColor, segment); ChartDrawer.DrawDoughnut(vh, pos, symbolSize - tickness, symbolSize, 0, 360, color, segment); break; case SerieSymbolType.Rect: ChartDrawer.DrawPolygon(vh, pos, symbolSize, color); break; case SerieSymbolType.Triangle: var x = symbolSize * Mathf.Cos(30 * Mathf.PI / 180); var y = symbolSize * Mathf.Sin(30 * Mathf.PI / 180); var p1 = new Vector2(pos.x - x, pos.y - y); var p2 = new Vector2(pos.x, pos.y + symbolSize); var p3 = new Vector2(pos.x + x, pos.y - y); ChartDrawer.DrawTriangle(vh, p1, p2, p3, color); break; case SerieSymbolType.Diamond: p1 = new Vector2(pos.x - symbolSize, pos.y); p2 = new Vector2(pos.x, pos.y + symbolSize); p3 = new Vector2(pos.x + symbolSize, pos.y); var p4 = new Vector2(pos.x, pos.y - symbolSize); ChartDrawer.DrawPolygon(vh, p1, p2, p3, p4, color); break; } }
void Awake() { chart = gameObject.GetComponent <LineChart>(); if (chart == null) { return; } chart.customDrawCallback = delegate(VertexHelper vh) { var dataPoints = chart.series.list[0].dataPoints; if (dataPoints.Count > 0) { var pos = dataPoints[3]; var zeroPos = new Vector3(chart.coordinateX, chart.coordinateY); var startPos = new Vector3(pos.x, zeroPos.y); var endPos = new Vector3(pos.x, zeroPos.y + chart.coordinateHeight); ChartDrawer.DrawLine(vh, startPos, endPos, 1, Color.blue); ChartDrawer.DrawCricle(vh, pos, 5, Color.blue); } }; }
protected override void DrawTooltip(VertexHelper vh) { if (tooltip.runtimeAngle < 0) { return; } var m_Polar = GetPolar(tooltip.runtimePolarIndex); var m_AngleAxis = GetAngleAxis(m_Polar.index); var lineColor = TooltipHelper.GetLineColor(tooltip, m_Theme); var lineType = tooltip.lineStyle.GetType(m_Theme.tooltip.lineType); var lineWidth = tooltip.lineStyle.GetWidth(m_Theme.tooltip.lineWidth); var cenPos = m_Polar.runtimeCenterPos; var radius = m_Polar.runtimeRadius; var sp = m_Polar.runtimeCenterPos; var tooltipAngle = tooltip.runtimeAngle + m_AngleAxis.runtimeStartAngle; var ep = ChartHelper.GetPos(sp, radius, tooltipAngle, true); switch (tooltip.type) { case Tooltip.Type.Corss: ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, sp, ep, lineColor); var dist = Vector2.Distance(pointerPos, cenPos); if (dist > radius) { dist = radius; } var outsideRaidus = dist + tooltip.lineStyle.GetWidth(m_Theme.tooltip.lineWidth) * 2; UGL.DrawDoughnut(vh, cenPos, dist, outsideRaidus, lineColor, Color.clear); break; case Tooltip.Type.Line: ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, sp, ep, lineColor); break; case Tooltip.Type.Shadow: UGL.DrawSector(vh, cenPos, radius, lineColor, tooltipAngle - 2, tooltipAngle + 2, settings.cicleSmoothness); break; } }
internal static void DrawAxisLine(VertexHelper vh, Axis axis, AxisTheme theme, Orient orient, float startX, float startY, float axisLength) { var inverse = axis.IsValue() && axis.inverse; var offset = AxisHelper.GetAxisLineArrowOffset(axis); var lineWidth = axis.axisLine.GetWidth(theme.lineWidth); var lineType = axis.axisLine.GetType(theme.lineType); var lineColor = axis.axisLine.GetColor(theme.lineColor); if (orient == Orient.Horizonal) { var left = new Vector3(startX - lineWidth - (inverse ? offset : 0), startY); var right = new Vector3(startX + axisLength + lineWidth + (!inverse ? offset : 0), startY); ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, left, right, lineColor); } else { var bottom = new Vector3(startX, startY - lineWidth - (inverse ? offset : 0)); var top = new Vector3(startX, startY + axisLength + lineWidth + (!inverse ? offset : 0)); ChartDrawer.DrawLineStyle(vh, lineType, lineWidth, bottom, top, lineColor); } }
private void DrawProgressBar(VertexHelper vh, Serie serie, float currAngle) { if (serie.gaugeType != GaugeType.ProgressBar) { return; } if (!serie.gaugeAxis.show || !serie.gaugeAxis.axisLine.show) { return; } var color = serie.gaugeAxis.GetAxisLineColor(m_ThemeInfo, serie.index); var backgroundColor = serie.gaugeAxis.GetAxisLineBackgroundColor(m_ThemeInfo, serie.index); var outsideRadius = serie.runtimeInsideRadius + serie.gaugeAxis.axisLine.width; var borderWidth = serie.itemStyle.borderWidth; var borderColor = serie.itemStyle.borderColor; ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, serie.runtimeInsideRadius, outsideRadius, backgroundColor, backgroundColor, Color.clear, serie.startAngle, serie.endAngle, 0, Color.clear, 0, m_Settings.cicleSmoothness, serie.roundCap); ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, serie.runtimeInsideRadius, outsideRadius, color, color, Color.clear, serie.startAngle, currAngle, 0, Color.clear, 0, m_Settings.cicleSmoothness, serie.roundCap); }
private void DrawCapsuleBar(VertexHelper vh, Serie serie, SerieData serieData, ItemStyle itemStyle, int colorIndex, bool highlight, float space, float barWidth, float pX, float pY, Vector3 plb, Vector3 plt, Vector3 prt, Vector3 prb, bool isYAxis) { Color areaColor = SerieHelper.GetItemColor(serie, serieData, m_ThemeInfo, colorIndex, highlight); Color areaToColor = SerieHelper.GetItemToColor(serie, serieData, m_ThemeInfo, colorIndex, highlight); DrawBarBackground(vh, serie, serieData, itemStyle, colorIndex, highlight, pX, pY, space, barWidth, isYAxis); var borderWidth = itemStyle.runtimeBorderWidth; var radius = barWidth / 2 - borderWidth; if (isYAxis) { var diff = Vector3.right * radius; var pcl = (plt + plb) / 2 + diff; var pcr = (prt + prb) / 2 - diff; if (pcr.x > pcl.x) { CheckClipAndDrawPolygon(vh, plb + diff, plt + diff, prt - diff, prb - diff, areaColor, areaToColor, serie.clip); ChartDrawer.DrawSector(vh, pcl, radius, areaColor, 180, 360); ChartDrawer.DrawSector(vh, pcr, radius, areaToColor, 0, 180); } } else { var diff = Vector3.up * radius; var pct = (plt + prt) / 2 - diff; var pcb = (plb + prb) / 2 + diff; if (pct.y > pcb.y) { CheckClipAndDrawPolygon(vh, prb + diff, plb + diff, plt - diff, prt - diff, areaColor, areaToColor, serie.clip); ChartDrawer.DrawSector(vh, pct, radius, areaToColor, 270, 450); ChartDrawer.DrawSector(vh, pcb, radius, areaColor, 90, 270); } } }
protected void DrawYBarSerie(VertexHelper vh, Serie serie, int colorIndex, ref List <float> seriesHig) { if (!IsActive(serie.name)) { return; } var xAxis = m_XAxises[serie.axisIndex]; var yAxis = m_YAxises[serie.axisIndex]; if (!yAxis.show) { yAxis = m_YAxises[(serie.axisIndex + 1) % m_YAxises.Count]; } var showData = serie.GetDataList(m_DataZoom); float categoryWidth = yAxis.GetDataWidth(coordinateHeight, showData.Count, m_DataZoom); float barGap = GetBarGap(); float totalBarWidth = GetBarTotalWidth(categoryWidth, barGap); float barWidth = serie.GetBarWidth(categoryWidth); float offset = (categoryWidth - totalBarWidth) / 2; float barGapWidth = barWidth + barWidth * barGap; float space = serie.barGap == -1 ? offset : offset + m_BarLastOffset; int maxCount = serie.maxShow > 0 ? (serie.maxShow > showData.Count ? showData.Count : serie.maxShow) : showData.Count; if (seriesHig.Count < serie.minShow) { for (int i = 0; i < serie.minShow; i++) { seriesHig.Add(0); } } var isPercentStack = m_Series.IsPercentStack(serie.stack, SerieType.Bar); for (int i = serie.minShow; i < maxCount; i++) { if (i >= seriesHig.Count) { seriesHig.Add(0); } float value = showData[i].data[1]; float pX = seriesHig[i] + coordinateX + xAxis.zeroXOffset + yAxis.axisLine.width; float pY = coordinateY + +i * categoryWidth; if (!yAxis.boundaryGap) { pY -= categoryWidth / 2; } var barHig = 0f; var valueTotal = 0f; if (isPercentStack) { valueTotal = GetSameStackTotalValue(serie.stack, i); barHig = value / valueTotal * coordinateWidth; seriesHig[i] += barHig; } else { valueTotal = xAxis.maxValue - xAxis.minValue; barHig = (xAxis.minValue > 0 ? value - xAxis.minValue : value) / valueTotal * coordinateWidth; seriesHig[i] += barHig; } float currHig = CheckAnimation(serie, i, barHig); Vector3 p1 = new Vector3(pX, pY + space + barWidth); Vector3 p2 = new Vector3(pX + currHig, pY + space + barWidth); Vector3 p3 = new Vector3(pX + currHig, pY + space); Vector3 p4 = new Vector3(pX, pY + space); serie.dataPoints.Add(new Vector3(pX + currHig, pY + space + barWidth / 2)); var highlight = (m_Tooltip.show && m_Tooltip.IsSelected(i)) || serie.data[i].highlighted || serie.highlighted; if (serie.show) { Color areaColor = serie.GetAreaColor(m_ThemeInfo, colorIndex, highlight); Color areaToColor = serie.GetAreaToColor(m_ThemeInfo, colorIndex, highlight); if (serie.barType == BarType.Zebra) { p1 = (p4 + p1) / 2; p2 = (p2 + p3) / 2; ChartDrawer.DrawZebraLine(vh, p1, p2, barWidth / 2, serie.barZebraWidth, serie.barZebraGap, areaColor); } else { ChartDrawer.DrawPolygon(vh, p4, p1, p2, p3, areaColor, areaToColor); } } } if (!m_Series.IsStack(serie.stack, SerieType.Bar)) { m_BarLastOffset += barGapWidth; } }
protected override void DrawChart(VertexHelper vh) { base.DrawChart(vh); for (int i = 0; i < m_Series.list.Count; i++) { var serie = m_Series.list[i]; var data = serie.data; serie.index = i; if (!serie.show || serie.type != SerieType.Ring || serie.animation.HasFadeOut()) { continue; } serie.animation.InitProgress(data.Count, serie.startAngle, serie.startAngle + 360); serie.UpdateCenter(chartWidth, chartHeight); TitleStyleHelper.CheckTitle(serie, ref m_ReinitTitle, ref m_UpdateTitleText); SerieLabelHelper.CheckLabel(serie, ref m_ReinitLabel, ref m_UpdateLabelText); var dataChangeDuration = serie.animation.GetUpdateAnimationDuration(); var ringWidth = serie.runtimeOutsideRadius - serie.runtimeInsideRadius; var dataChanging = false; for (int j = 0; j < data.Count; j++) { var serieData = data[j]; if (!serieData.show) { continue; } if (serieData.IsDataChanged()) { dataChanging = true; } var value = serieData.GetFirstData(dataChangeDuration); var max = serieData.GetLastData(); var degree = 360 * value / max; var startDegree = GetStartAngle(serie); var toDegree = GetToAngle(serie, degree); var itemColor = SerieHelper.GetItemColor(serie, serieData, m_ThemeInfo, j, serieData.highlighted); var outsideRadius = serie.runtimeOutsideRadius - j * (ringWidth + serie.ringGap); var insideRadius = outsideRadius - ringWidth; var centerRadius = (outsideRadius + insideRadius) / 2; serieData.runtimePieStartAngle = serie.clockwise ? startDegree : toDegree; serieData.runtimePieToAngle = serie.clockwise ? toDegree : startDegree; serieData.runtimePieInsideRadius = insideRadius; serieData.runtimePieOutsideRadius = outsideRadius; DrawBackground(vh, serie, serieData, j, insideRadius, outsideRadius); DrawRoundCap(vh, serie, serie.runtimeCenterPos, itemColor, insideRadius, outsideRadius, ref startDegree, ref toDegree); ChartDrawer.DrawDoughnut(vh, serie.runtimeCenterPos, insideRadius, outsideRadius, itemColor, Color.clear, m_Settings.cicleSmoothness, startDegree, toDegree); DrawBorder(vh, serie, serieData, insideRadius, outsideRadius); DrawCenter(vh, serie, serieData, insideRadius, j == data.Count - 1); UpateLabelPosition(serie, serieData, j, startDegree, toDegree, centerRadius); } if (!serie.animation.IsFinish()) { serie.animation.CheckProgress(360); serie.animation.CheckSymbol(serie.symbol.size); RefreshChart(); } if (dataChanging) { RefreshChart(); } } }
protected override void DrawChart(VertexHelper vh) { base.DrawChart(vh); int serieNameCount = -1; bool isClickOffset = false; bool isDataHighlight = false; for (int i = 0; i < m_Series.Count; i++) { var serie = m_Series.list[i]; serie.index = i; var data = serie.data; serie.animation.InitProgress(data.Count, 0, 360); if (!serie.show) { continue; } bool isFinish = true; if (serie.pieClickOffset) { isClickOffset = true; } serie.runtimePieDataMax = serie.yMax; serie.runtimePieDataTotal = serie.yTotal; UpdatePieCenter(serie); float totalDegree = 360; float startDegree = 0; int showdataCount = 0; foreach (var sd in serie.data) { if (sd.show && serie.pieRoseType == RoseType.Area) { showdataCount++; } sd.canShowLabel = false; } for (int n = 0; n < data.Count; n++) { if (!serie.animation.NeedAnimation(n)) { break; } var serieData = data[n]; serieData.index = n; float value = serieData.data[1]; serieNameCount = m_LegendRealShowName.IndexOf(serieData.legendName); Color color = m_ThemeInfo.GetColor(serieNameCount); serieData.runtimePieStartAngle = startDegree; serieData.runtimePieToAngle = startDegree; serieData.runtimePieHalfAngle = startDegree; serieData.runtimePieCurrAngle = startDegree; if (!serieData.show) { continue; } float degree = serie.pieRoseType == RoseType.Area ? (totalDegree / showdataCount) : (totalDegree * value / serie.runtimePieDataTotal); serieData.runtimePieToAngle = startDegree + degree; serieData.runtimePieOutsideRadius = serie.pieRoseType > 0 ? serie.runtimePieInsideRadius + (serie.runtimePieOutsideRadius - serie.runtimePieInsideRadius) * value / serie.runtimePieDataMax : serie.runtimePieOutsideRadius; if (serieData.highlighted) { isDataHighlight = true; color *= 1.2f; serieData.runtimePieOutsideRadius += m_Settings.pieTooltipExtraRadius; } var offset = serie.pieSpace; if (serie.pieClickOffset && serieData.selected) { offset += m_Settings.pieSelectedOffset; } var halfDegree = (serieData.runtimePieToAngle - startDegree) / 2; serieData.runtimePieHalfAngle = startDegree + halfDegree; float currRad = serieData.runtimePieHalfAngle * Mathf.Deg2Rad; float currSin = Mathf.Sin(currRad); float currCos = Mathf.Cos(currRad); var center = serie.runtimePieCenterPos; serieData.runtimePieCurrAngle = serieData.runtimePieToAngle; serieData.runtiemPieOffsetCenter = center; serieData.runtimePieInsideRadius = serie.runtimePieInsideRadius; if (serie.animation.CheckDetailBreak(n, serieData.runtimePieToAngle)) { isFinish = false; serieData.runtimePieCurrAngle = serie.animation.GetCurrDetail(); } if (offset > 0) { serieData.runtimePieOffsetRadius = serie.pieSpace / Mathf.Sin(halfDegree * Mathf.Deg2Rad); serieData.runtimePieInsideRadius -= serieData.runtimePieOffsetRadius; serieData.runtimePieOutsideRadius -= serieData.runtimePieOffsetRadius; if (serie.pieClickOffset && serieData.selected) { serieData.runtimePieOffsetRadius += m_Settings.pieSelectedOffset; if (serieData.runtimePieInsideRadius > 0) { serieData.runtimePieInsideRadius += m_Settings.pieSelectedOffset; } serieData.runtimePieOutsideRadius += m_Settings.pieSelectedOffset; } serieData.runtiemPieOffsetCenter = new Vector3(center.x + serieData.runtimePieOffsetRadius * currSin, center.y + serieData.runtimePieOffsetRadius * currCos); ChartDrawer.DrawDoughnut(vh, serieData.runtiemPieOffsetCenter, serieData.runtimePieInsideRadius, serieData.runtimePieOutsideRadius, color, m_ThemeInfo.backgroundColor, m_Settings.cicleSmoothness, startDegree, serieData.runtimePieCurrAngle); } else { ChartDrawer.DrawDoughnut(vh, center, serieData.runtimePieInsideRadius, serieData.runtimePieOutsideRadius, color, m_ThemeInfo.backgroundColor, m_Settings.cicleSmoothness, startDegree, serieData.runtimePieCurrAngle); } serieData.canShowLabel = serieData.runtimePieCurrAngle >= serieData.runtimePieHalfAngle; isDrawPie = true; startDegree = serieData.runtimePieToAngle; if (isFinish) { serie.animation.SetDataFinish(n); } else { break; } } if (!serie.animation.IsFinish()) { float duration = serie.animation.duration > 0 ? (float)serie.animation.duration / 1000 : 1; float speed = 360 / duration; float symbolSpeed = serie.symbol.size / duration; serie.animation.CheckProgress(Time.deltaTime * speed); serie.animation.CheckSymbol(Time.deltaTime * symbolSpeed, serie.symbol.size); RefreshChart(); } } DrawLabelLine(vh); DrawLabelBackground(vh); raycastTarget = isClickOffset && isDataHighlight; }
private void DrawLabelLine(VertexHelper vh, Serie serie, SerieData serieData, Color color) { if (serie.label.show && serie.label.position == SerieLabel.Position.Outside && serie.label.line) { var insideRadius = serieData.runtimePieInsideRadius; var outSideRadius = serieData.runtimePieOutsideRadius; var center = serie.runtimePieCenterPos; var currAngle = serieData.runtimePieHalfAngle; if (serie.label.lineColor != Color.clear) { color = serie.label.lineColor; } else if (serie.label.lineType == SerieLabel.LineType.HorizontalLine) { color *= color; } float currSin = Mathf.Sin(currAngle * Mathf.Deg2Rad); float currCos = Mathf.Cos(currAngle * Mathf.Deg2Rad); var radius1 = serie.label.lineType == SerieLabel.LineType.HorizontalLine ? serie.runtimePieOutsideRadius : outSideRadius; var radius2 = serie.runtimePieOutsideRadius + serie.label.lineLength1; var radius3 = insideRadius + (outSideRadius - insideRadius) / 2; if (radius1 < serie.runtimePieInsideRadius) { radius1 = serie.runtimePieInsideRadius; } radius1 -= 0.1f; var pos0 = new Vector3(center.x + radius3 * currSin, center.y + radius3 * currCos); var pos1 = new Vector3(center.x + radius1 * currSin, center.y + radius1 * currCos); var pos2 = new Vector3(center.x + radius2 * currSin, center.y + radius2 * currCos); float tx, ty; Vector3 pos3, pos4, pos6; var horizontalLineCircleRadius = serie.label.lineWidth * 4f; var lineCircleDiff = horizontalLineCircleRadius - 0.3f; if (currAngle < 90) { ty = serie.label.lineWidth * Mathf.Cos((90 - currAngle) * Mathf.Deg2Rad); tx = serie.label.lineWidth * Mathf.Sin((90 - currAngle) * Mathf.Deg2Rad); pos3 = new Vector3(pos2.x - tx, pos2.y + ty - serie.label.lineWidth); var r4 = Mathf.Sqrt(radius1 * radius1 - Mathf.Pow(currCos * radius3, 2)) - currSin * radius3; r4 += serie.label.lineLength1 - lineCircleDiff; pos6 = pos0 + Vector3.right * lineCircleDiff; pos4 = pos6 + Vector3.right * r4; } else if (currAngle < 180) { ty = serie.label.lineWidth * Mathf.Sin((180 - currAngle) * Mathf.Deg2Rad); tx = serie.label.lineWidth * Mathf.Cos((180 - currAngle) * Mathf.Deg2Rad); pos3 = new Vector3(pos2.x - tx, pos2.y - ty + serie.label.lineWidth); var r4 = Mathf.Sqrt(radius1 * radius1 - Mathf.Pow(currCos * radius3, 2)) - currSin * radius3; r4 += serie.label.lineLength1 - lineCircleDiff; pos6 = pos0 + Vector3.right * lineCircleDiff; pos4 = pos6 + Vector3.right * r4; } else if (currAngle < 270) { ty = serie.label.lineWidth * Mathf.Sin((180 + currAngle) * Mathf.Deg2Rad); tx = serie.label.lineWidth * Mathf.Cos((180 + currAngle) * Mathf.Deg2Rad); var currSin1 = Mathf.Sin((360 - currAngle) * Mathf.Deg2Rad); var currCos1 = Mathf.Cos((360 - currAngle) * Mathf.Deg2Rad); pos3 = new Vector3(pos2.x + tx, pos2.y - ty + serie.label.lineWidth); var r4 = Mathf.Sqrt(radius1 * radius1 - Mathf.Pow(currCos1 * radius3, 2)) - currSin1 * radius3; r4 += serie.label.lineLength1 - lineCircleDiff; pos6 = pos0 + Vector3.left * lineCircleDiff; pos4 = pos6 + Vector3.left * r4; } else { ty = serie.label.lineWidth * Mathf.Cos((90 + currAngle) * Mathf.Deg2Rad); tx = serie.label.lineWidth * Mathf.Sin((90 + currAngle) * Mathf.Deg2Rad); pos3 = new Vector3(pos2.x + tx, pos2.y + ty - serie.label.lineWidth); var currSin1 = Mathf.Sin((360 - currAngle) * Mathf.Deg2Rad); var currCos1 = Mathf.Cos((360 - currAngle) * Mathf.Deg2Rad); var r4 = Mathf.Sqrt(radius1 * radius1 - Mathf.Pow(currCos1 * radius3, 2)) - currSin1 * radius3; r4 += serie.label.lineLength1 - lineCircleDiff; pos6 = pos0 + Vector3.left * lineCircleDiff; pos4 = pos6 + Vector3.left * r4; } var pos5 = new Vector3(currAngle > 180 ? pos3.x - serie.label.lineLength2 : pos3.x + serie.label.lineLength2, pos3.y); switch (serie.label.lineType) { case SerieLabel.LineType.BrokenLine: ChartDrawer.DrawLine(vh, pos1, pos2, serie.label.lineWidth, color); ChartDrawer.DrawLine(vh, pos3, pos5, serie.label.lineWidth, color); break; case SerieLabel.LineType.Curves: ChartDrawer.DrawCurves(vh, pos1, pos5, pos1, pos2, serie.label.lineWidth, color, m_Settings.lineSmoothness); break; case SerieLabel.LineType.HorizontalLine: ChartDrawer.DrawCricle(vh, pos0, horizontalLineCircleRadius, color); ChartDrawer.DrawLine(vh, pos6, pos4, serie.label.lineWidth, color); break; } } }
protected override void DrawChart(VertexHelper vh) { base.DrawChart(vh); int serieNameCount = -1; bool isClickOffset = false; bool isDataHighlight = false; for (int i = 0; i < m_Series.Count; i++) { var serie = m_Series.list[i]; serie.index = i; var data = serie.data; serie.animation.InitProgress(data.Count, 0, 360); if (!serie.show || serie.animation.HasFadeOut()) { continue; } bool isFinish = true; if (serie.pieClickOffset) { isClickOffset = true; } serie.runtimePieDataMax = serie.yMax; serie.runtimePieDataTotal = serie.yTotal; SerieHelper.UpdateCenter(serie, chartPosition, chartWidth, chartHeight); float totalDegree = 360; float startDegree = 0; int showdataCount = 0; foreach (var sd in serie.data) { if (sd.show && serie.pieRoseType == RoseType.Area) { showdataCount++; } sd.canShowLabel = false; } bool dataChanging = false; float dataChangeDuration = serie.animation.GetUpdateAnimationDuration(); for (int n = 0; n < data.Count; n++) { var serieData = data[n]; var itemStyle = SerieHelper.GetItemStyle(serie, serieData, serieData.highlighted); serieData.index = n; float value = serieData.GetCurrData(1, dataChangeDuration); if (serieData.IsDataChanged()) { dataChanging = true; } serieNameCount = m_LegendRealShowName.IndexOf(serieData.legendName); var color = SerieHelper.GetItemColor(serie, serieData, m_ThemeInfo, serieNameCount, serieData.highlighted); var toColor = SerieHelper.GetItemToColor(serie, serieData, m_ThemeInfo, serieNameCount, serieData.highlighted); var borderWidth = itemStyle.borderWidth; var borderColor = itemStyle.borderColor; serieData.runtimePieStartAngle = startDegree; serieData.runtimePieToAngle = startDegree; serieData.runtimePieHalfAngle = startDegree; serieData.runtimePieCurrAngle = startDegree; if (!serieData.show) { continue; } float degree = serie.pieRoseType == RoseType.Area ? (totalDegree / showdataCount) : (totalDegree * value / serie.runtimePieDataTotal); serieData.runtimePieToAngle = startDegree + degree; serieData.runtimePieOutsideRadius = serie.pieRoseType > 0 ? serie.runtimeInsideRadius + (serie.runtimeOutsideRadius - serie.runtimeInsideRadius) * value / serie.runtimePieDataMax : serie.runtimeOutsideRadius; if (serieData.highlighted) { isDataHighlight = true; serieData.runtimePieOutsideRadius += m_Settings.pieTooltipExtraRadius; } var offset = 0f; if (serie.pieClickOffset && serieData.selected) { offset += m_Settings.pieSelectedOffset; } var halfDegree = (serieData.runtimePieToAngle - startDegree) / 2; serieData.runtimePieHalfAngle = startDegree + halfDegree; float currRad = serieData.runtimePieHalfAngle * Mathf.Deg2Rad; float currSin = Mathf.Sin(currRad); float currCos = Mathf.Cos(currRad); var center = serie.runtimeCenterPos; serieData.runtimePieCurrAngle = serieData.runtimePieToAngle; serieData.runtiemPieOffsetCenter = center; serieData.runtimePieInsideRadius = serie.runtimeInsideRadius; if (serie.animation.CheckDetailBreak(serieData.runtimePieToAngle)) { isFinish = false; serieData.runtimePieCurrAngle = serie.animation.GetCurrDetail(); } if (offset > 0) { serieData.runtimePieOffsetRadius = 0; serieData.runtimePieInsideRadius -= serieData.runtimePieOffsetRadius; serieData.runtimePieOutsideRadius -= serieData.runtimePieOffsetRadius; if (serie.pieClickOffset && serieData.selected) { serieData.runtimePieOffsetRadius += m_Settings.pieSelectedOffset; if (serieData.runtimePieInsideRadius > 0) { serieData.runtimePieInsideRadius += m_Settings.pieSelectedOffset; } serieData.runtimePieOutsideRadius += m_Settings.pieSelectedOffset; } serieData.runtiemPieOffsetCenter = new Vector3(center.x + serieData.runtimePieOffsetRadius * currSin, center.y + serieData.runtimePieOffsetRadius * currCos); var drawEndDegree = serieData.runtimePieCurrAngle; var needRoundCap = serie.roundCap && serieData.runtimePieInsideRadius > 0; ChartDrawer.DrawDoughnut(vh, serieData.runtiemPieOffsetCenter, serieData.runtimePieInsideRadius, serieData.runtimePieOutsideRadius, color, toColor, Color.clear, startDegree, drawEndDegree, borderWidth, borderColor, serie.pieSpace / 2, m_Settings.cicleSmoothness, needRoundCap, serie.clockwise); } else //if(n==0) { var drawEndDegree = serieData.runtimePieCurrAngle; var needRoundCap = serie.roundCap && serieData.runtimePieInsideRadius > 0; ChartDrawer.DrawDoughnut(vh, center, serieData.runtimePieInsideRadius, serieData.runtimePieOutsideRadius, color, toColor, Color.clear, startDegree, drawEndDegree, borderWidth, borderColor, serie.pieSpace / 2, m_Settings.cicleSmoothness, needRoundCap, serie.clockwise); DrawCenter(vh, serie, itemStyle, serieData.runtimePieInsideRadius); } serieData.canShowLabel = serieData.runtimePieCurrAngle >= serieData.runtimePieHalfAngle; isDrawPie = true; startDegree = serieData.runtimePieToAngle; if (isFinish) { serie.animation.SetDataFinish(n); } else { break; } } if (!serie.animation.IsFinish()) { serie.animation.CheckProgress(360); serie.animation.CheckSymbol(serie.symbol.size); RefreshChart(); } if (dataChanging) { RefreshChart(); } } DrawLabelLine(vh); DrawLabelBackground(vh); raycastTarget = isClickOffset && isDataHighlight; }