Ejemplo n.º 1
0
        private void DrawVesselBackground(VertexHelper vh, Serie serie)
        {
            var vessel = chart.GetVessel(serie.vesselIndex);

            if (vessel != null)
            {
                if (vessel.backgroundColor.a != 0)
                {
                    switch (vessel.shape)
                    {
                    case Vessel.Shape.Circle:
                        var cenPos = vessel.runtimeCenterPos;
                        var radius = vessel.runtimeRadius;
                        UGL.DrawCricle(vh, cenPos, vessel.runtimeInnerRadius + vessel.gap, vessel.backgroundColor,
                                       chart.settings.cicleSmoothness);
                        UGL.DrawDoughnut(vh, cenPos, vessel.runtimeInnerRadius, vessel.runtimeInnerRadius + vessel.gap,
                                         vessel.backgroundColor, Color.clear, chart.settings.cicleSmoothness);
                        break;

                    case Vessel.Shape.Rect:
                        UGL.DrawRectangle(vh, vessel.runtimeCenterPos, vessel.runtimeWidth / 2, vessel.runtimeHeight / 2,
                                          vessel.backgroundColor);
                        break;

                    default:
                        break;
                    }
                }
            }
        }
        void Awake()
        {
            chart = gameObject.GetComponent <LineChart>();
            if (chart == null)
            {
                return;
            }

            chart.onDraw = delegate(VertexHelper vh) { };
            // or
            chart.onDrawBeforeSerie = delegate(VertexHelper vh, Serie serie) { };
            // or
            chart.onDrawAfterSerie = delegate(VertexHelper vh, Serie serie)
            {
                if (serie.index != 0)
                {
                    return;
                }
                var dataPoints = serie.context.dataPoints;
                if (dataPoints.Count > 0)
                {
                    var pos      = dataPoints[3];
                    var grid     = chart.GetChartComponent <GridCoord>();
                    var zeroPos  = new Vector3(grid.context.x, grid.context.y);
                    var startPos = new Vector3(pos.x, zeroPos.y);
                    var endPos   = new Vector3(pos.x, zeroPos.y + grid.context.height);
                    UGL.DrawLine(vh, startPos, endPos, chart.theme.serie.lineWidth, Color.blue);
                    UGL.DrawCricle(vh, pos, 5, Color.blue);
                }
            };
            // or
            chart.onDrawTop = delegate(VertexHelper vh) { };
        }
Ejemplo n.º 3
0
 private void DrawPieCenter(VertexHelper vh, Serie serie, ItemStyle itemStyle, float insideRadius)
 {
     if (!ChartHelper.IsClearColor(itemStyle.centerColor))
     {
         var radius = insideRadius - itemStyle.centerGap;
         UGL.DrawCricle(vh, serie.runtimeCenterPos, radius, itemStyle.centerColor, chart.settings.cicleSmoothness);
     }
 }
Ejemplo n.º 4
0
 private void DrawPolar(VertexHelper vh, PolarCoord polar)
 {
     PolarHelper.UpdatePolarCenter(polar, chart.chartPosition, chart.chartWidth, chart.chartHeight);
     if (!ChartHelper.IsClearColor(polar.backgroundColor))
     {
         UGL.DrawCricle(vh, polar.context.center, polar.context.radius, polar.backgroundColor);
     }
 }
Ejemplo n.º 5
0
 private void DrawPolar(VertexHelper vh)
 {
     UpdateRuntimeValue();
     foreach (var polar in m_Polars)
     {
         if (!ChartHelper.IsClearColor(polar.backgroundColor))
         {
             UGL.DrawCricle(vh, polar.runtimeCenterPos, polar.runtimeRadius, polar.backgroundColor);
         }
     }
 }
Ejemplo n.º 6
0
        private void DrawCenter(VertexHelper vh, Serie serie, SerieData serieData, float insideRadius, bool last)
        {
            var itemStyle = SerieHelper.GetItemStyle(serie, serieData);

            if (!ChartHelper.IsClearColor(itemStyle.centerColor) && last)
            {
                var radius     = insideRadius - itemStyle.centerGap;
                var smoothness = chart.settings.cicleSmoothness;
                UGL.DrawCricle(vh, serie.runtimeCenterPos, radius, itemStyle.centerColor, smoothness);
            }
        }
Ejemplo n.º 7
0
        private void DrawVesselBackground(VertexHelper vh, Serie serie)
        {
            var vessel = chart.GetVessel(serie.vesselIndex);

            if (vessel != null)
            {
                if (vessel.backgroundColor.a != 0)
                {
                    var cenPos = vessel.runtimeCenterPos;
                    var radius = vessel.runtimeRadius;
                    UGL.DrawCricle(vh, cenPos, vessel.runtimeInnerRadius, vessel.backgroundColor, chart.settings.cicleSmoothness);
                }
            }
        }
Ejemplo n.º 8
0
        void Awake()
        {
            chart = gameObject.GetComponent <LineChart>();
            if (chart == null)
            {
                return;
            }

            chart.onCustomDraw = delegate(VertexHelper vh)
            {
                var dataPoints = chart.series.list[0].dataPoints;
                if (dataPoints.Count > 0)
                {
                    var pos      = dataPoints[3];
                    var zeroPos  = new Vector3(chart.grid.runtimeX, chart.grid.runtimeY);
                    var startPos = new Vector3(pos.x, zeroPos.y);
                    var endPos   = new Vector3(pos.x, zeroPos.y + chart.grid.runtimeHeight);
                    UGL.DrawLine(vh, startPos, endPos, chart.theme.serie.lineWidth, Color.blue);
                    UGL.DrawCricle(vh, pos, 5, Color.blue);
                }
            };
        }
Ejemplo n.º 9
0
        protected override void OnPopulateMesh(VertexHelper vh)
        {
            Vector3 sp, cp, ep;

            vh.Clear();

            //背景边框
            UGL.DrawSquare(vh, m_Center, m_Width / 2, m_BackgroundColor);
            UGL.DrawBorder(vh, m_Center, m_Width, m_Height, 10, Color.green, 0, m_BorderRadius);

            //点
            UGL.DrawCricle(vh, m_LeftTopPos + new Vector3(20, -20), 10, m_DrawColor);

            //直线
            sp = new Vector3(m_LeftTopPos.x + 50, m_LeftTopPos.y - 20);
            ep = new Vector3(m_LeftTopPos.x + 250, m_LeftTopPos.y - 20);
            UGL.DrawLine(vh, sp, ep, 3, m_DrawColor);

            //3点确定的折线
            sp = new Vector3(m_LeftTopPos.x + 20, m_LeftTopPos.y - 100);
            cp = new Vector3(m_LeftTopPos.x + 200, m_LeftTopPos.y - 40);
            ep = new Vector3(m_LeftTopPos.x + 250, m_LeftTopPos.y - 80);
            UGL.DrawLine(vh, sp, cp, ep, 5, m_DrawColor);
        }
Ejemplo n.º 10
0
        private void DrawLegend(VertexHelper vh)
        {
            if (chart.series.Count == 0)
            {
                return;
            }
            var legend = component;

            if (!legend.show)
            {
                return;
            }
            if (legend.iconType == Legend.Type.Custom)
            {
                return;
            }
            foreach (var kv in legend.context.buttonList)
            {
                var item     = kv.Value;
                var rect     = item.GetIconRect();
                var radius   = Mathf.Min(rect.width, rect.height) / 2;
                var color    = item.GetIconColor();
                var iconType = legend.iconType;
                if (legend.iconType == Legend.Type.Auto)
                {
                    var serie = chart.GetSerie(item.legendName);
                    if (serie != null && serie is Line)
                    {
                        var sp = new Vector3(rect.center.x - rect.width / 2, rect.center.y);
                        var ep = new Vector3(rect.center.x + rect.width / 2, rect.center.y);
                        UGL.DrawLine(vh, sp, ep, chart.settings.legendIconLineWidth, color);
                        if (!serie.symbol.show)
                        {
                            continue;
                        }
                        switch (serie.symbol.type)
                        {
                        case SymbolType.None:
                            continue;

                        case SymbolType.Circle:
                            iconType = Legend.Type.Circle;
                            break;

                        case SymbolType.Diamond:
                            iconType = Legend.Type.Diamond;
                            break;

                        case SymbolType.EmptyCircle:
                            iconType = Legend.Type.EmptyCircle;
                            break;

                        case SymbolType.Rect:
                            iconType = Legend.Type.Rect;
                            break;

                        case SymbolType.Triangle:
                            iconType = Legend.Type.Triangle;
                            break;
                        }
                    }
                    else
                    {
                        iconType = Legend.Type.Rect;
                    }
                }
                switch (iconType)
                {
                case Legend.Type.Rect:
                    var cornerRadius = chart.settings.legendIconCornerRadius;
                    UGL.DrawRoundRectangle(vh, rect.center, rect.width, rect.height, color, color,
                                           0, cornerRadius, false, 0.5f);
                    break;

                case Legend.Type.Circle:
                    UGL.DrawCricle(vh, rect.center, radius, color);
                    break;

                case Legend.Type.Diamond:
                    UGL.DrawDiamond(vh, rect.center, radius, color);
                    break;

                case Legend.Type.EmptyCircle:
                    var backgroundColor = chart.GetChartBackgroundColor();
                    UGL.DrawEmptyCricle(vh, rect.center, radius, 2 * chart.settings.legendIconLineWidth,
                                        color, color, backgroundColor, 1f);
                    break;

                case Legend.Type.Triangle:
                    UGL.DrawTriangle(vh, rect.center, 1.2f * radius, color);
                    break;
                }
            }
        }
Ejemplo n.º 11
0
        private void DrawPieLabelLine(VertexHelper vh, Serie serie, SerieData serieData, Color color)
        {
            var serieLabel = SerieHelper.GetSerieLabel(serie, serieData);

            if (serieLabel.show &&
                serieLabel.position == SerieLabel.Position.Outside &&
                serieLabel.line)
            {
                var insideRadius  = serieData.runtimePieInsideRadius;
                var outSideRadius = serieData.runtimePieOutsideRadius;
                var center        = serie.runtimeCenterPos;
                var currAngle     = serieData.runtimePieHalfAngle;
                if (!ChartHelper.IsClearColor(serieLabel.lineColor))
                {
                    color = serieLabel.lineColor;
                }
                else if (serieLabel.lineType == SerieLabel.LineType.HorizontalLine)
                {
                    color *= color;
                }
                float currSin = Mathf.Sin(currAngle * Mathf.Deg2Rad);
                float currCos = Mathf.Cos(currAngle * Mathf.Deg2Rad);
                var   radius1 = serieLabel.lineType == SerieLabel.LineType.HorizontalLine ?
                                serie.runtimeOutsideRadius : outSideRadius;
                var radius2 = serie.runtimeOutsideRadius + serieLabel.lineLength1;
                var radius3 = insideRadius + (outSideRadius - insideRadius) / 2;
                if (radius1 < serie.runtimeInsideRadius)
                {
                    radius1 = serie.runtimeInsideRadius;
                }
                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 = serieData.labelPosition;
                if (pos2.x == 0)
                {
                    pos2 = new Vector3(center.x + radius2 * currSin, center.y + radius2 * currCos);
                }
                Vector3 pos4, pos6;
                var     horizontalLineCircleRadius = serieLabel.lineWidth * 4f;
                var     lineCircleDiff             = horizontalLineCircleRadius - 0.3f;
                if (currAngle < 90)
                {
                    var r4 = Mathf.Sqrt(radius1 * radius1 - Mathf.Pow(currCos * radius3, 2)) - currSin * radius3;
                    r4  += serieLabel.lineLength1 - lineCircleDiff;
                    pos6 = pos0 + Vector3.right * lineCircleDiff;
                    pos4 = pos6 + Vector3.right * r4;
                }
                else if (currAngle < 180)
                {
                    var r4 = Mathf.Sqrt(radius1 * radius1 - Mathf.Pow(currCos * radius3, 2)) - currSin * radius3;
                    r4  += serieLabel.lineLength1 - lineCircleDiff;
                    pos6 = pos0 + Vector3.right * lineCircleDiff;
                    pos4 = pos6 + Vector3.right * r4;
                }
                else if (currAngle < 270)
                {
                    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  += serieLabel.lineLength1 - lineCircleDiff;
                    pos6 = pos0 + Vector3.left * lineCircleDiff;
                    pos4 = pos6 + Vector3.left * r4;
                }
                else
                {
                    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  += serieLabel.lineLength1 - lineCircleDiff;
                    pos6 = pos0 + Vector3.left * lineCircleDiff;
                    pos4 = pos6 + Vector3.left * r4;
                }
                var pos5X = currAngle > 180 ? pos2.x - serieLabel.lineLength2 : pos2.x + serieLabel.lineLength2;
                var pos5  = new Vector3(pos5X, pos2.y);
                switch (serieLabel.lineType)
                {
                case SerieLabel.LineType.BrokenLine:
                    UGL.DrawLine(vh, pos1, pos2, pos5, serieLabel.lineWidth, color);
                    break;

                case SerieLabel.LineType.Curves:
                    UGL.DrawCurves(vh, pos1, pos5, pos1, pos2, serieLabel.lineWidth, color,
                                   chart.settings.lineSmoothness);
                    break;

                case SerieLabel.LineType.HorizontalLine:
                    UGL.DrawCricle(vh, pos0, horizontalLineCircleRadius, color);
                    UGL.DrawLine(vh, pos6, pos4, serieLabel.lineWidth, color);
                    break;
                }
            }
        }
        public static void DrawSymbol(VertexHelper vh, SerieSymbolType type, float symbolSize,
                                      float tickness, Vector3 pos, Color32 color, Color32 toColor, float gap, float[] cornerRadius,
                                      Color32 backgroundColor, float smoothness, Vector3 startPos)
        {
            switch (type)
            {
            case SerieSymbolType.None:
                break;

            case SerieSymbolType.Circle:
                if (gap > 0)
                {
                    UGL.DrawDoughnut(vh, pos, symbolSize, symbolSize + gap, backgroundColor, backgroundColor, color, smoothness);
                }
                else
                {
                    UGL.DrawCricle(vh, pos, symbolSize, color, toColor, smoothness);
                }
                break;

            case SerieSymbolType.EmptyCircle:
                if (gap > 0)
                {
                    UGL.DrawCricle(vh, pos, symbolSize + gap, backgroundColor, smoothness);
                    UGL.DrawEmptyCricle(vh, pos, symbolSize, tickness, color, color, backgroundColor, smoothness);
                }
                else
                {
                    UGL.DrawEmptyCricle(vh, pos, symbolSize, tickness, color, color, backgroundColor, smoothness);
                }
                break;

            case SerieSymbolType.Rect:
                if (gap > 0)
                {
                    UGL.DrawSquare(vh, pos, symbolSize + gap, backgroundColor);
                    UGL.DrawSquare(vh, pos, symbolSize, color, toColor);
                }
                else
                {
                    UGL.DrawRoundRectangle(vh, pos, symbolSize, symbolSize, color, color, 0, cornerRadius, true);
                }
                break;

            case SerieSymbolType.Triangle:
                if (gap > 0)
                {
                    UGL.DrawTriangle(vh, pos, symbolSize + gap, backgroundColor);
                    UGL.DrawTriangle(vh, pos, symbolSize, color, toColor);
                }
                else
                {
                    UGL.DrawTriangle(vh, pos, symbolSize, color, toColor);
                }
                break;

            case SerieSymbolType.Diamond:
                if (gap > 0)
                {
                    UGL.DrawDiamond(vh, pos, symbolSize + gap, backgroundColor);
                    UGL.DrawDiamond(vh, pos, symbolSize, color, toColor);
                }
                else
                {
                    UGL.DrawDiamond(vh, pos, symbolSize, color, toColor);
                }
                break;

            case SerieSymbolType.Arrow:
                var arrowWidth  = symbolSize * 2;
                var arrowHeight = arrowWidth * 1.5f;
                var arrowOffset = 0;
                var arrowDent   = arrowWidth / 3.3f;
                UGL.DrawArrow(vh, startPos, pos, arrowWidth, arrowHeight,
                              arrowOffset, arrowDent, color);
                break;
            }
        }
Ejemplo n.º 13
0
        public static void DrawSymbol(VertexHelper vh, SerieSymbolType type, float symbolSize,
                                      float tickness, Vector3 pos, Color32 color, Color32 toColor, float gap, float[] cornerRadius,
                                      Color32 backgroundColor, float smoothness)
        {
            switch (type)
            {
            case SerieSymbolType.None:
                break;

            case SerieSymbolType.Circle:
                if (gap > 0)
                {
                    UGL.DrawDoughnut(vh, pos, symbolSize, symbolSize + gap, backgroundColor, backgroundColor, color, smoothness);
                }
                else
                {
                    UGL.DrawCricle(vh, pos, symbolSize, color, toColor, smoothness);
                }
                break;

            case SerieSymbolType.EmptyCircle:
                if (gap > 0)
                {
                    UGL.DrawCricle(vh, pos, symbolSize + gap, backgroundColor, smoothness);
                    UGL.DrawEmptyCricle(vh, pos, symbolSize, tickness, color, color, backgroundColor, smoothness);
                }
                else
                {
                    UGL.DrawEmptyCricle(vh, pos, symbolSize, tickness, color, color, backgroundColor, smoothness);
                }
                break;

            case SerieSymbolType.Rect:
                if (gap > 0)
                {
                    UGL.DrawSquare(vh, pos, symbolSize + gap, backgroundColor);
                    UGL.DrawSquare(vh, pos, symbolSize, color, toColor);
                }
                else
                {
                    UGL.DrawRoundRectangle(vh, pos, symbolSize, symbolSize, color, color, 0, cornerRadius, true);
                }
                break;

            case SerieSymbolType.Triangle:
                if (gap > 0)
                {
                    UGL.DrawTriangle(vh, pos, symbolSize + gap, backgroundColor);
                    UGL.DrawTriangle(vh, pos, symbolSize, color, toColor);
                }
                else
                {
                    UGL.DrawTriangle(vh, pos, symbolSize, color, toColor);
                }
                break;

            case SerieSymbolType.Diamond:
                if (gap > 0)
                {
                    UGL.DrawDiamond(vh, pos, symbolSize + gap, backgroundColor);
                    UGL.DrawDiamond(vh, pos, symbolSize, color, toColor);
                }
                else
                {
                    UGL.DrawDiamond(vh, pos, symbolSize, color, toColor);
                }
                break;
            }
        }
Ejemplo n.º 14
0
        private void DrawCirleLiquid(VertexHelper vh, Serie serie, Vessel vessel)
        {
            var cenPos    = vessel.runtimeCenterPos;
            var radius    = vessel.runtimeInnerRadius;
            var serieData = serie.GetSerieData(0);

            if (serieData == null)
            {
                return;
            }
            var dataChangeDuration = serie.animation.GetUpdateAnimationDuration();
            var value = serieData.GetCurrData(1, dataChangeDuration);

            if (serie.runtimeCheckValue != value)
            {
                serie.runtimeCheckValue = value;
                m_UpdateLabelText       = true;
            }
            if (serieData.labelPosition != cenPos)
            {
                serieData.labelPosition = cenPos;
                m_UpdateLabelText       = true;
            }
            if (value <= 0)
            {
                return;
            }
            var colorIndex = chart.m_LegendRealShowName.IndexOf(serie.name);

            var realHig = (float)((value - serie.min) / (serie.max - serie.min) * radius * 2);

            serie.animation.InitProgress(1, 0, realHig);

            var hig  = serie.animation.IsFinish() ? realHig : serie.animation.GetCurrDetail();
            var a    = Mathf.Abs(radius - hig + (hig > radius ? serie.waveHeight : -serie.waveHeight));
            var diff = Mathf.Sqrt(radius * radius - Mathf.Pow(a, 2));

            var color          = SerieHelper.GetItemColor(serie, serieData, chart.theme, colorIndex, false);
            var toColor        = SerieHelper.GetItemToColor(serie, serieData, chart.theme, colorIndex, false);
            var isNeedGradient = !ChartHelper.IsValueEqualsColor(color, toColor);
            var isFull         = hig >= 2 * radius;

            if (hig >= 2 * radius)
            {
                hig = 2 * radius;
            }
            if (isFull && !isNeedGradient)
            {
                UGL.DrawCricle(vh, cenPos, radius, toColor, chart.settings.cicleSmoothness);
            }
            else
            {
                var startY       = cenPos.y - radius + hig;
                var waveStartPos = new Vector3(cenPos.x - diff, startY);
                var waveEndPos   = new Vector3(cenPos.x + diff, startY);
                var startX       = hig > radius ? cenPos.x - radius : waveStartPos.x;
                var endX         = hig > radius ? cenPos.x + radius : waveEndPos.x;

                var step = vessel.smoothness;
                if (step < 0.5f)
                {
                    step = 0.5f;
                }
                var lup   = hig > radius ? new Vector3(cenPos.x - radius, cenPos.y) : waveStartPos;
                var ldp   = lup;
                var nup   = Vector3.zero;
                var ndp   = Vector3.zero;
                var angle = 0f;
                serie.runtimeWaveSpeed += serie.waveSpeed * Time.deltaTime;
                var isStarted  = false;
                var isEnded    = false;
                var waveHeight = isFull ? 0 : serie.waveHeight;
                while (startX < endX)
                {
                    startX += step;
                    if (startX > endX)
                    {
                        startX = endX;
                    }
                    if (startX > waveStartPos.x && !isStarted)
                    {
                        startX    = waveStartPos.x;
                        isStarted = true;
                    }
                    if (startX > waveEndPos.x && !isEnded)
                    {
                        startX  = waveEndPos.x;
                        isEnded = true;
                    }
                    var py = Mathf.Sqrt(Mathf.Pow(radius, 2) - Mathf.Pow(Mathf.Abs(cenPos.x - startX), 2));
                    if (startX < waveStartPos.x || startX > waveEndPos.x)
                    {
                        nup = new Vector3(startX, cenPos.y + py);
                    }
                    else
                    {
                        var py2  = waveHeight * Mathf.Sin(1 / serie.waveLength * angle + serie.runtimeWaveSpeed + serie.waveOffset);
                        var nupY = waveStartPos.y + py2;
                        if (nupY > cenPos.y + py)
                        {
                            nupY = cenPos.y + py;
                        }
                        else if (nupY < cenPos.y - py)
                        {
                            nupY = cenPos.y - py;
                        }
                        nup    = new Vector3(startX, nupY);
                        angle += step;
                    }
                    ndp = new Vector3(startX, cenPos.y - py);
                    if (!ChartHelper.IsValueEqualsColor(color, toColor))
                    {
                        var colorMin = cenPos.y - radius;
                        var colorMax = startY + serie.waveHeight;
                        var tcolor1  = Color32.Lerp(color, toColor, 1 - (lup.y - colorMin) / (colorMax - colorMin));
                        var tcolor2  = Color32.Lerp(color, toColor, 1 - (ldp.y - colorMin) / (colorMax - colorMin));
                        UGL.DrawQuadrilateral(vh, lup, nup, ndp, ldp, tcolor1, tcolor2);
                    }
                    else
                    {
                        UGL.DrawQuadrilateral(vh, lup, nup, ndp, ldp, color);
                    }
                    lup = nup;
                    ldp = ndp;
                }
            }

            if (serie.waveSpeed != 0 && Application.isPlaying && !isFull)
            {
                chart.RefreshPainter(serie);
            }
            if (!serie.animation.IsFinish())
            {
                serie.animation.CheckProgress(realHig);
                chart.m_IsPlayingAnimation = true;
                chart.RefreshPainter(serie);
            }
        }
Ejemplo n.º 15
0
        private void DrawPieLabelLine(VertexHelper vh, Serie serie, SerieData serieData, Color color)
        {
            var serieLabel = SerieHelper.GetSerieLabel(serie, serieData);
            var labelLine  = SerieHelper.GetSerieLabelLine(serie, serieData);

            if (serieLabel != null && serieLabel.show &&
                labelLine != null && labelLine.show &&
                (serieLabel.IsDefaultPosition(LabelStyle.Position.Outside)))
            {
                var insideRadius  = serieData.context.insideRadius;
                var outSideRadius = serieData.context.outsideRadius;
                var center        = serie.context.center;
                var currAngle     = serieData.context.halfAngle;

                if (!ChartHelper.IsClearColor(labelLine.lineColor))
                {
                    color = labelLine.lineColor;
                }
                else if (labelLine.lineType == LabelLine.LineType.HorizontalLine)
                {
                    color *= color;
                }

                float currSin = Mathf.Sin(currAngle * Mathf.Deg2Rad);
                float currCos = Mathf.Cos(currAngle * Mathf.Deg2Rad);
                var   radius1 = labelLine.lineType == LabelLine.LineType.HorizontalLine ?
                                serie.context.outsideRadius : outSideRadius;
                var radius3 = insideRadius + (outSideRadius - insideRadius) / 2;
                if (radius1 < serie.context.insideRadius)
                {
                    radius1 = serie.context.insideRadius;
                }
                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 = serieData.context.labelPosition;
                Vector3 pos4, pos6;
                var     horizontalLineCircleRadius = labelLine.lineWidth * 4f;
                var     lineCircleDiff             = horizontalLineCircleRadius - 0.3f;
                var     startAngle                 = serie.context.startAngle;
                if (currAngle < 90)
                {
                    var r4 = Mathf.Sqrt(radius1 * radius1 - Mathf.Pow(currCos * radius3, 2)) - currSin * radius3;
                    r4  += labelLine.lineLength1 - lineCircleDiff;
                    pos6 = pos0 + Vector3.right * lineCircleDiff;
                    pos4 = pos6 + Vector3.right * r4;
                }
                else if (currAngle < 180)
                {
                    var r4 = Mathf.Sqrt(radius1 * radius1 - Mathf.Pow(currCos * radius3, 2)) - currSin * radius3;
                    r4  += labelLine.lineLength1 - lineCircleDiff;
                    pos6 = pos0 + Vector3.right * lineCircleDiff;
                    pos4 = pos6 + Vector3.right * r4;
                }
                else if (currAngle < 270)
                {
                    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  += labelLine.lineLength1 - lineCircleDiff;
                    pos6 = pos0 + Vector3.left * lineCircleDiff;
                    pos4 = pos6 + Vector3.left * r4;
                }
                else
                {
                    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  += labelLine.lineLength1 - lineCircleDiff;
                    pos6 = pos0 + Vector3.left * lineCircleDiff;
                    pos4 = pos6 + Vector3.left * r4;
                }
                var pos5X = (currAngle - startAngle) % 360 > 180 ?
                            pos2.x - labelLine.lineLength2 : pos2.x + labelLine.lineLength2;
                var pos5  = new Vector3(pos5X, pos2.y);
                var angle = Vector3.Angle(pos1 - center, pos2 - pos1);
                if (angle > 15)
                {
                    UGL.DrawLine(vh, pos1, pos5, labelLine.lineWidth, color);
                }
                else
                {
                    switch (labelLine.lineType)
                    {
                    case LabelLine.LineType.BrokenLine:
                        UGL.DrawLine(vh, pos1, pos2, pos5, labelLine.lineWidth, color);
                        break;

                    case LabelLine.LineType.Curves:
                        UGL.DrawCurves(vh, pos1, pos5, pos1, pos2, labelLine.lineWidth, color,
                                       chart.settings.lineSmoothness);
                        break;

                    case LabelLine.LineType.HorizontalLine:
                        UGL.DrawCricle(vh, pos0, horizontalLineCircleRadius, color);
                        UGL.DrawLine(vh, pos6, pos4, labelLine.lineWidth, color);
                        break;
                    }
                }
            }
        }