public static Color32 GetLineGradientColor(VisualMap visualMap, Vector3 pos, CoordinateChart chart, Axis axis,
                                                   Color32 defaultColor)
        {
            float value = 0;
            var   min   = 0f;
            var   max   = 0f;

            if (visualMap.dimension == 0)
            {
                min = axis.runtimeMinValue;
                max = axis.runtimeMaxValue;
                var grid = chart.GetAxisGridOrDefault(axis);
                if (axis.IsCategory() && axis.boundaryGap)
                {
                    float startX = grid.runtimeX + axis.runtimeScaleWidth / 2;
                    value = (int)(min + (pos.x - startX) / (grid.runtimeWidth - axis.runtimeScaleWidth) * (max - min));
                }
                else
                {
                    value = min + (pos.x - grid.runtimeX) / grid.runtimeWidth * (max - min);
                }
            }
            else
            {
                Axis yAxis;
                if (axis is YAxis)
                {
                    yAxis = chart.xAxes[axis.index];
                    min   = yAxis.runtimeMinValue;
                    max   = yAxis.runtimeMaxValue;
                }
                else
                {
                    yAxis = chart.yAxes[axis.index];
                    min   = yAxis.runtimeMinValue;
                    max   = yAxis.runtimeMaxValue;
                }
                var grid = chart.GetAxisGridOrDefault(axis);
                if (yAxis.IsCategory() && yAxis.boundaryGap)
                {
                    float startY = grid.runtimeY + yAxis.runtimeScaleWidth / 2;
                    value = (int)(min + (pos.y - startY) / (grid.runtimeHeight - yAxis.runtimeScaleWidth) * (max - min));
                }
                else
                {
                    value = min + (pos.y - grid.runtimeY) / grid.runtimeHeight * (max - min);
                }
            }
            var color = visualMap.GetColor(value);

            if (ChartHelper.IsClearColor(color))
            {
                return(defaultColor);
            }
            else
            {
                return(color);
            }
        }
        internal static Color32 GetLineGradientColor(VisualMap visualMap, Vector3 pos, CoordinateChart chart, Axis axis, Color32 defaultColor)
        {
            float value = 0;

            switch (visualMap.direction)
            {
            case VisualMap.Direction.Default:
            case VisualMap.Direction.X:
                var min  = axis.runtimeMinValue;
                var max  = axis.runtimeMaxValue;
                var grid = chart.GetAxisGridOrDefault(axis);
                value = min + (pos.x - grid.runtimeX) / grid.runtimeWidth * (max - min);
                break;

            case VisualMap.Direction.Y:
                if (axis is YAxis)
                {
                    var yAxis = chart.xAxes[axis.index];
                    min = yAxis.runtimeMinValue;
                    max = yAxis.runtimeMaxValue;
                }
                else
                {
                    var yAxis = chart.yAxes[axis.index];
                    min = yAxis.runtimeMinValue;
                    max = yAxis.runtimeMaxValue;
                }
                grid  = chart.GetAxisGridOrDefault(axis);
                value = min + (pos.y - grid.runtimeY) / grid.runtimeHeight * (max - min);
                break;
            }
            var color = visualMap.GetColor(value);

            if (ChartHelper.IsClearColor(color))
            {
                return(defaultColor);
            }
            else
            {
                return(color);
            }
        }
        internal static Color32 GetLineStyleGradientColor(LineStyle lineStyle, Vector3 pos, CoordinateChart chart, Axis axis, Color32 defaultColor)
        {
            var min   = axis.runtimeMinValue;
            var max   = axis.runtimeMaxValue;
            var grid  = chart.GetAxisGridOrDefault(axis);
            var value = min + (pos.x - grid.runtimeX) / grid.runtimeWidth * (max - min);
            var rate  = (value - min) / (max - min);
            var color = lineStyle.GetGradientColor(rate, defaultColor);

            if (ChartHelper.IsClearColor(color))
            {
                return(defaultColor);
            }
            else
            {
                return(color);
            }
        }