コード例 #1
0
        private Vector3 GetSinglePos(Axis xAxis, Axis yAxis, GridCoord grid, Serie serie, DataZoom dataZoom, MarkLineData data,
                                     int serieDataCount)
        {
            switch (data.type)
            {
            case MarkLineType.Min:
                var serieData = SerieHelper.GetMinSerieData(serie, data.dimension, dataZoom);
                data.runtimeValue = serieData.GetData(data.dimension);
                var pX = GetAxisPosition(grid, xAxis, dataZoom, serieDataCount, serieData.index);
                var pY = GetAxisPosition(grid, yAxis, dataZoom, serieDataCount, data.runtimeValue);
                return(new Vector3(pX, pY));

            case MarkLineType.Max:
                serieData         = SerieHelper.GetMaxSerieData(serie, data.dimension, dataZoom);
                data.runtimeValue = serieData.GetData(data.dimension);
                pX = GetAxisPosition(grid, xAxis, dataZoom, serieDataCount, serieData.index);
                pY = GetAxisPosition(grid, yAxis, dataZoom, serieDataCount, data.runtimeValue);
                return(new Vector3(pX, pY));

            case MarkLineType.None:
                if (data.zeroPosition)
                {
                    data.runtimeValue = 0;
                    return(grid.context.position);
                }
                else
                {
                    pX = data.xPosition != 0 ? grid.context.x + data.xPosition :
                         GetAxisPosition(grid, xAxis, dataZoom, serieDataCount, data.xValue);
                    pY = data.yPosition != 0 ? grid.context.y + data.yPosition :
                         GetAxisPosition(grid, yAxis, dataZoom, serieDataCount, data.yValue);
                    data.runtimeValue = data.yValue;
                    return(new Vector3(pX, pY));
                }

            default:
                return(grid.context.position);
            }
        }